0
$\begingroup$

Need formula for:

f(x) => y

where x and y are:

0..4 => 1

5..14 => 2

15..29 => 3

30..49 => 4

etc.

i also need the opposite:

f(a) => b,c

where a,b and c are:

1 => 0,5

2 => 5,10

3 => 15,15

4 => 30,20

I'm stumped. Thanks in advance! I'm currently pursuing getting the largest consecutive numbers which satisfy n * (n+1) / 2 by getting a sqrt on the sum (after dividing by 5) since the sums are scaled x5.

1 Answers 1

1

Divide by 5, multiply by 8, add 1, take the square root, divide by 2, and round to the nearest integer.

The second doesn't seem to be the "opposite" of the first, as 2 goes to 5, 10 instead of 5, 14, and 3 goes to 15, 15 instead of 15, 29, etc. Which did you want?

  • 0
    We aim to please.2011-12-02