OFFSET
0,7
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 0..10000 (terms 0-4500 from Giovanni Resta)
EXAMPLE
n=19, 2^19=524288, prevprime(524288)=524287, nextprime(524288)=524309, so min{21,1}=1=a(19).
MAPLE
with(numtheory): [seq(min(nextprime(2^i)-2^i, 2^i-prevprime(2^i)), i=2..100)];
MATHEMATICA
f[n_] := Block[{k = 0}, While[ !PrimeQ[2^n -k] && !PrimeQ[2^n +k], k++]; If[ PrimeQ[2^n -k], k, -k]]; Array[f, 70, 0] (* Robert G. Wilson v, Mar 14 2006 and modified Jan 12 2024 *)
CROSSREFS
KEYWORD
sign
AUTHOR
Labos Elemer, Mar 02 2001
EXTENSIONS
Signs added by Robert G. Wilson v, Mar 14 2006
STATUS
approved