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.

This page as a plain text file.
%I A065581 #17 Dec 08 2024 21:09:42
%S A065581 7,277,1777,47777,2477777,16777777,137777777,577777777,1777777777,
%T A065581 67777777777,377777777777,16777777777777,17777777777777,
%U A065581 577777777777777,2777777777777777,157777777777777777,377777777777777777,2777777777777777777,97777777777777777777,2477777777777777777777
%N A065581 Smallest prime ending in exactly n 7's.
%H A065581 Harry J. Smith, <a href="/A065581/b065581.txt">Table of n, a(n) for n = 1..100</a>
%t A065581 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} ]
%t A065581 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 *)
%o A065581 (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
%Y A065581 Cf. A037067, A065590, A065821, A065580, A065582.
%K A065581 nonn,base
%O A065581 1,1
%A A065581 _Robert G. Wilson v_, Nov 28 2001