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.

A077713 a(1) = 3; thereafter a(n) = the smallest prime of the form d0...0a(n-1), where d is a single digit, or 0 if no such prime exists.

This page as a plain text file.
%I A077713 #23 Jun 23 2022 15:42:04
%S A077713 3,13,113,2113,12113,612113,50612113,1050612113,6001050612113,
%T A077713 26001050612113,1026001050612113,6000001026001050612113,
%U A077713 500006000001026001050612113,600500006000001026001050612113,1600500006000001026001050612113,6001600500006000001026001050612113
%N A077713 a(1) = 3; thereafter a(n) = the smallest prime of the form d0...0a(n-1), where d is a single digit, or 0 if no such prime exists.
%C A077713 a(n) is the smallest prime obtained by prefixing a(n-1) with a number of the form d*10^k where d is a single digit, 0 < d < 10, and k >= 0. Conjecture: d*10^k always exists.
%H A077713 Michael S. Branicky, <a href="/A077713/b077713.txt">Table of n, a(n) for n = 1..44</a>
%e A077713 a(7) = 50612113: deleting 5 gives 612113 = a(6).
%p A077713 a:= proc(n) option remember; local k, m, d, p;
%p A077713       if n=1 then 3 else k:= a(n-1);
%p A077713         for m from length(k) do
%p A077713           for d to 9 do p:= k +d*10^m;
%p A077713             if isprime(p) then return p fi
%p A077713         od od
%p A077713       fi
%p A077713     end:
%p A077713 seq(a(n), n=1..20);  # _Alois P. Heinz_, Jan 12 2015
%o A077713 (Python)
%o A077713 from sympy import isprime
%o A077713 from itertools import islice
%o A077713 def agen(an=3):
%o A077713     while True:
%o A077713         yield an
%o A077713         pow10 = 10**len(str(an))
%o A077713         while True:
%o A077713             found = False
%o A077713             for t in range(pow10+an, 10*pow10+an, pow10):
%o A077713                 if isprime(t):
%o A077713                     an = t; found = True; break
%o A077713             if found: break
%o A077713             pow10 *= 10
%o A077713 print(list(islice(agen(), 16))) # _Michael S. Branicky_, Jun 23 2022
%Y A077713 Cf. A053583, A077714, A077715, A077716.
%K A077713 base,nonn
%O A077713 1,1
%A A077713 _Amarnath Murthy_, Nov 19 2002
%E A077713 More terms from _Ray Chandler_, Jul 23 2003
%E A077713 Changed offset to 1 by _Alois P. Heinz_, Jan 12 2015
%E A077713 Definition clarified by _N. J. A. Sloane_, Jan 19 2015