login
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

%I #14 Mar 14 2018 21:18:12

%S 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,

%T 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,

%U 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

%N 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).

%C A variation on Stern's diatomic sequence.

%H G. C. Greubel, <a href="/A287093/b287093.txt">Table of n, a(n) for n = 0..5000</a>

%H Michael Gilleland, <a href="/selfsimilar.html">Some Self-Similar Integer Sequences</a>

%H Ilya Gutkovskiy, <a href="/A287093/a287093.pdf">Extended graphical example</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/SternsDiatomicSeries.html">Stern's Diatomic Series</a>

%H <a href="/index/St#Stern">Index entries for sequences related to Stern's sequences</a>

%e a(0) = 0;

%e a(1) = 2;

%e a(2) = a(2*1) = sopf(a(1)) = 2;

%e a(3) = a(2*1+1) = a(1) + a(2) = 4;

%e a(4) = a(2*2) = sopf(a(2)) = 2;

%e a(5) = a(2*2+1) = a(2) + a(3) = 6;

%e a(6) = a(2*3) = sopf(a(3)) = 2, etc.

%t 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}]

%o (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

%Y Cf. A002487, A008472, A287051.

%K nonn,look

%O 0,2

%A _Ilya Gutkovskiy_, May 19 2017