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 A151747 #14 Aug 04 2022 11:00:28 %S A151747 0,1,3,5,8,9,11,17,21,15,11,18,25,29,39,54,53,27,11,18,25,29,39,55,57, %T A151747 41,40,61,79,97,132,160,129,51,11,18,25,29,39,55,57,41,40,61,79,97, %U A151747 132,161,133,65,40,61,79,97,133,167,155,122,141,201,255,326,424,448,305,99,11,18 %N A151747 Except for boundary cases (n <= 3, j = 0, 1, 2^i-1), satisfies a(n) = a(2^i+j) = 2 a(j) + a(j+1), where n = 2^i + j, 0 <= j < 2^i . %C A151747 The boundary cases are covered by the following formulas: %C A151747 a(n) = 2n-1 if n<=3. %C A151747 a(n) = 1+(3*i+1)*2^(i-2) if j=0. %C A151747 a(n) = 3+ 3*2^(i-1) if j= 1. %C A151747 a(n) = 2*a(j)+a(j+1)-1 if j=2^i-1. %H A151747 David Applegate, <a href="/A139250/a139250.anim.html">The movie version</a> [See A151725, variant] %H A151747 David Applegate, Omar E. Pol and N. J. A. Sloane, <a href="/A000695/a000695_1.pdf">The Toothpick Sequence and Other Sequences from Cellular Automata</a>, Congressus Numerantium, Vol. 206 (2010), 157-191. [There is a typo in Theorem 6: (13) should read u(n) = 4.3^(wt(n-1)-1) for n >= 2.] %H A151747 N. J. A. Sloane, <a href="/wiki/Catalog_of_Toothpick_and_CA_Sequences_in_OEIS">Catalog of Toothpick and Cellular Automata Sequences in the OEIS</a> %e A151747 If written as a triangle: %e A151747 .0, %e A151747 .1, %e A151747 .3, 5, %e A151747 .8, 9, 11, 17, %e A151747 .21, 15, 11, 18, 25, 29, 39, 54, %e A151747 .53, 27, 11, 18, 25, 29, 39, 55, 57, 41, 40, 61, 79, 97, 132, 160, %e A151747 .129, 51, 11, 18, 25, 29, 39, 55, 57, 41, 40, 61, 79, 97, 132, 161, 133, 65, 40, 61, 79, 97, 133, 167, 155, 122, 141, 201, 255, 326, 424, 448, %e A151747 .305, 99, 11, 18, 25, 29, 39, 55, 57, 41, 40, 61, 79, 97, 132, 161, 133, 65, 40, 61, 79, 97, 133, 167, 155, 122, 141, 201, 255, 326, 424, 449, 309, 113, 40, 61, 79, 97, 133, 167, 155, 122, 141, 201, 255, 326, 425, 455, 331, 170, 141, 201, 255, 327, 433, 489, 432, 385, 483, 657, 836, 1076, 1296, 1200, %e A151747 .705, 195, 11, 18, 25, 29, 39, 55, 57, 41, 40, 61, 79, 97, 132, 161, 133, 65, 40, 61, 79, 97, 133, 167, 155, 122, 141, 201, 255, 326, 424, 449, 309, 113, 40, 61, 79, 97, 133, 167, 155, 122, 141, 201, 255, 326, 425, 455, 331, 170, 141, 201, 255, 327, 433, 489, 432, 385, 483, 657, 836, 1076, 1296, 1201, 709, 209, 40, 61, 79, 97, 133, 167, 155, 122, 141, 201, 255, 326, 425, 455, 331, 170, 141, 201, 255, 327, 433, 489, 432, 385, 483, 657, 836, 1076, 1297, 1207, 731, 266, 141, 201, 255, 327, 433, 489, 432, 385, 483, 657, 836, 1077, 1305, 1241, 832, 481, 483, 657, 837, 1087, 1355, 1410, 1249, 1253, 1623, ... %e A151747 then the rows (omitting the first two terms of each row) converge to A151748. %p A151747 A151747 := proc(n) option remember; local i, j; %p A151747 if (n <= 0) then %p A151747 0; %p A151747 elif (n <= 3) then %p A151747 2*n-1; %p A151747 else %p A151747 i := floor(log(n)/log(2)); %p A151747 j := n - 2^i; %p A151747 if (j = 0) then (3*i+1)*2^(i-2)+1; %p A151747 elif (j = 1) then 3*2^(i-1)+3; %p A151747 elif (j = 2^i-1) then 2*procname(j)+procname(j+1)-1; %p A151747 else 2*procname(j)+procname(j+1); %p A151747 end if; %p A151747 end if; %p A151747 end proc; %t A151747 a[n_] := a[n] = Module[{i, j}, Which[n <= 0, 0, n <= 3, 2n-1, True, i = Floor[Log2[n]]; j = n-2^i; Which[j == 0, (3i+1)*2^(i-2)+1, j == 1, 3*2^(i-1)+3, j == 2^i-1, 2a[j] + a[j+1] - 1,True, 2a[j] + a[j+1]]]]; %t A151747 Table[a[n], {n, 0, 67}] (* _Jean-François Alcover_, Aug 04 2022, from Maple code *) %Y A151747 Cf. A151725, A151726, A151735, A151748, A139250, A170879. %Y A151747 The first column gives A170881. %K A151747 nonn,tabf %O A151747 0,3 %A A151747 _David Applegate_, Jun 16 2009