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.

A053583 a(n+1) is the smallest prime ending with (but not equal to) a(n), where a(1)=3.

This page as a plain text file.
%I A053583 #21 Jun 23 2022 13:49:49
%S A053583 3,13,113,2113,12113,612113,11612113,1611612113,111611612113,
%T A053583 1111611612113,81111611612113,2181111611612113,132181111611612113,
%U A053583 11132181111611612113,3411132181111611612113,413411132181111611612113,12413411132181111611612113
%N A053583 a(n+1) is the smallest prime ending with (but not equal to) a(n), where a(1)=3.
%H A053583 Michael S. Branicky, <a href="/A053583/b053583.txt">Table of n, a(n) for n = 1..370</a> (terms 1..210 from Robert Israel)
%p A053583 A[1]:= 3;
%p A053583 for n from 2 to 100 do
%p A053583 d:= 10^(ilog10(A[n-1])+1);
%p A053583 for k from 1 do
%p A053583   p:= A[n-1]+d*k;
%p A053583   if isprime(p) then
%p A053583     A[n]:= p;
%p A053583     break
%p A053583   fi
%p A053583 od
%p A053583 od:
%p A053583 seq(A[n],n=1..100); # _Robert Israel_, Jul 15 2014
%o A053583 (Python)
%o A053583 from sympy import isprime
%o A053583 from itertools import count, islice
%o A053583 def agen(an=3):
%o A053583     while True:
%o A053583         yield an
%o A053583         pow10 = 10**len(str(an))
%o A053583         for t in count(pow10+an, step=pow10):
%o A053583             if isprime(t):
%o A053583                 an = t
%o A053583                 break
%o A053583 print(list(islice(agen(), 17))) # _Michael S. Branicky_, Jun 23 2022
%Y A053583 Cf. A000040, A053582, A053584, A069612.
%K A053583 base,nonn
%O A053583 1,1
%A A053583 _G. L. Honaker, Jr._, Jan 18 2000
%E A053583 Definition corrected by _Robert Israel_, Jul 15 2014