cp's OEIS Frontend

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.

A244477 a(1)=3, a(2)=2, a(3)=1; thereafter a(n) = a(n-a(n-1)) + a(n-a(n-2)).

This page as a plain text file.
%I A244477 #43 Mar 17 2024 11:40:18
%S A244477 3,2,1,3,5,4,3,8,7,3,11,10,3,14,13,3,17,16,3,20,19,3,23,22,3,26,25,3,
%T A244477 29,28,3,32,31,3,35,34,3,38,37,3,41,40,3,44,43,3,47,46,3,50,49,3,53,
%U A244477 52,3,56,55,3,59,58,3,62,61,3,65,64,3,68,67,3,71,70,3,74,73,3,77,76,3,80
%N A244477 a(1)=3, a(2)=2, a(3)=1; thereafter a(n) = a(n-a(n-1)) + a(n-a(n-2)).
%C A244477 Similar to Hofstadter's Q-sequence A005185 but with different starting values.
%C A244477 Golomb describes this as "quasi-periodic sequence with a quasi-period of 3".
%D A244477 Higham, J.; Tanny, S. More well-behaved meta-Fibonacci sequences. Proceedings of the Twenty-fourth Southeastern International Conference on Combinatorics, Graph Theory, and Computing (Boca Raton, FL, 1993). Congr. Numer. 98(1993), 3-17.
%H A244477 Reinhard Zumkeller, <a href="/A244477/b244477.txt">Table of n, a(n) for n = 1..10000</a>
%H A244477 Altug Alkan, Nathan Fox, and Orhan Ozgur Aybar, <a href="https://doi.org/10.1155/2017/2614163">On Hofstadter Heart Sequences</a>, Complexity, Volume 2017, Article ID 2614163, 8 pages.
%H A244477 Nathan Fox, <a href="https://vimeo.com/141111990">Linear-Recurrent Solutions to Meta-Fibonacci Recurrences, Part 1 (video)</a>, Rutgers Experimental Math Seminar, Oct 01 2015. Part 2 is vimeo.com/141111991.
%H A244477 S. W. Golomb, <a href="/A005185/a005185_1.pdf">Discrete chaos: sequences satisfying "strange" recursions</a>, unpublished manuscript, circa 1990 [cached copy, with permission (annotated)]
%H A244477 <a href="/index/Ho#Hofstadter">Index entries for Hofstadter-type sequences</a>
%H A244477 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0, 0, 2, 0, 0, -1).
%F A244477 From _Colin Barker_, Nov 23 2015: (Start)
%F A244477 a(n) = 2*a(n-3) - a(n-6) for n>6.
%F A244477 G.f.: x*(2*x^5 + x^4 - 3*x^3 + x^2 + 2*x + 3)/((x - 1)^2*(x^2 + x + 1)^2). (End)
%F A244477 a(3*k) = 3*k-2, a(3*k+1) = 3, a(3*k+2) = 3*k+2. - _Nathan Fox_, Apr 02 2017
%F A244477 a(n) = 3*(m-1)^2*floor(n/3) - (3*m^2-8*m+2), where m = n mod 3. - _Luce ETIENNE_, Oct 17 2018
%p A244477 f := proc(n) option remember;
%p A244477     if n<=3 then
%p A244477         4-n
%p A244477     elif n > procname(n-1) and n > procname(n-2) then
%p A244477         RETURN(procname(n-procname(n-1))+procname(n-procname(n-2)));
%p A244477     else
%p A244477         ERROR(" died at n= ", n);
%p A244477     fi;
%p A244477 end proc;
%p A244477 [seq(f(n),n=0..200)];
%t A244477 a[1] = 3; a[2] = 2; a[3] = 1; a[n_] := a[n] = a[n - a[n - 1]] + a[n - a[n - 2]]; Array[a, 75] (* or *)
%t A244477 Flatten@ Table[{Mod[3n, 3] +3, 3n -1, 3n -2}, {n, 25}] (* _Robert G. Wilson v_, Nov 23 2015 *)
%o A244477 (Haskell)
%o A244477 a244477 n = a244477_list !! (n-1)
%o A244477 a244477_list = 3 : 2 : 1 : zipWith (+)
%o A244477    (map a244477 $ zipWith (-) [4..] $ tail a244477_list)
%o A244477    (map a244477 $ zipWith (-) [4..] $ drop 2 a244477_list)
%o A244477 -- _Reinhard Zumkeller_, Jul 05 2014
%o A244477 (Magma) [n le 3 select 4-n else Self(n-Self(n-1)) + Self(n-Self(n-2)): n in [1..80]]; // _Vincenzo Librandi_, Nov 24 2015
%Y A244477 Cf. A005185.
%Y A244477 Cf. A010872.
%K A244477 nonn,easy
%O A244477 1,1
%A A244477 _N. J. A. Sloane_, Jul 02 2014