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.

A236527 Primes obtained by concatenating to the end of previous term the next smallest number that will produce a prime, starting with 3.

This page as a plain text file.
%I A236527 #20 May 22 2025 10:21:36
%S A236527 3,31,311,3119,31193,3119317,31193171,311931713,3119317139,
%T A236527 311931713939,31193171393933,3119317139393353,31193171393933531,
%U A236527 3119317139393353121,311931713939335312127,311931713939335312127113,31193171393933531212711399,31193171393933531212711399123
%N A236527 Primes obtained by concatenating to the end of previous term the next smallest number that will produce a prime, starting with 3.
%C A236527 a(n + 1) is the next smallest prime beginning with a(n). Initial term is 3. These are the primes arising in A069605.
%e A236527 a(1) = 3 by definition.
%e A236527 a(2) is the next smallest prime beginning with 3, so a(2) = 31.
%e A236527 a(3) is the next smallest prime beginning with 31, so a(3) = 311.
%t A236527 A069605[1] = 3; A236527[1] = 3; A069605[n_] := A069605[n] = Block[{k = 1, c = IntegerDigits @ Table[ a[i], {i, n - 1}]}, While[ !PrimeQ[ FromDigits[Flatten[Append[c, IntegerDigits[k]]]]], k += 2]; k]; A236527[n_] := A236527[n] = FromDigits[Flatten[IntegerDigits[A236527[n - 1]], IntegerDigits[A069605[n]]]]; Table[A236527[n], {n, 20}] (* _Alonso del Arte_, Jan 28 2014 based on _Robert G. Wilson v_'s program for A069605 *)
%t A236527 nxt[n_]:=Module[{s=1},While[CompositeQ[n*10^IntegerLength[s]+s],s+=2];n*10^IntegerLength[s]+s]; NestList[nxt,3,20] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Jun 22 2020 *)
%o A236527 (Python)
%o A236527 import sympy
%o A236527 from sympy import isprime
%o A236527 def b(x):
%o A236527   num = str(x)
%o A236527   n = 1
%o A236527   while n < 10**3:
%o A236527     new_num = str(x) + str(n)
%o A236527     if isprime(int(new_num)):
%o A236527       print(int(new_num))
%o A236527       x = new_num
%o A236527       n = 1
%o A236527     else:
%o A236527       n += 1
%o A236527 b(3)
%Y A236527 Cf. A048553, A110773, A069605.
%K A236527 nonn,base
%O A236527 1,1
%A A236527 _Derek Orr_, Jan 27 2014