login
A287093
a(0) = 0, a(1) = 2; a(2*n) = sopf(a(n)), a(2*n+1) = a(n) + a(n+1), where sopf() is the sum of the distinct prime factors (A008472).
1
0, 2, 2, 4, 2, 6, 2, 6, 2, 8, 5, 8, 2, 8, 5, 8, 2, 10, 2, 13, 5, 13, 2, 10, 2, 10, 2, 13, 5, 13, 2, 10, 2, 12, 7, 12, 2, 15, 13, 18, 5, 18, 13, 15, 2, 12, 7, 12, 2, 12, 7, 12, 2, 15, 13, 18, 5, 18, 13, 15, 2, 12, 7, 12, 2, 14, 5, 19, 7, 19, 5, 14, 2, 17, 8, 28, 13, 31, 5, 23, 5, 23, 5, 31, 13, 28, 8, 17, 2, 14, 5
OFFSET
0,2
COMMENTS
A variation on Stern's diatomic sequence.
EXAMPLE
a(0) = 0;
a(1) = 2;
a(2) = a(2*1) = sopf(a(1)) = 2;
a(3) = a(2*1+1) = a(1) + a(2) = 4;
a(4) = a(2*2) = sopf(a(2)) = 2;
a(5) = a(2*2+1) = a(2) + a(3) = 6;
a(6) = a(2*3) = sopf(a(3)) = 2, etc.
MATHEMATICA
a[0] = 0; a[1] = 2; a[n_] := If[EvenQ[n], DivisorSum[a[n/2], # &, PrimeQ[#] &], a[(n - 1)/2] + a[(n + 1)/2]]; Table[a[n], {n, 0, 90}]
PROG
(PARI) a(n) = if (n==0, 0, if (n ==1, 2, if (n%2, a((n-1)/2) + a((n+1)/2), vecsum(factor(a(n/2))[, 1])))); \\ Michel Marcus, Dec 17 2017
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Ilya Gutkovskiy, May 19 2017
STATUS
approved