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.

A046257 a(1) = 7; 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 A046257 #20 Jun 01 2025 17:53:07
%S A046257 7,9,19,27,47,57,61,81,179,211,251,273,373,477,581,753,847,909,909,
%T A046257 939,957,1173,1311,1343,1543,1619,1693,1739,1879,1971,2141,2523,2653,
%U A046257 2729,2863,3201,3293,3411,3621,3753,5023,5421,5459,5481,6403,6827,7041,7669
%N A046257 a(1) = 7; a(n) is smallest number >= a(n-1) such that the juxtaposition a(1)a(2)...a(n) is a prime.
%C A046257 All terms must be odd. - _Harvey P. Dale_, Oct 21 2023
%H A046257 Robert Israel, <a href="/A046257/b046257.txt">Table of n, a(n) for n = 1..512</a>
%p A046257 A:= 7: x:= 7: count:= 1:
%p A046257 for i from 7 by 2 while count < 10000 do
%p A046257  while isprime(x*10^(1+ilog10(i))+i) do
%p A046257    x:= x*10^(1+ilog10(i))+i; A:= A,i; count:= count+1;
%p A046257 od od:
%p A046257 A; # _Robert Israel_, Jan 21 2024
%t A046257 a[1] = 7; a[n_] := a[n] = Block[{k = a[n - 1], c = IntegerDigits @ Table[ a[i], {i, n - 1}]}, While[ !PrimeQ[ FromDigits @ Flatten @ Append[c, IntegerDigits[k]]], k += 2]; k]; Table[ a[n], {n, 46}] (* _Robert G. Wilson v_, Aug 05 2005 *)
%t A046257 nxt[{j_,a_}]:=Module[{k=a},While[CompositeQ[j*10^IntegerLength[k]+k],k+=2];{j*10^IntegerLength[k]+k,k}]; NestList[nxt,{7,7},50][[;;,2]] (* _Harvey P. Dale_, Oct 21 2023 *)
%Y A046257 Cf. A069609, A074343, A033680, A033679, A033681, A046254, A046255, A046256, A046258, A046259, A111524.
%K A046257 nonn
%O A046257 1,1
%A A046257 _Patrick De Geest_, May 15 1998