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.

A236672 Start with 9; thereafter, primes obtained by concatenating to the end of previous term the next smallest number that will produce a prime.

This page as a plain text file.
%I A236672 #24 Nov 23 2023 07:04:12
%S A236672 9,97,971,9719,971917,97191713,9719171333,971917133323,9719171333237,
%T A236672 971917133323777,97191713332377731,9719171333237773159,
%U A236672 971917133323777315951,97191713332377731595127,971917133323777315951277,971917133323777315951277269
%N A236672 Start with 9; thereafter, primes obtained by concatenating to the end of previous term the next smallest number that will produce a prime.
%C A236672 a(n+1) is the next smallest prime beginning with a(n). Initial term is 9. After a(1), these are the primes in A069611.
%H A236672 Robert Israel, <a href="/A236672/b236672.txt">Table of n, a(n) for n = 1..316</a>
%e A236672 a(1) = 9 by definition.
%e A236672 a(2) is the next smallest prime beginning with 9, so a(2) = 97.
%e A236672 a(3) is the next smallest prime beginning with 97, so a(3) = 971.
%p A236672 R:= 9: x:= 9:
%p A236672 for i from 2 to 20 do
%p A236672   for y from 1 by 2 do
%p A236672     z:= x*10^(1+ilog10(y)) + y;
%p A236672     if isprime(z) then
%p A236672       R:= R,z; x:= z; break
%p A236672     fi
%p A236672 od od:
%p A236672 R; # _Robert Israel_, Nov 22 2023
%t A236672 next[p_]:=Module[{i=1,q},While[!PrimeQ[q=10^IntegerLength[i]p+i],i+=2];q];
%t A236672 NestList[next,9,15] (* _Paolo Xausa_, Nov 23 2023 *)
%o A236672 (Python)
%o A236672 import sympy
%o A236672 from sympy import isprime
%o A236672 def b(x):
%o A236672   num = str(x)
%o A236672   n = 1
%o A236672   while n < 10**3:
%o A236672     new_num = str(x) + str(n)
%o A236672     if isprime(int(new_num)):
%o A236672       print(int(new_num))
%o A236672       x = new_num
%o A236672       n = 1
%o A236672     else:
%o A236672       n += 1
%o A236672 b(9)
%Y A236672 Cf. A048553, A110773, A069611.
%K A236672 nonn,base
%O A236672 1,1
%A A236672 _Derek Orr_, Jan 29 2014