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.

Showing 1-1 of 1 results.

A383743 a(n) is the smallest prime not yet in the sequence that satisfies the following: for some pair of different digits i and j in a(n-1), i preceding j (from left to right), j precedes i in a(n). Leading 0s are not allowed; a(1)=13. See Comments for details.

Original entry on oeis.org

13, 31, 103, 101, 107, 71, 17, 271, 127, 211, 1021, 109, 191, 19, 491, 139, 131, 113, 311, 137, 73, 37, 173, 307, 373, 317, 163, 61, 167, 461, 149, 41, 1049, 241, 421, 1123, 251, 151, 157, 521, 257, 523, 353, 53, 359, 193, 239, 293, 349, 43, 347, 431
Offset: 1

Views

Author

Enrique Navarrete, May 08 2025

Keywords

Comments

To obtain a(n), the digits i and j in a(n-1) are chosen among all possible pairs of different digits in a(n-1) so that they produce the smallest prime not yet in the sequence according to the precedence requirement in the definition. Naturally, to obtain a(n+1), the process is repeated but now a different pair of digits k, l in a(n) may be chosen to produce a(n+1).
Note that it is enough that there exists a pair of digits i and j in a(n) that satisfy the precedence requirement; not every pair of such digits must satisfy the requirement in the case of multiple occurrences of such digits in a(n) (see examples).

Examples

			In a(2)=31 3 precedes 1, hence a(3)=103 since it is the smallest prime not yet in the sequence in which the digit 1 precedes 3.
In a(3)=103 1 precedes 0, hence a(4)=101 since it is the smallest prime not yet in the sequence in which the digit 0 precedes 1 (last two digits).
In a(10)=211 2 precedes 1, hence a(11)=1021 since it is the smallest prime not yet in the sequence in which the digit 1 precedes 2 (first and third digits).
In a(11)=1021 0 precedes 1 (second and fourth digits), hence a(12)=109 since it is the smallest prime not yet in the sequence in which the digit 1 precedes 0 (first and second digits).
		

Crossrefs

Programs

  • Maple
    P:= select(isprime,[seq(i,i=13 .. 1000,2)]):
    g:= proc(n) local L, R,i,j;
       L:= convert(n,base,10);
       R:= select(t -> t[2] <> t[1], {seq(seq([L[i],L[j]],j=1..i-1),i=1..nops(L))});
    end proc:
    R:= 13: r:= 13: Cands:= subsop(1=NULL,P):
    do qr:= map(t -> [t[2],t[1]],g(r)): found:= false;
       for i from 1 to nops(Cands) do
         if g(Cands[i]) intersect qr <> {} then
           r:= Cands[i]; R:= R,r; Cands:= subsop(i=NULL,Cands); found:= true; break
         fi
       od;
    until not found:
    R; # Robert Israel, Jun 09 2025
Showing 1-1 of 1 results.