Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #9 Apr 25 2017 15:42:58
%S 0,1,2,5,3,17,11,19,5,71,59,107,31,113,67,89,11,383,353,733,277,983,
%T 587,787,127,827,617,1069,331,911,461,541,31,2707,2647,5573,2381,8713,
%U 5557,8017,1787,10271,7753,13187,4273,11383,6037,7129,709,7529,6353,12049,4549,14389,8581,11657,2221,10111,7109,11353,3259
%N a(0) = 0, a(1) = 1; a(2*n) = prime(a(n)), a(2*n+1) = prime(a(n)+a(n+1)).
%C A variation on Stern's diatomic sequence (A002487) and primeth recurrence (A007097).
%H Robert Israel, <a href="/A285743/b285743.txt">Table of n, a(n) for n = 0..500</a>
%H Michael Gilleland, <a href="/selfsimilar.html">Some Self-Similar Integer Sequences</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) = 1;
%e a(2) = a(2*1) = prime(a(1)) = prime(1) = 2;
%e a(3) = a(2*1+1) = prime(a(1)+a(2)) = prime(3) = 5;
%e a(4) = a(2*2) = prime(a(2)) = prime(2) = 3;
%e a(5) = a(2*2+1) = prime(a(2)+a(3)) = prime(7) = 17, etc.
%p A[0]:= 0: A[1]:= 1:
%p for n from 1 to 50 do
%p A[2*n]:= ithprime(A[n]);
%p A[2*n+1]:= ithprime(A[n]+A[n+1]);
%p od:
%p seq(A[i],i=0..101); # _Robert Israel_, Apr 25 2017
%t 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}]
%Y Cf. A002487, A007097, A082096, A259622, A285742.
%K nonn,look
%O 0,3
%A _Ilya Gutkovskiy_, Apr 25 2017