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.

A181616 a(1)=5; thereafter a(2n) = nextprime(a(2n-1)^2), a(2n+1) = nextprime(floor(2*a(2n)/(a(2n-1) + 1))) where nextprime(.) is A007918(.).

Original entry on oeis.org

5, 29, 11, 127, 23, 541, 47, 2213, 97, 9413, 193, 37253, 389, 151337, 787, 619373, 1579, 2493259, 3163, 10004573, 6329, 40056253, 12659, 160250297, 25321, 641153069, 50647, 2565118639, 101293, 10260271859, 202591, 41043113401, 405199
Offset: 1

Views

Author

Bill McEachen, Jan 30 2011

Keywords

Comments

This gives a sawtooth log plot a bit reminiscent of Goldbach's comet, with wave frequency and amplitude increasing indefinitely. I started at 5 for no particular reason.
The two "lines" in the graph approach ratio 2.0 and 4.0 respectively for consecutive terms. The two are then (5, 11, 23, 47, ...) and (29, 127, 541, 2213, ...). - Bill McEachen, Sep 27 2013

Examples

			Beginning at 5 (n=1), a(2) via nextprime(5^2) = 29.
Divisor = ceiling(5/2) = 3 so a(3) = nextprime(floor(29/3)) = 11.
Then repeat: a(4) via nextprime(11^2) = 127.
Divisor = ceiling(11/2) = 6 so a(5) = nextprime(floor(127/6)) = 23.
		

Programs

  • Maple
    A007491 := proc(n) nextprime(n^2) ; end proc:
    A181616 := proc(n) option remember; if n = 1 then 5; elif type(n,'even') then A007491(procname(n-1)) ; else 2*procname(n-1)/(procname(n-2)+1) ; nextprime(floor(%)) ; end if; end proc: # R. J. Mathar, Feb 09 2011
  • Mathematica
    a[1] = 5; a[n_] := a[n] = If[OddQ@ n, NextPrime[ a[n - 1]/Ceiling[ a[n - 2]/2]], NextPrime[ a[n - 1]^2]]; Array[a, 33]
  • PARI
    \\ example call newseq9(2,50) to use square power, 1st 50 terms
    \\  I never tried any power but 2
    newseq9(a,iend)=
    {
    a=floor(a);
    if(a<2,a=2);
    i5=5;
    print(i5);
    for(n=1,iend,
      i6=nextprime(i5^a);
      b=ceil(i5/2);   \\ vary as f{i5}
      i7=nextprime(floor(i6/b));
      print(i6);
      print(i7);
      i5=i7
    );  \\end FOR
    print("Designed pgm exit (a,b) ...",a," , ",b);
    }