OFFSET
0,3
LINKS
Robert Israel, Table of n, a(n) for n = 0..500
Michael Gilleland, Some Self-Similar Integer Sequences
Eric Weisstein's World of Mathematics, Stern's Diatomic Series
EXAMPLE
a(0) = 0;
a(1) = 1;
a(2) = a(2*1) = prime(a(1)) = prime(1) = 2;
a(3) = a(2*1+1) = prime(a(1)+a(2)) = prime(3) = 5;
a(4) = a(2*2) = prime(a(2)) = prime(2) = 3;
a(5) = a(2*2+1) = prime(a(2)+a(3)) = prime(7) = 17, etc.
MAPLE
A[0]:= 0: A[1]:= 1:
for n from 1 to 50 do
A[2*n]:= ithprime(A[n]);
A[2*n+1]:= ithprime(A[n]+A[n+1]);
od:
seq(A[i], i=0..101); # Robert Israel, Apr 25 2017
MATHEMATICA
a[0] = 0; a[1] = 1; a[n_] := If[EvenQ[n], Prime[a[n/2]], Prime[a[(n - 1)/2] + a[(n + 1)/2]]]; Table[a[n], {n, 0, 60}]
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Ilya Gutkovskiy, Apr 25 2017
STATUS
approved