OFFSET
0,2
COMMENTS
LINKS
M. F. Hasler & Bill McEachen, Table of n, a(n) for n = 0..1300 (missing lines n = 1159..1165 from Bill McEachen)
Wikipedia, "Complete" sequence. [Wikipedia calls a sequence "complete" (sic) if every positive integer is a sum of distinct terms. This name is extremely misleading and should be avoided. - N. J. A. Sloane, May 20 2023]
FORMULA
a(n) = A104080(n-1) for n > 2. - Georg Fischer, Oct 23 2018
EXAMPLE
a(5) = 17, since this is the next prime after 2^(5-1) = 2^4 = 16.
MATHEMATICA
nextprime[n_Integer] := (k=n+1; While[!PrimeQ[k], k++]; k); aprime[m_Integer] := (If[m==0, 1, nextprime[2^(m-1)]]); Table[aprime[l], {l, 0, 100}]
nxt[{n_, a_}]:={n+1, NextPrime[2^n]}; NestList[nxt, {0, 1}, 40][[All, 2]] (* Harvey P. Dale, Oct 10 2017 *)
PROG
(PARI) a(n)=if(n, nextprime(2^n/2+1), 1) \\ Charles R Greathouse IV
(PARI) A203074(n)=nextprime(2^(n-1)+1)-!n \\ M. F. Hasler, Mar 15 2012
(Magma) [1] cat [NextPrime(2^(n-1)): n in [1..40]]; // Vincenzo Librandi, Feb 23 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Frank M Jackson and N. J. A. Sloane, Dec 28 2011.
STATUS
approved