A242998 Number of integers k such that R = (2^k*Q - Q - 1)/(Q + 1 - 2^k) is a prime number, when Q = A000668(n) is the n-th Mersenne prime.
0, 1, 1, 2, 1, 1, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1
Examples
For given p=A000043(n), the following k's yield a prime R: p : k's (and resulting primes R, Q=2^p-1 and/or weird W=2^(k-1)*Q*R) 2 : - 3 : 2 (R=5, Q=7, W=70) 5 : 4 (R=29, Q=31, W=7192) 7 : 4 (R=17, Q=127, W=17272), 5 (R=41, Q=127, W=83312) 13 : 11 (R=2729, Q=8191, W=22889716736) 17 : 13 (R=8737, Q=131071, W=4690605371392) 19 : 16 (R=74897, W=1286718208049152), 17 (R=174761, W=6004730783793152) 31 : 16 (R=65537, W=2^15*(2^31-1)*R), 29 (R=715827881, W=2^28*(2^31-1)*R) 61 : 57 (R=153722867280912929, W=2^56*(2^61-1)*R) 89 : 78 (R=302379100949042568368129, W=2^77*(2^89-1)*R) 107 through 86243 : none. 107 through 3021377: none. _Robert Price_, Sep 05 2019 The present sequence lists the number of k's in each line.
Links
- S. Kravitz, A search for large weird numbers. J. Recreational Math. 9(1976), 82-85 (1977). Zbl 0365.10003
- E. Weisstein, Weird numbers, on MathWorld - a Wolfram web ressource.
Crossrefs
Programs
-
Mathematica
A000043 = {2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497, 86243, 110503, 132049, 216091, 756839, 859433, 1257787, 1398269, 2976221, 3021377, 6972593, 13466917, 20996011, 24036583, 25964951, 30402457, 32582657, 37156667, 42643801, 43112609}; lst = {}; For[i = 1, i <= 28, i++, p = A000043[[i]]; kc = 0; For[k = 1, k < p, k++, r = 2^k - 1 + (2^k - 2)/(2^(p - k) - 1); If[! IntegerQ[r], Continue[]]; If[PrimeQ[r], kc++]]; AppendTo[lst, kc]]; lst (* Robert Price, Sep 05 2019 *)
-
PARI
A242998(n,p=A000043[n])={sum(k=p\2+1, p-1, Mod(2, 2^(p-k)-1)^k==2 && ispseudoprime(2^k-1+(2^k-2)/(2^(p-k)-1)))}
Extensions
Typo in definition corrected by Jens Kruse Andersen, Aug 27 2014
a(29)-a(37) from Robert Price, Sep 05 2019
Comments