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!)
A238694 Smallest k such that 2^n - k and k*2^n - 1 are both prime or 0 if no such k exists. 5
0, 1, 1, 3, 1, 3, 1, 5, 25, 5, 31, 5, 1, 15, 49, 17, 1, 5, 1, 17, 9, 33, 69, 89, 61, 111, 199, 309, 75, 297, 1, 5, 49, 131, 31, 17, 31, 131, 165, 437, 55, 33, 309, 495, 361, 437, 999, 89, 139, 195, 129, 183, 685, 315, 915, 189, 585, 1035, 931, 93, 1, 57, 165 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
COMMENTS
If a(n)=1, then the two primes are same and they are Mersenne primes (A000668).
LINKS
EXAMPLE
a(9) = 25 because 2^9 - 25 = 487 and 25*2^9 - 1 = 12799 are both prime.
MAPLE
a:= proc(n) local k, p; p:= 2^n;
for k while not (isprime(p-k) and isprime(k*p-1))
do if k>=p then return 0 fi od; k
end:
seq(a(n), n=1..70); # Alois P. Heinz, Mar 03 2014
MATHEMATICA
a[n_] := Module[{k, p}, p = 2^n;
For[k = 1, !(PrimeQ[p - k] && PrimeQ[k*p - 1]), k++,
If[k >= p, Return[0]]]; k];
Table[a[n], {n, 1, 70}] (* Jean-François Alcover, Feb 18 2022, after Alois P. Heinz *)
CROSSREFS
Cf. A238554.
Sequence in context: A283461 A146907 A322865 * A320221 A236939 A236936
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Alois P. Heinz, Mar 03 2014
STATUS
approved

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 September 13 11:30 EDT 2024. Contains 375905 sequences. (Running on oeis4.)