This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A037257 #12 Mar 04 2020 22:56:58 %S A037257 1,3,9,20,38,64,100,148,209,284,374,480,603,745,908,1093,1301,1533, %T A037257 1790,2075,2389,2733,3108,3515,3955,4429,4938,5484,6069,6694,7360, %U A037257 8068,8819,9614,10454,11340,12273,13255,14287,15370,16505,17693,18935,20232 %N A037257 a() = 1,3,... [ A037257 ], differences = 2,... [ A037258 ] and 2nd differences [ A037259 ] are disjoint and monotonic; adjoin next free number to 2nd differences unless it would produce a duplicate in which case ignore. %C A037257 27 and 250 are the first two numbers to be ignored. %C A037257 I discovered this around 1979; Martin Gardner described a version of it in his 1980 article. %D A037257 M. Gardner, Weird Numbers from Titan, Isaac Asimov's Science Fiction Magazine, Vol. 4, No. 5, May 1980, pp. 42ff. %e A037257 After 1 3 9 20 with differences %e A037257 ------ 2 6 11 and 2nd differences %e A037257 ------- 4 5, the next free number is 7 so we get %e A037257 ----- 1 3 9 20 38 ... %e A037257 ------ 2 6 11 18 ... %e A037257 ------- 4 5 7 .... %t A037257 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 *) %Y A037257 Cf. A005228, A030124. %K A037257 nonn,easy,nice %O A037257 0,2 %A A037257 _N. J. A. Sloane_ %E A037257 More terms from Larry Reeves (larryr(AT)acm.org), Sep 25 2000