Take a sequence of non-negative integers, i.e. 0,1,2,3, . etc
all square numbers.
You will be left with a sequence like : 2,3,5,6,7,8,10 ...etc.
Find an explicit formula for an.
Call the desired formula f(i).
My first step was to make a column in Excel using "IF" to create the desired sequence.
Next I generated f(i) - i which produces the difference sequence, call it d(i): 1,1,2,2,2,2,3,3,3,3,3,3, ... the number of instances of the next number always increases by 2.
f(i) = i + d(i)
I noticed that whenever i is a perfect square, d(i) is exactly sqrt(i).
Also i=4 is roughly in the middle of the "2"s, i=9 is roughly in the middle of the "3"s.
Trial and error then led to this formula:
f(i) = i + int(sqrt(i) + 0.5)
Posted by Larry
on 2017-09-12 08:34:45