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.

A065581 Smallest prime ending in exactly n 7's.

Original entry on oeis.org

7, 277, 1777, 47777, 2477777, 16777777, 137777777, 577777777, 1777777777, 67777777777, 377777777777, 16777777777777, 17777777777777, 577777777777777, 2777777777777777, 157777777777777777, 377777777777777777, 2777777777777777777, 97777777777777777777, 2477777777777777777777
Offset: 1

Views

Author

Robert G. Wilson v, Nov 28 2001

Keywords

Crossrefs

Programs

  • Mathematica
    Do[a = Table[7, {n} ]; k = 0; While[ b = FromDigits[ Join[ IntegerDigits[k], a]]; Mod[k, 10] == 7 || !PrimeQ[b], k++ ]; Print[b], {n, 1, 17} ]
    k7[n_]:=Module[{c=FromDigits[PadRight[{},n,7]],k=0},While[Nand[PrimeQ[k*10^n + c], Mod[k, 10] != 7],k++];k*10^n+c]; Array[k7,20] (* Harvey P. Dale, Jan 29 2013 *)
  • PARI
    a(n)={ my(t=10^n, b=7*(t-1)/9, d=0); while (!isprime(b + t*d), d++; if(d%10==7, d++)); b + t*d } \\ Harry J. Smith, Oct 23 2009