login
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.
2

%I #9 May 23 2022 17:46:22

%S 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 18,35,26,33,28,37,40,27,32,41,30,43,34,45,38,47,36,49,51,44,39,46,53,

%U 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 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 The sequence is conjectured to be a permutation of the positive integers.

%H Scott R. Shannon, <a href="/A353904/a353904.png">Image of the first 100000 terms</a>. The green line is y = n.

%e 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 (Python)

%o from math import gcd

%o from itertools import islice

%o def c(san, k):

%o sk = str(k)

%o return all(sk[-1-i]!=san[-1-i] for i in range(min(len(san), len(sk))))

%o def agen(): # generator of terms

%o an, aset, mink = 1, {1}, 2

%o while True:

%o yield an

%o k, san = mink, str(an)

%o while k in aset or gcd(an, k) != 1 or k-an == 1 or not c(san, k):

%o k += 1

%o an = k

%o aset.add(an)

%o while mink in aset: mink += 1

%o print(list(islice(agen(), 77))) # _Michael S. Branicky_, May 23 2022

%Y Cf. A353780, A093714, A068861, A109812.

%K nonn,base

%O 1,2

%A _Scott R. Shannon_, May 10 2022