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 A005350 M0253 #41 Mar 27 2024 08:40:44 %S A005350 1,1,1,2,2,3,3,3,4,5,5,5,5,6,7,7,8,8,8,8,8,9,10,11,11,12,12,12,13,13, %T A005350 13,13,13,13,14,15,16,16,17,18,18,19,19,19,20,20,20,20,21,21,21,21,21, %U A005350 21,21,22,23,24,25,25,26,27,27,28 %N A005350 a(1) = a(2) = a(3) = 1, a(n) = a(a(n-1)) + a(n-a(n-1)) for n >= 4. %C A005350 a(n) - a(n-1) = 0 or 1 (see the 1991 Monthly reference). - _Emeric Deutsch_, Jun 06 2005 %D A005350 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A005350 T. D. Noe, <a href="/A005350/b005350.txt">Table of n, a(n) for n = 1..1000</a> %H A005350 R. K. Guy, <a href="http://www.jstor.org/stable/2691503">The Second Strong Law of Small Numbers</a>, Math. Mag, 63 (1990), no. 1, 3-20. %H A005350 R. K. Guy, <a href="/A005347/a005347.pdf">The Second Strong Law of Small Numbers</a>, Math. Mag, 63 (1990), no. 1, 3-20. [Annotated scanned copy] %H A005350 R. K. Guy and N. J. A. Sloane, <a href="/A005180/a005180.pdf">Correspondence</a>, 1988. %H A005350 D. Kleitman, <a href="http://www.jstor.org/stable/2324158">Solution to Problem E3274</a>, Amer. Math. Monthly, 98 (1991), 958-959. %p A005350 A005350 := proc(n) option remember; if n<=3 then 1 else procname(procname(n-1)) + procname(n-procname(n-1)); end if; end proc: %p A005350 seq(A005350(n),n=1..64) ; %t A005350 a[1] = a[2] = a[3] = 1; a[n_] := a[n] = a[a[n-1]] + a[n-a[n-1]]; Table[a[n], {n, 1, 64}] (* _Jean-François Alcover_, Feb 11 2014 *) %o A005350 (Haskell) %o A005350 a005350 n = a005350_list !! (n-1) %o A005350 a005350_list = 1 : 1 : 1 : h 4 1 where %o A005350 h x y = z : h (x + 1) z where z = a005350 y + a005350 (x - y) %o A005350 -- _Reinhard Zumkeller_, Jul 20 2012 %o A005350 (SageMath) %o A005350 @CachedFunction %o A005350 def a(n): return 1 if (n<4) else a(a(n-1)) + a(n-a(n-1)) %o A005350 [a(n) for n in range(1,100)] # _G. C. Greubel_, Nov 14 2022 %Y A005350 Cf. A004001, A005185, A005707. %K A005350 nonn,easy,nice %O A005350 1,4 %A A005350 _N. J. A. Sloane_, _R. K. Guy_