OFFSET
0,4
COMMENTS
A variation on Stern's diatomic sequence.
LINKS
Michael Gilleland, Some Self-Similar Integer Sequences
Eric Weisstein's World of Mathematics, Greatest Prime Factor
Eric Weisstein's World of Mathematics, Stern's Diatomic Series
EXAMPLE
a(0) = 0;
a(1) = 1;
a(2) = a(2*1) = gpf(a(1)) = 1;
a(3) = a(2*1+1) = a(1) + a(2) = 2;
a(4) = a(2*2) = gpf(a(2)) = 1;
a(5) = a(2*2+1) = a(2) + a(3) = 3;
a(6) = a(2*3) = gpf(a(3)) = 2, etc.
MATHEMATICA
a[0] = 0; a[1] = 1; a[n_] := If[EvenQ[n], FactorInteger[a[n/2]][[-1, 1]], a[(n - 1)/2] + a[(n + 1)/2]]; Table[a[n], {n, 0, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, May 18 2017
STATUS
approved