OFFSET
0,3
LINKS
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)) + prime(a(2)) = prime(1) + prime(2) = 2 + 3 = 5;
a(4) = a(2*2) = prime(a(2)) = prime(2) = 3;
a(5) = a(2*2+1) = prime(a(2)) + prime(a(3)) = prime(2) + prime(5) = 3 + 11 = 14, etc.
MATHEMATICA
a[0] = 0; a[1] = 1; a[n_] := If[EvenQ[n], Prime[a[n/2]], Prime[a[(n - 1)/2]] + Prime[a[(n + 1)/2]]]; Table[a[n], {n, 0, 60}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Apr 25 2017
STATUS
approved