OFFSET
1,1
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
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
EXAMPLE
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.
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]
PROG
(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);
}
CROSSREFS
KEYWORD
nonn
AUTHOR
Bill McEachen, Jan 30 2011
STATUS
approved