OFFSET
2,1
COMMENTS
The average of the ratio (a(n)/log(a(n)))/n for n = 2 to N tends to 0.35 as N increases.
For n <= 2000, 709 terms a(n) are <= n.
LINKS
Pierre CAMI, Table of n, a(n) for n = 2..2000
EXAMPLE
Since 4^3 - 5*2^3 - 1 = 23 is prime, a(3) = 5.
MATHEMATICA
sop[n_]:=Module[{c4=4^n-1, c2=2^n, i=3}, While[!PrimeQ[c4-i*c2], i= NextPrime[ i]]; i]; Array[sop, 70, 2] (* Harvey P. Dale, Oct 28 2013 *)
PROG
(PFGW Scriptify)
SCRIPT
DIM n, 1
DIM k
DIMS t
LABEL a
SET n, n+1
IF n>2000 THEN END
SET k, 1
LABEL b
SET k, k+1
SETS t, %d, %d\,; k; n
PRP 4^n-p(k)*2^n-1, t
IF ISPRP THEN GOTO a
GOTO b
(PARI)
N=10^6; default(primelimit, N);
a(n) = {
my(n4=4^n, n2=2^n);
forprime (p=3, N,
if ( isprime(n4-p*n2-1), return(p) )
);
return(-1);
} /* Joerg Arndt, Mar 11 2013 */
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Mar 09 2013
STATUS
approved