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.
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
Examples
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.
Links
- Rémy Sigrist, PARI program for A302566
- R. J. Cano, Sequencer program in PARI
Programs
-
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 *)
-
PARI
\\ See Links section.
Comments