The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A106733 a(n) = a(a(a(a(n - a(n-1))))) + a(n - a(n-2)) with a(1) = a(2) = 1. 2

%I #14 Sep 11 2021 15:18:39

%S 1,1,2,3,3,3,4,4,4,4,5,5,5,5,5,6,6,6,6,6,6,7,7,7,7,7,7,7,9,8,9,9,9,9,

%T 9,9,9,11,10,11,11,11,11,11,11,11,11,11,13,12,13,13,13,13,13,13,13,13,

%U 13,13,13,15,14,15,15,15,15,15,15,15,15,15,15,15,15,15,17,16,17,17,17,17

%N a(n) = a(a(a(a(n - a(n-1))))) + a(n - a(n-2)) with a(1) = a(2) = 1.

%C A fifth-order recursion based on Hofstadter's Q-sequence A005185.

%H Paolo P. Lava, <a href="/A106733/b106733.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = a(a(a(a(n - a(n-1))))) + a(n - a(n-2)) with a(1) = a(2) = 1.

%t Hofstadter1[1] = Hofstadter1[2] = 1; Hofstadter1[n_Integer?Positive] := Hofstadter1[n] = Hofstadter1[Hofstadter1[Hofstadter1[Hofstadter1[n - Hofstadter1[n - 1]]]]] + Hofstadter1[ n - Hofstadter1[n - 2]]; a = Table[Hofstadter1[n], {n, 1, digits}]

%o (Sage)

%o @CachedFunction

%o def a(n): return 1 if (n<3) else a(a(a(a(n -a(n-1))))) + a(n-a(n-2));

%o [a(n) for n in (1..90)] # _G. C. Greubel_, Sep 11 2021

%Y Cf. A005185, A087842.

%K nonn,easy

%O 1,3

%A _Roger L. Bagula_, May 30 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 3 05:44 EDT 2024. Contains 373054 sequences. (Running on oeis4.)