OFFSET
1,2
COMMENTS
I. If m=1 or m is an odd number greater than 3 then a(m)=0. II. If m is greater
than 6 and mod(m,10)=6 then a(m)=0. III. If n-1 is prime the a(n)=1.
a(64) is greater than 4000.
EXAMPLE
2-1, 22-1 & 222-1 aren't prime and 2222-1 is prime so a(2)=4. There is no m
such that m 16's -1 is prime because 5 divides all such numbers, so a(16)=0.
MATHEMATICA
f[n_, m_]:=(v={}; Do[v=Join[v, IntegerDigits[n]], {k, m}]; FromDigits[v]);
a[n_]:=(If[n!=3&&n!=6&&(Mod[n, 10]==6||Mod[n, 2]==1), 0, For[m=1, !PrimeQ[f[n, m]
-1], m++ ]; m]); Do[Print[a[n]], {n, 39}]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Farideh Firoozbakht, Apr 02 2009
EXTENSIONS
a(64)-a(85) from Giovanni Resta, Apr 17 2017
STATUS
approved