OFFSET
1,2
COMMENTS
a(42n)=0, but all other terms are probably nonzero. For n a multiple of 42, (10^(l*n)-1)/(10^l-1)*10+7 is divisible by 7 for any l. - Max Alekseyev, Feb 11 2005
FORMULA
Minimal k such that k*(10^(l*n)-1)/(10^l-1)*10+7 is prime, where l is the length of k; and 0 if no such prime exists. - Max Alekseyev, Feb 11 2005
EXAMPLE
a(5) = 3 as 333337 is a prime but 111117 and 222227 are not.
PROG
(PARI) { a(n) = if(n%42==0, return(0)); for(l=1, 10^6, if(valuation(10^(l*n)-1, 7)==valuation(10^l-1, 7), for(k=10^(l-1), 10^l-1, if(isprime(k*(10^(l*n)-1)/(10^l-1)*10+7), return(k) ) ) ) ) } (Alekseyev)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Sep 18 2003
EXTENSIONS
Corrected and extended by Max Alekseyev, Feb 11 2005
STATUS
approved