login
Numbers of the form (2^p - 1)(2^q + 1) where p and q are twin primes.
0

%I #9 May 13 2013 01:49:00

%S 231,3999,16771071,68719083519,1152921502996234239,

%T 19342813113827469725532159,1329227995784915871174424803370074111,

%U 22300745198530623141528634722924057038159871,25711008708143844408671393477450995736753878524115705145589759

%N Numbers of the form (2^p - 1)(2^q + 1) where p and q are twin primes.

%C Idea resulted from seqfan posts by _Artur Jasinski_.

%t a[n_] := If[PrimeQ[(2*n - 1)] && PrimeQ[(2*n + 1)], (2^(2*n - 1) - 1)*(2^(2*n + 1) + 1), {}]; Flatten[Table[a[n], {n, 1, 100}]]

%t (2^#[[1]]-1)(2^#[[2]]+1)&/@Select[Partition[Prime[Range[100]],2,1],#[[2]]- #[[1]]==2&] (* _Harvey P. Dale_, Dec 03 2012 *)

%o (PARI) forprime(p=2,1e3,if(isprime(q=p+2),print1((2^p-1)*(2^q+1)", "))) \\ _Charles R Greathouse IV_, Nov 07 2011

%K nonn,easy

%O 1,1

%A _Roger L. Bagula_, Nov 24 2008

%E a(9) added by _Harvey P. Dale_, Dec 03 2012