login
A302566
a(n) is the least positive integer not yet in the sequence in which the largest digit of a(n-2) appears among its digits, and a(n) cannot share digits with a(n-1); a(1) = 1, a(2) = 2.
2
1, 2, 10, 22, 11, 20, 13, 24, 3, 4, 23, 14, 30, 41, 32, 40, 31, 42, 33, 44, 35, 46, 5, 6, 15, 26, 45, 16, 25, 36, 50, 61, 52, 60, 51, 62, 53, 64, 55, 63, 54, 66, 57, 68, 7, 8, 17, 28, 37, 18, 27, 38, 47, 58, 67, 48, 70, 81, 72, 80, 71, 82, 73, 84, 75, 83, 74, 85, 76, 88, 77, 86, 79, 108, 9, 78, 19, 87
OFFSET
1,2
COMMENTS
The only pairs of consecutive numbers are 1, 2; 3, 4; 5, 6; 7, 8.
The 2-digit numbers that are not in the sequence are 12, 21, 34, 43, 56, 65, 89, 98 (78 and 87 do appear at n = 76 and n = 78, respectively).
The last 2-digit number to appear is 91 at n = 113.
Starting from a(73) = 79, the first term of alternating terms must contain 9, and the second term must contain 8.
If the initial terms of this sequence are swapped (by defining a(1)=2 and a(2)=1) then the resulting sequence is identical to this for n>12. - R. J. Cano, Apr 13 2018
EXAMPLE
a(4) = 22 since it contains the largest digit from a(2) = 2, and can't be 12 since the digit 1 appears in a(3) = 10.
MATHEMATICA
Nest[Append[#, Block[{k = 2, d}, While[Nand[FreeQ[#[[All, 1]], k], MemberQ[Set[d, IntegerDigits[k]], Max[#[[-2, -1]] ] ], ! IntersectingQ[d, #[[-1, -1]]] ], k++]; {k, d}]] &, Transpose@ {#, IntegerDigits@ #} &@ Range[2], 73][[All, 1]] (* Michael De Vlieger, Apr 12 2018 *)
PROG
(PARI) \\ See Links section.
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Enrique Navarrete, Apr 09 2018
STATUS
approved