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!)
A287654 a(1) = 1, a(2) = a(3) = a(4) = 2; a(n) = a(a(n-1)) + a(a(n-a(n-1)) + a(n-a(n-2))) for n > 4. 3

%I #24 May 31 2017 22:59:34

%S 1,2,2,2,4,4,4,4,6,8,8,6,8,8,8,8,10,14,16,12,14,14,14,16,16,16,16,14,

%T 16,16,16,16,20,26,24,24,24,24,24,24,28,28,22,28,30,30,28,30,32,32,32,

%U 32,30,32,32,32,32,32,32,30,32,32,32,32,40,52,48,42,44,44,44,42,44,44,44,44,52,60,46,54,56,48,54,56,48

%N a(1) = 1, a(2) = a(3) = a(4) = 2; a(n) = a(a(n-1)) + a(a(n-a(n-1)) + a(n-a(n-2))) for n > 4.

%C There are substantial jumps between generations (i.e. a(2^19) = 2^18 and a(2^19 + 1) = 327608). See also scatterplot in links section.

%H Altug Alkan, <a href="/A287654/a287654_1.png">Scatterplot of a(n)</a>

%H <a href="/index/Ho#Hofstadter">Index entries for Hofstadter-type sequences</a>

%p N:= 2^10: # to get a(1) to a(N)

%p C[1]:= 1:

%p C[2]:= 2:

%p C[3]:= 2:

%p C[4]:= 2:

%p for n from 5 to N do

%p C[n]:= C[C[n-1]] + C[C[n-C[n-1]] + C[n-C[n-2]]];

%p od:

%p S:=seq(C[n], n=1..N);

%o (Scheme)

%o ;; An implementation of memoization-macro definec can be found for example in: http://oeis.org/wiki/Memoization

%o (definec (A287654 n) (cond ((= 1 n) n) ((<= n 4) 2) (else (+ (A287654 (A287654 (- n 1))) (A287654 (+ (A287654 (- n (A287654 (- n 1)))) (A287654 (- n (A287654 (- n 2)))))))))) ;; _Antti Karttunen_, May 31 2017

%Y Cf. A004001, A005185, A287292, A287707.

%K nonn

%O 1,2

%A _Altug Alkan_, May 30 2017

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 April 18 13:29 EDT 2024. Contains 371780 sequences. (Running on oeis4.)