A378459 a(n) is the least k such that the concatenation of 2^n-1 and 2^k-1 is prime, or -1 if there is no such k.
1, 1, 1, 1, 1, 1, 3, 1, 2, 13, 3, 11, 5, 5, 2, 1, 6, 1, 3, 1, 25, 5, 9, 7, 6, 3, 11, 3, 2, 17, 2, 99, 31, 15, 3, 19, 6, 9, 1, 1, 5, 23, 9, 1, 11, 15, 5, 11, 26, 9, 2, 35, 17, 43, 17, 61, 11, 21, 13, 139, 3, 13, 25, 17, 14, 1, 2, 21, 19, 9, 3, 5, 6, 177, 41, 39, 2, 73, 22, 9, 31, 3, 2, 89, 179, 21
Offset: 1
Examples
a(7) = 3 because the concatenation of 2^7-1 = 127 and 2^3-1 = 7 is 1277 which is prime, and neither 1271 nor 1273 is prime.
Links
- Robert Israel, Table of n, a(n) for n = 1..1811
Crossrefs
First column of A378288.
Programs
-
Maple
tcat:= (a,b) -> 10^(1+ilog10(b))*a+b: f:= proc(i) local x,j; x:= 2^i-1; for j from 1 by `if`(i::even,2,1) do if j mod 4 = 0 or igcd(i,j) > 1 then next fi; if isprime(tcat(x,2^j-1)) then return j fi; od end proc: map(f, [$1..100]);
-
Mathematica
idf[a_]:=IntegerDigits[2^a-1];Table[k=0;Until[PrimeQ[FromDigits[Join[idf[n],idf[k]]]],k++];k,{n,86}] (* James C. McMahon, Dec 05 2024 *)
Comments