login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(1) = 1, a(2) = 2; for n > 2, a(n) is the least positive integer not occurring earlier that shares a factor but not a digit with a(n-1).
3

%I #21 Mar 11 2021 20:37:34

%S 1,2,4,6,3,9,12,8,10,5,20,14,7,21,30,15,24,16,22,11,33,18,26,13,52,34,

%T 17,68,32,40,25,60,27,36,28,35,42,38,19,57,39,45,63,48,50,44,55,66,51,

%U 69,23,46,58,29,87,54,62,31,248,56,49,70,64,72,80,65,78,90,74,82,41,205,164,88,76,84

%N a(1) = 1, a(2) = 2; for n > 2, a(n) is the least positive integer not occurring earlier that shares a factor but not a digit with a(n-1).

%C After 100000 terms the lowest unused number is 1523. It is unknown if the sequence is a permutation of the positive integers.

%H Scott R. Shannon, <a href="/A342366/a342366.png">Image of the first 10000 terms</a>. The green line is a(n) = n.

%t Block[{a = {1, 2}, m = {2}, k}, Do[k = 2; While[Nand[FreeQ[a, k], GCD[k, a[[-1]]] > 1, ! IntersectingQ[m, IntegerDigits[k]]], k++]; AppendTo[a, k]; Set[m, IntegerDigits[k]], {i, 74}]; a] (* _Michael De Vlieger_, Mar 11 2021 *)

%o (Python)

%o from sympy import factorint

%o def aupton(terms):

%o alst, aset = [1, 2], {1, 2}

%o for n in range(3, terms+1):

%o an = 1

%o anm1_digs, anm1_factors = set(str(alst[-1])), set(factorint(alst[-1]))

%o while True:

%o while an in aset: an += 1

%o if set(str(an)) & anm1_digs == set():

%o if set(factorint(an)) & anm1_factors != set():

%o alst.append(an); aset.add(an); break

%o an += 1

%o return alst

%o print(aupton(76)) # _Michael S. Branicky_, Mar 09 2021

%Y Cf. A342356 (share factor and digit), A239664 (no shared factor or digit), A342367 (share digit but not factor), A184992, A309151, A249591.

%K nonn,base

%O 1,2

%A _Scott R. Shannon_, Mar 09 2021