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(.).

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