%I #92 Sep 09 2021 16:19:03
%S 2,14,18,58,570,3198,4462,7266
%N Integers k such that the concatenation of 2^k and 2^k - 1 is prime.
%C First four primes: 43, 1638416383, 262144262143, 288230376151711744288230376151711743.
%C All six primes == 3 (mod 10).
%C All six integer 'k' are even.
%C From _Jon E. Schoenfield_, Sep 08 2021: (Start)
%C a(9) > 20000.
%C Let p = concatenation(2^k, 2^k - 1); then if k is odd, p is divisible by 3, and if k is a multiple of 4, p is divisible by 5, so (since no value of k gives p=3 or p=5) if p is prime, then k == 2 (mod 4), from which it follows that p == 3 (mod 20).
%C (End)
%e For k = 2 we have 2^2 = 4 and 2^2 - 1 = 3, and their concatenation (43) is a prime number.
%t Monitor[Do[If[PrimeQ@FromDigits@Flatten[IntegerDigits/@{2^k,2^k-1}],Print@k],{k,10^4}],k] (* _Giorgos Kalogeropoulos_, Sep 08 2021 *)
%o (Python)
%o from sympy import isprime
%o def afind(limit, startk=0):
%o pow2 = 2**startk
%o for k in range(startk, limit+1):
%o if isprime(int(str(pow2) + str(pow2 - 1))): print(k, end=", ")
%o pow2 *= 2
%o afind(600) # _Michael S. Branicky_, Sep 08 2021
%o (PARI) isok(k) = isprime(eval(Str(2^k, 2^k-1))); \\ _Michel Marcus_, Sep 09 2021
%Y Cf. A000079, A000225.
%K nonn,base,more
%O 1,1
%A _Emre APARI_, Feb 23 2016
%E a(7)-a(8) from _Michael S. Branicky_, Sep 08 2021
|