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.

A088639 Smallest prime beginning with at least n n's (in decimal notation).

This page as a plain text file.
%I A088639 #21 Feb 11 2021 19:21:51
%S A088639 2,11,223,3331,44449,555557,66666629,777777701,888888883,99999999907,
%T A088639 1010101010101010101039,11111111111111111111111,
%U A088639 12121212121212121212121223,1313131313131313131313131301,141414141414141414141414141497,15151515151515151515151515151501
%N A088639 Smallest prime beginning with at least n n's (in decimal notation).
%H A088639 M. F. Hasler, <a href="/A088639/b088639.txt">Table of n, a(n) for n=0..100</a>
%p A088639 a:= proc(n) local d, h, s;
%p A088639       s:= parse(cat(0, n$n));
%p A088639       for d from 0 do
%p A088639         for h to 10^d-1 do
%p A088639           if isprime(s+h) then return s+h fi
%p A088639         od:
%p A088639         s:= s*10;
%p A088639       od
%p A088639     end:
%p A088639 seq(a(n), n=0..16);  # _Alois P. Heinz_, Feb 11 2021
%o A088639 (PARI) A088639(n)={ local(p=10^#Str(n),d=1); n*=(p^n-1)/(p-1); until( (d*=10)*(n+1)>p=nextprime(n*d), );p} /* _M. F. Hasler_, Jan 13 2009 */
%o A088639 (Python)
%o A088639 from sympy import isprime
%o A088639 def a(n):
%o A088639   if n == 0: return 2
%o A088639   nns, i, pow10 = int(str(n)*n), 1, 1
%o A088639   while True:
%o A088639     i = 1
%o A088639     while i < pow10:
%o A088639       t = nns * pow10 + i
%o A088639       if isprime(t): return t
%o A088639       i += 2
%o A088639     pow10 *= 10
%o A088639 print([a(n) for n in range(16)]) # _Michael S. Branicky_, Feb 11 2021
%Y A088639 Cf. A088640. See A068120 for another version. See also A065584 - A065592.
%K A088639 base,easy,nonn
%O A088639 0,1
%A A088639 _Amarnath Murthy_, Oct 27 2003
%E A088639 More terms from _Ray Chandler_, Nov 01 2003
%E A088639 More cross-references and initial term added by _M. F. Hasler_, Jan 13 2009