cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A087605 Smallest k such that n times concatenation of k with itself followed by a 7 is a prime, or 0 if no such number exists.

Original entry on oeis.org

1, 2, 1, 1, 3, 100005, 1, 2, 4, 6, 8, 100010, 19, 2, 215, 9, 60, 100041, 4, 66, 5, 1, 41, 100061, 4, 15, 2, 1, 195, 100055, 61, 1061, 143, 12, 72, 100127, 19, 60, 1, 6, 125, 0, 45, 1305, 3, 39, 27, 100269, 72, 95, 136, 1123, 50, 100193, 52, 1056, 176, 1536, 66
Offset: 1

Views

Author

Amarnath Murthy, Sep 18 2003

Keywords

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

Examples

			a(5) = 3 as 333337 is a prime but 111117 and 222227 are not.
		

Crossrefs

Programs

  • 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)

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

Extensions

Corrected and extended by Max Alekseyev, Feb 11 2005