OFFSET
1,7
COMMENTS
a(n) is coprime to n, and is not divisible by 4.
a(1812) > 37000 if it is not -1.
LINKS
Robert Israel, Table of n, a(n) for n = 1..1811
EXAMPLE
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.
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 *)
CROSSREFS
KEYWORD
nonn,base,changed
AUTHOR
Robert Israel, Nov 26 2024
STATUS
approved