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 A120503 #31 Aug 02 2022 12:37:50 %S A120503 1,2,3,3,4,5,6,6,7,8,9,9,9,10,11,12,12,13,14,15,15,16,17,18,18,18,19, %T A120503 20,21,21,22,23,24,24,25,26,27,27,27,27,28,29,30,30,31,32,33,33,34,35, %U A120503 36,36,36,37,38,39,39,40,41,42,42,43,44,45,45,45,46,47,48,48,49,50,51,51 %N A120503 Generalized meta-Fibonacci sequence a(n) with parameters s=0 and k=3. %D A120503 Callaghan, Joseph, John J. Chew III, and Stephen M. Tanny. "On the behavior of a family of meta-Fibonacci sequences." SIAM Journal on Discrete Mathematics 18.4 (2005): 794-824. See T_{0,3} with initial values 0,0,1, and plotted in Fig. 1.5. This is essentially the same sequence. - _N. J. A. Sloane_, Apr 16 2014 %H A120503 C. Deugau and F. Ruskey, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL12/Ruskey/ruskey6.html">Complete k-ary Trees and Generalized Meta-Fibonacci Sequences</a>, J. Integer Seq., Vol. 12. [This is a later version than that in the GenMetaFib.html link] %H A120503 C. Deugau and F. Ruskey, <a href="http://www.cs.uvic.ca/~ruskey/Publications/MetaFib/GenMetaFib.html">Complete k-ary Trees and Generalized Meta-Fibonacci Sequences</a> %H A120503 <a href="/index/Ho#Hofstadter">Index entries for Hofstadter-type sequences</a> %F A120503 If n = 1, a(n)=1. If 2 <= n <= 3, then a(n)=n. If n>3 then a(n)=a(n-a(n-1)) + a(n-1-a(n-2)) + a(n-2-a(n-3)) %F A120503 G.f.: A(z) = z / (1 - z) * prod( (1 - z^(3 * [i])) / (1 - z^[i]), i=1..infinity), where [i] = (3^i - 1) / 2. %F A120503 a(n) = A007844(n)/3. - _Michel Marcus_, Aug 19 2013, conjectured. This is true: see the analogous sequence A007843 for a sketch of the proof. - _M. F. Hasler_, Dec 27 2019 %p A120503 a := proc(n) %p A120503 option remember; %p A120503 if n <= 1 then return 1 end if; %p A120503 if n <= 3 then return n end if; %p A120503 return add(a(n - i + 1 - a(n - i)), i = 1 .. 3) %p A120503 end proc %t A120503 a[n_] := a[n] = If[1 <= n <= 3, n, Sum[a[n-i+1 - a[n-i]], {i, 1, 3}]]; %t A120503 Table[a[n], {n, 1, 80}] (* _Jean-François Alcover_, Aug 02 2022 *) %o A120503 (PARI) {a(n)=local(A); if(n<=3, max(0, n), A=vector(n, i, i); for(k=4, n, A[k]=A[k-A[k-1]]+A[k-1-A[k-2]]+A[k-2-A[k-3]]); A[n])} /* _Michael Somos_, Aug 31 2006 */ %o A120503 (PARI) apply( A120503(n)={my(s=sumdigits(n*=2, 3)\2); n\=3; while(s>0, s-=valuation(n++, 3)+1); n}, [1..99]) \\ _M. F. Hasler_, Dec 27 2019 %Y A120503 Cf. A120514, A120525. %K A120503 nonn %O A120503 1,2 %A A120503 _Frank Ruskey_ and Chris Deugau (deugaucj(AT)uvic.ca), Jun 20 2006