Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #27 Jan 27 2019 08:45:42
%S 5,29,11,127,23,541,47,2213,97,9413,193,37253,389,151337,787,619373,
%T 1579,2493259,3163,10004573,6329,40056253,12659,160250297,25321,
%U 641153069,50647,2565118639,101293,10260271859,202591,41043113401,405199
%N 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(.).
%C 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.
%C 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
%H G. C. Greubel, <a href="/A181616/b181616.txt">Table of n, a(n) for n = 1..1000</a>
%e Beginning at 5 (n=1), a(2) via nextprime(5^2) = 29.
%e Divisor = ceiling(5/2) = 3 so a(3) = nextprime(floor(29/3)) = 11.
%e Then repeat: a(4) via nextprime(11^2) = 127.
%e Divisor = ceiling(11/2) = 6 so a(5) = nextprime(floor(127/6)) = 23.
%p A007491 := proc(n) nextprime(n^2) ; end proc:
%p 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
%t 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]
%o (PARI)
%o \\ example call newseq9(2,50) to use square power, 1st 50 terms
%o \\ I never tried any power but 2
%o newseq9(a,iend)=
%o {
%o a=floor(a);
%o if(a<2,a=2);
%o i5=5;
%o print(i5);
%o for(n=1,iend,
%o i6=nextprime(i5^a);
%o b=ceil(i5/2); \\ vary as f{i5}
%o i7=nextprime(floor(i6/b));
%o print(i6);
%o print(i7);
%o i5=i7
%o ); \\end FOR
%o print("Designed pgm exit (a,b) ...",a," , ",b);
%o }
%K nonn
%O 1,1
%A _Bill McEachen_, Jan 30 2011