|
|
A257460
|
|
Let b_k=7...7 consist of k>0 7's. Then a(n) is the smallest k such that the concatenation prime(n)b_k is prime, or a(n)=0 if there is no such prime.
|
|
3
|
|
|
2, 1, 2, 0, 3, 1, 2, 1, 2, 48, 1, 10, 2, 3, 3, 3, 9, 1, 1, 2, 66, 1, 2, 8, 1, 2, 6, 3, 1, 3, 1, 2, 3, 6, 8, 9, 7, 1, 3, 2, 2, 3, 17, 4, 2, 1, 3, 1, 2, 1, 3, 2, 1, 5, 17, 5, 8, 16, 1, 3, 1, 8, 6, 2, 1, 3, 3, 2184, 6, 6, 3, 2, 1, 3, 1, 2, 2, 4, 2, 3, 3, 1, 2, 1, 1, 3, 6, 15, 5, 1, 48, 2, 1, 2, 7, 2, 47, 2, 1, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
The only unknown terms less than 10000, tested to 17500, are for n: 484, 1291, 2096, 2238, 3503, 3859, 6674, 7087, 7824, 8954.
|
|
LINKS
|
|
|
FORMULA
|
a(n)=k for the least k such that prime(n)*10^k+7*(10^k-1)/9 is prime, where prime(n) is the n-th prime.
|
|
MATHEMATICA
|
f[n_] := Block[{k = 1, p = Prime[n]}, While[ !PrimeQ[p*10^k + 7(10^k - 1)/9], k++]; k]; f[4] = 0; Array[f, 100]
|
|
PROG
|
(PARI) isok(k, dp) = ispseudoprime(fromdigits(concat(dp, vector(k, i, 7))));
a(n) = {if (prime(n) == 7, return(0)); my(k=1, p=prime(n)); while (!ispseudoprime(p*10^k+7*(10^k-1)/9), k++); k; } \\ Michel Marcus, Jan 20 2021
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|