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.

A074342 a(1) = 6; a(n) is smallest number > a(n-1) such that the juxtaposition a(1)a(2)...a(n) is a prime.

This page as a plain text file.
%I A074342 #14 Jun 19 2021 18:56:56
%S A074342 6,7,19,21,23,27,57,183,207,231,247,267,399,417,441,459,569,603,693,
%T A074342 847,933,1107,1149,1197,1251,1581,1619,2061,2137,2139,2339,2643,2703,
%U A074342 2743,2847,2987,3199,3447,3477,3641,3919,4241,4369,4599,4761,6647,6739,6831
%N A074342 a(1) = 6; a(n) is smallest number > a(n-1) such that the juxtaposition a(1)a(2)...a(n) is a prime.
%H A074342 Michael S. Branicky, <a href="/A074342/b074342.txt">Table of n, a(n) for n = 1..439</a>
%t A074342 a[1] = 6; a[n_] := a[n] = Block[{k = a[n - 1] + 1 + Mod[a[n - 1], 2], c = IntegerDigits @ Table[ a[i], {i, n - 1}]}, While[ !PrimeQ[ FromDigits @ Flatten @ Append[c, IntegerDigits[k]]], k += 2]; k]; Table[ a[n], {n, 48}] (* _Robert G. Wilson v_ *)
%t A074342 nxt[{j_,a_}]:=Module[{k=a+2},While[CompositeQ[j(10^ IntegerLength[ k])+k],k+=2];{j(10^IntegerLength[k])+k,k}]; Join[{6},NestList[ nxt,{67,7},50][[All,2]]] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Jun 19 2021 *)
%o A074342 (Python)
%o A074342 from sympy import isprime
%o A074342 def aupton(terms):
%o A074342   alst, astr = [6], "6"
%o A074342   for n in range(2, terms+1):
%o A074342     an = alst[-1] + 1
%o A074342     while not isprime(int(astr+str(an))): an += 1
%o A074342     alst, astr = alst + [an], astr + str(an)
%o A074342   return alst
%o A074342 print(aupton(62)) # _Michael S. Branicky_, Jun 07 2021
%Y A074342 Cf. A046256, A069608, A074336, A074338, A074339, A074340, A074341, A074343, A074344, A074345, A074346.
%K A074342 nonn,base
%O A074342 1,1
%A A074342 _Zak Seidov_, Sep 23 2002
%E A074342 Corrected and extended by _Robert G. Wilson v_, Aug 05 2005