cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A285743 a(0) = 0, a(1) = 1; a(2*n) = prime(a(n)), a(2*n+1) = prime(a(n)+a(n+1)).

Original entry on oeis.org

0, 1, 2, 5, 3, 17, 11, 19, 5, 71, 59, 107, 31, 113, 67, 89, 11, 383, 353, 733, 277, 983, 587, 787, 127, 827, 617, 1069, 331, 911, 461, 541, 31, 2707, 2647, 5573, 2381, 8713, 5557, 8017, 1787, 10271, 7753, 13187, 4273, 11383, 6037, 7129, 709, 7529, 6353, 12049, 4549, 14389, 8581, 11657, 2221, 10111, 7109, 11353, 3259
Offset: 0

Views

Author

Ilya Gutkovskiy, Apr 25 2017

Keywords

Comments

A variation on Stern's diatomic sequence (A002487) and primeth recurrence (A007097).

Examples

			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)+a(2)) = prime(3) = 5;
a(4) = a(2*2) = prime(a(2)) = prime(2) = 3;
a(5) = a(2*2+1) = prime(a(2)+a(3)) = prime(7) = 17, etc.
		

Crossrefs

Programs

  • Maple
    A[0]:= 0: A[1]:= 1:
    for n from 1 to 50 do
      A[2*n]:= ithprime(A[n]);
      A[2*n+1]:= ithprime(A[n]+A[n+1]);
    od:
    seq(A[i],i=0..101); # Robert Israel, Apr 25 2017
  • Mathematica
    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}]