login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A214862 Smallest odd prime p such that 4^n - p*2^n - 1 is prime. 1

%I #23 Oct 28 2013 12:37:37

%S 3,5,11,5,11,17,7,5,13,43,19,11,11,19,41,7,61,67,13,31,11,43,37,101,

%T 13,17,11,67,73,13,101,13,11,137,11,31,101,23,97,11,47,53,53,17,41,

%U 139,157,7,67,47,239,127,41,197,53,13,31,127,71,191,97,709,101,41

%N Smallest odd prime p such that 4^n - p*2^n - 1 is prime.

%C The average of the ratio (a(n)/log(a(n)))/n for n = 2 to N tends to 0.35 as N increases.

%C For n <= 2000, 709 terms a(n) are <= n.

%H Pierre CAMI, <a href="/A214862/b214862.txt">Table of n, a(n) for n = 2..2000</a>

%e Since 4^3 - 5*2^3 - 1 = 23 is prime, a(3) = 5.

%t 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 *)

%o (PFGW Scriptify)

%o SCRIPT

%o DIM n,1

%o DIM k

%o DIMS t

%o LABEL a

%o SET n,n+1

%o IF n>2000 THEN END

%o SET k,1

%o LABEL b

%o SET k,k+1

%o SETS t,%d,%d\,;k;n

%o PRP 4^n-p(k)*2^n-1,t

%o IF ISPRP THEN GOTO a

%o GOTO b

%o (PARI)

%o N=10^6; default(primelimit,N);

%o a(n) = {

%o my(n4=4^n, n2=2^n);

%o forprime (p=3, N,

%o if ( isprime(n4-p*n2-1), return(p) )

%o );

%o return(-1);

%o } /* _Joerg Arndt_, Mar 11 2013 */

%K nonn

%O 2,1

%A _Pierre CAMI_, Mar 09 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 21:09 EDT 2024. Contains 371798 sequences. (Running on oeis4.)