OFFSET
0,2
COMMENTS
27 and 250 are the first two numbers to be ignored.
I discovered this around 1979; Martin Gardner described a version of it in his 1980 article.
REFERENCES
M. Gardner, Weird Numbers from Titan, Isaac Asimov's Science Fiction Magazine, Vol. 4, No. 5, May 1980, pp. 42ff.
EXAMPLE
After 1 3 9 20 with differences
------ 2 6 11 and 2nd differences
------- 4 5, the next free number is 7 so we get
----- 1 3 9 20 38 ...
------ 2 6 11 18 ...
------- 4 5 7 ....
MATHEMATICA
ClearAll[a]; A037257 = {a[0]=1, a[1]=3, a[2]=9}; d1 = Differences[A037257]; d2 = Differences[d1]; ignored = {}; a[n_] := a[n] = (u = Union[A037257, d1, d2, ignored]; m = MapIndexed[List, u]; sel = Select[m, #1[[1]] != #1[[2, 1]] & , 1]; For[nextFree = sel[[1, 2, 1]], True, nextFree++, an2 = nextFree; an = an2 - a[n-2] + 2*a[n-1]; an1 = an - a[n-1]; If[ FreeQ[ ignored, an2] && Length[ Join[ A037257, d1, d2, {an, an1, an2}]] == Length[ Union[ A037257, d1, d2, {an, an1, an2}]], Break[], AppendTo[ ignored, an2]] ]; AppendTo[ A037257, an]; AppendTo[d1, an1]; AppendTo[d2, an2]; an); Table[a[n], {n, 0, 43}] (* Jean-François Alcover, Sep 14 2012 *)
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org), Sep 25 2000
STATUS
approved