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.

A372408 a(n) = smallest composite not occurring earlier having in decimal representation to its predecessor Levenshtein distance = 1; a(1)=1.

This page as a plain text file.
%I A372408 #9 May 12 2024 11:46:55
%S A372408 1,4,6,8,9,39,30,10,12,14,15,16,18,28,20,21,22,24,25,26,27,57,50,40,
%T A372408 42,32,33,34,35,36,38,48,44,45,46,49,69,60,62,52,51,54,55,56,58,68,63,
%U A372408 64,65,66,76,70,72,74,75,77,78,88,80,81,82,84,85,86,87,187,117,110,100,102,104,105,106,108,118,111,112
%N A372408 a(n) = smallest composite not occurring earlier having in decimal representation to its predecessor Levenshtein distance = 1; a(1)=1.
%C A372408 The sequence is a permutation of the nonprimes.
%H A372408 Eric Angelini, <a href="https://cinquantesignes.blogspot.com/2024/04/prime-padlock.html">Prime combination lock</a>, Personal blog, April 2024.
%e A372408 The Levenshtein distance = 1 between 1 and 4, 4 and 6, 6 and 8, 8 and 9, 9 and 39, 39 and 30, 30 and 10, etc.
%e A372408 No smaller composite than 39 was possible for a(6).
%t A372408 a[1]=1;a[n_]:=a[n]=(k=2;While[PrimeQ@k||MemberQ[Array[a,n-1],k]|| EditDistance[ToString@k,ToString@a[n-1]]!=1,k++];k);Array[a,77]
%o A372408 (Python)
%o A372408 from sympy import isprime
%o A372408 from itertools import islice
%o A372408 from Levenshtein import distance as Ld
%o A372408 def agen(): # generator of terms
%o A372408     an, aset, mink = 1, {1}, 4
%o A372408     while True:
%o A372408         yield an
%o A372408         s, k = str(an), mink
%o A372408         while k in aset or Ld(s, str(k)) != 1 or isprime(k): k += 1
%o A372408         an = k
%o A372408         aset.add(k)
%o A372408         while mink in aset or isprime(mink): mink += 1
%o A372408 print(list(islice(agen(), 80))) # _Michael S. Branicky_, Apr 29 2024
%Y A372408 Cf. A000040, A118763, A372407.
%K A372408 nonn
%O A372408 1,2
%A A372408 _Eric Angelini_ and _Giorgos Kalogeropoulos_, Apr 29 2024