OFFSET
0,1
COMMENTS
The absolute value is relevant only for first two terms, 2^0-a(0) = 1-3 = -2, 2^1-a(1) = 2-5 = -3. According to Goldbach's conjecture, every even number > 2 is the sum of two primes, which implies that for all further terms, a(n) < 2^n. - M. F. Hasler, Jan 13 2011
LINKS
Hugo Pfoertner, Table of n, a(n) for n = 0..5000
EXAMPLE
n=7, 2^n=128. The smallest terms subtracted from 128 resulting in a prime are 1,15,19,... Neither 1 nor 15 are primes but 19 is a prime. It gives 109=128-19, so a(n)=19.
MATHEMATICA
f[n_] := Block[{p = 2}, While[! PrimeQ[2^n - p], p = NextPrime@ p]; p]; Array[f, 60, 0]
PROG
(PARI) A057673(n)=forprime( p=1, default(primelimit), ispseudoprime(abs(2^n-p))& return(p))
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Oct 19 2000
EXTENSIONS
Offset corrected and initial term added by M. F. Hasler, Jan 13 2011
STATUS
approved