This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A242993 #35 Sep 05 2019 19:23:49 %S A242993 0,2,4,4,11,13,16,16,57,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, %T A242993 0,0,0,0,0,0 %N A242993 Least k such that R = (2^k*Q-Q-1)/(Q+1-2^k) is prime, where Q = A000668(n) is the n-th Mersenne prime, or 0 if no such k exists. %C A242993 Kravitz has shown that 2^(k-1)*Q*R is a primitive weird number (cf. A002975) when Q > 2^k =: M+1 and R = (M*Q-1)/(Q-M) = M + (M^2-1)/(Q-M) both are prime. R cannot be an integer unless Q < M(M+1) which yields k > p/2 for Mersenne primes Q = 2^p-1. [Edited by _M. F. Hasler_, Nov 11 2018] %C A242993 Sequence A242025 lists all primes R obtained in that way. Sequence A242998 gives the number of (k,R) for each Q in A000668. Sequence A242998 lists the primes p which give rise to a solution, with multiplicity, and A243003 lists the corresponding values of k. See the "main entry" A242025 for more information. - _M. F. Hasler_, Nov 11 2018 %H A242993 S. Kravitz, A search for large weird numbers. J. Recreational Math. 9(1976), 82-85 (1977). <a href="http://zbmath.org/?format=complete&q=an:0365.10003">Zbl 0365.10003</a> %e A242993 For n = 2, Q = A000668(2) = 7, k = 2 yields the prime R = (2^k*Q-Q-1)/(Q+1-2^k) = 20/4 = 5 and the (smallest possible) weird number 2^(k-1)*Q*R = 2*7*5 = 70. %e A242993 For n = 9, Q = A000668(9) = 2^61-1, k = 57 yields the prime R = 2^57-1 + (2^57-2)/(2^4-1) and the 53-digit primitive weird number 2^56*Q*R = 25541592347764814106588251084767772206406532903993344. %e A242993 For n = 10, Q = A000668(10) = 2^89-1, k = 78 yields the prime R = 2^78-1 + (2^78-2)/(2^11-1) and the 74-digit primitive weird number 2^77*Q*R = 28283363272427014026275183563912621451964887156507346985599492888375328768. %t A242993 A000043 = {2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, %t A242993 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, %t A242993 21701, 23209, 44497, 86243, 110503, 132049, 216091, 756839, 859433, %t A242993 1257787, 1398269, 2976221, 3021377, 6972593, 13466917, 20996011, %t A242993 24036583, 25964951, 30402457, 32582657, 37156667, 42643801, %t A242993 43112609}; %t A242993 lst = {}; %t A242993 For[i = 1, i <= 25, i++, %t A242993 p = A000043[[i]]; %t A242993 kc = 0; %t A242993 For[k = 1, k < p, k++, %t A242993 r = 2^k - 1 + (2^k - 2)/(2^(p - k) - 1); %t A242993 If[! IntegerQ[r], Continue[]]; %t A242993 If[PrimeQ[r], kc = k; Break[]]]; %t A242993 AppendTo[lst, kc]]; %t A242993 lst (* _Robert Price_, Sep 05 2019 *) %o A242993 (PARI) a(n)={p=A000043[n]; for(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)) && return(k))} %Y A242993 Cf. A242025 (primes R obtained in that way), A242998 (number of such k values for given n), A242999 (p=A000043(n) listed A242998(n) times), A243003 (all values of k). %Y A242993 Cf. A258882 (weird numbers of the form 2^k*p*q). %K A242993 nonn,more,hard %O A242993 1,2 %A A242993 _M. F. Hasler_, Aug 17 2014 %E A242993 Definition corrected by _Jens Kruse Andersen_, Aug 18 2014 %E A242993 a(28)-a(37) from _Robert Price_, Sep 05 2019