A301801 a(n) = smallest integer not yet in the sequence with no digits in common with a(n-1), a(n-2), a(n-3), and a(n-4); a(0)=0, a(1)=1, a(2)=2, a(3)=3.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 22, 33, 44, 55, 11, 20, 36, 47, 58, 19, 200, 63, 74, 85, 91, 202, 66, 34, 57, 18, 29, 60, 43, 75, 81, 92, 600, 333, 45, 17, 28, 69, 30, 54, 71, 82, 96, 300, 444, 15, 27, 68, 39, 40, 51, 72, 86, 93, 400, 111, 25, 67, 38, 49, 100
Offset: 0
Links
- Rémy Sigrist, PARI program for A301801
Programs
-
Mathematica
Nest[Append[#, Block[{k = 4, d}, While[Nand[FreeQ[#, k], ! IntersectingQ[Union@ Apply[Join, Take[#[[All, -1]], -4] ], Set[d, IntegerDigits[k]]] ], k++]; {k, d}]] &, Transpose@ {#, IntegerDigits@ #} &@ Range[0, 3], 62][[All, 1]] (* Michael De Vlieger, Apr 12 2018 *)
-
PARI
See Links section.
Comments