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.

A353904 a(1) = 1; for n > 1, a(n) is the smallest positive number that has not yet appeared that is coprime to a(n-1), does not equal a(n-1)+1, and differs from a(n-1) at every digit.

This page as a plain text file.
%I A353904 #9 May 23 2022 17:46:22
%S A353904 1,3,2,5,4,7,6,11,8,13,9,14,23,10,21,16,25,12,29,15,22,17,20,19,24,31,
%T A353904 18,35,26,33,28,37,40,27,32,41,30,43,34,45,38,47,36,49,51,44,39,46,53,
%U A353904 42,55,48,59,61,50,63,52,67,54,65,56,69,58,71,57,62,73,60,77,64,75,68,79,66,83,70,81
%N A353904 a(1) = 1; for n > 1, a(n) is the smallest positive number that has not yet appeared that is coprime to a(n-1), does not equal a(n-1)+1, and differs from a(n-1) at every digit.
%C A353904 The sequence is conjectured to be a permutation of the positive integers.
%H A353904 Scott R. Shannon, <a href="/A353904/a353904.png">Image of the first 100000 terms</a>. The green line is y = n.
%e A353904 a(13) = 23 as a(12) = 14, and 23 has not yet appeared, is coprime to 14, is not 1 more than 14, and differs at every digit from 14. Note that 17 satisfies all of these conditions except the last. This is the first term to differ from A093714.
%o A353904 (Python)
%o A353904 from math import gcd
%o A353904 from itertools import islice
%o A353904 def c(san, k):
%o A353904     sk = str(k)
%o A353904     return all(sk[-1-i]!=san[-1-i] for i in range(min(len(san), len(sk))))
%o A353904 def agen(): # generator of terms
%o A353904     an, aset, mink = 1, {1}, 2
%o A353904     while True:
%o A353904         yield an
%o A353904         k, san = mink, str(an)
%o A353904         while k in aset or gcd(an, k) != 1 or k-an == 1 or not c(san, k):
%o A353904             k += 1
%o A353904         an = k
%o A353904         aset.add(an)
%o A353904         while mink in aset: mink += 1
%o A353904 print(list(islice(agen(), 77))) # _Michael S. Branicky_, May 23 2022
%Y A353904 Cf. A353780, A093714, A068861, A109812.
%K A353904 nonn,base
%O A353904 1,2
%A A353904 _Scott R. Shannon_, May 10 2022