Digits and gaps

NAME
Two terms that contain the digit « d » are always separated by « d » terms that do not contain the digit « d ». This is the lexicographically earliest sequence S of distinct nonnegative integers with this property.

DATA (only the first 9 terms are lexico-correct – did notice Jean-Marc Falcoz the next day): 
S = 0, 10, 20, 100, 30, 102, 40, 101, 203, 110, 50, 1024, 300, 1000, 200, 1001, 3045, 120, 60, 1010, 230, 104, 500, 201, 303, 106, 204, 1011, 305, 210, 70, 140, 2036, 1100, 505, 1002, 304, 1101, 207, 160, 350, 1042, 80, 1110, 302, 10000, 40567, 1020, 330, 10001, 202, 1048, 503, 1026, 700, 10010, 2034, 10011, 550, 1022, 3068, 401, 270, 10100, 530, 1021, 400, 601, 90, 108,...

EXAMPLE
As we start S with a(1) = 0, the digit 0 must be present in every term of the sequence. 
S must be extended now with a(2) = 10 as 10 is the smallest integer not present in S that contains the digit 0.
The next term will be a(3) = 20 as 20 is the smallest integer not present in S that contains the digit 0.
The next term will be a(4) = 100 as 100 is the smallest integer not present in S that contains both the digits 0 and 1.
The next term will be a(5) = 30 as 30 is the smallest integer not present in S that contains the digit 0.
The next term will be a(6) = 102 as 102 is the smallest integer not present in S that contains the digits 0, 1 and 2.
The next term will be a(7) = 40 as 40 is the smallest integer not present in S that contains the digit 0.
The next term will be a(8) = 101 as 101 is the smallest integer not present in S that contains both the digits 0 and 1.
Etc.

COMMENTS
Will the sequence S stop at some point?
___________________________
Update #1, Aug 6th, 2024 – Jean-Marc Falcoz

Je crois queffectivement S est finie (indeed, the seq is finite – there is no 55th term)
={0,10,20,100,30,102,40,101,203,105,60,1024,300,110,200,150,304,1026,70,1000,230,1045,80,120,306,1001,2047,501,303,201,90,10468,302,510,700,210,340,1010,206,1005,3089,1042,707,1011,320,1056,400,1002,330,108,2079,1054,360,1012}

____________________
Update #2, Michael S. Branicky

MSB
Instead of 0,10,20,100,30,102,40,101,203,105,60,1024,300,110,... I get 0,10,20,100,30,102,40,101,203,105,60,1024,300,107,...

ÉA
You are right, Michael, thank you!
This is now A375232 – a warm merci to Jean-Marc and Michael!
____________________
Update #3Aug 7th, 2024

What about extending the sequence with -1 when no more terms are available? And proceed from there as before?

Jean-Marc was quick to use this technique, extend the sequence to 1000 terms and compute a graph:
={0,10,20,100,30,102,40,101,203,105,60,1024,300,107,200,150,304,1026,80,109,230,10457,-1,120,306,110,204,1058,303,10279,-1,1046,302,501,-1,201,3048,170,206,1059,330,1042,-1,1000,320,105678,400,210,3000,190,202,1045,360,1027,800,1001,2034,510,-1,10269,3003,1047,220,1085,3030,1002,406,1010,2003,10579,-1,1204,308,106,2000,1005,340,1072,-1,901,2036,10458,-1,1012,3033,701,240,1056,3300,1029,808,104,2023,1057,600,1020,403,1011,2002,10589,3303,102467,-1,1100,2030,1015,404,1021,3068,1079,2020,1054,3330,1022,-1,160,2043,10578,-1,1092,30000,140,260,1050,30003,1207,408,1101,2032,10569,-1,1240,30030,710,2022,1508,3046,1102,-1,910,2033,10475,-1,1062,380,1110,402,1051,30033,10297,606,401,2203,1580,-1,1120,430,1067,2200,1095,30300,1402,880,10000,2063,1075,440,1200,30303,1009,2202,104568,30330,1270,-1,10001,2304,1055,660,1209,803,1074,2220,1105,30333,1206,4000,10010,2230,105789,-1,1420,603,10011,20000,1150,3004,1702,8000,1069,2300,1405,-1,1201,33000,1007,2046,1805,33003,1290,-1,410,2302,10567,-1,1202,3084,10100,20002,1509,630,10247,-1,10101,2303,1850,4004,1260,33030,1097,20020,1450,33033,1210,608,10110,2340,1507,-1,1902,33300,1064,20022,5018,33303,1720,4040,10111,2306,1590,-1,2014,830,1017,20200,1065,3034,1220,-1,1019,2320,104578,6000,2001,33330,11000,420,1500,300000,102679,8008,1004,2330,1501,-1,2010,3064,1070,20202,10598,300003,2041,-1,601,3002,1570,4044,2011,3008,1090,602,1504,300030,2017,-1,11001,2403,10568,-1,1920,300033,1407,20220,1505,3006,2012,480,11010,3020,10597,-1,10246,300300,11011,20222,5081,3040,2071,6006,1091,3022,1540,-1,2021,3038,1076,2004,1510,300303,2019,-1,1014,2360,10587,-1,2100,3043,11100,22000,10596,300330,10274,8080,11101,3023,1550,460,2101,300333,1709,22002,10485,303000,1602,-1,11110,2430,1705,-1,2091,3086,1040,22020,5001,303003,2107,4400,610,3032,10859,-1,2104,303030,1071,620,5010,3044,2102,8088,1099,3200,104567,-1,2110,303033,100000,2024,5108,3036,10729,-1,1041,3202,5011,-1,1620,3408,1077,22022,1905,303300,2140,6060,100001,3203,10758,4404,2120,303303,1096,22200,4015,303330,2170,8800,100010,20346,5015,-1,2109,303333,1470,22202,10586,330000,2201,4440,100011,3220,10759,6066,2401,3080,100100,22220,5051,3304,10267,-1,1109,3230,10548,-1,2210,3060,1107,2040,5100,330003,2190,8808,1406,3302,1750,-1,10002,3340,100101,2006,10895,330030,10427,-1,100110,3320,1506,40000,10012,3083,1790,200000,4051,3063,10020,-1,100111,3024,10785,-1,10296,330033,1044,200002,5101,330300,2701,4068,101000,20003,1950,-1,2410,330303,1607,200020,5180,3400,10021,-1,1190,2603,10547,-1,10022,3088,101001,2042,1560,330330,10792,-1,1104,20023,5801,6600,10102,3403,1170,200022,5019,330333,10264,8880,101010,20030,5017,40004,10112,3066,1900,200200,10584,333000,2710,-1,1006,3042,5105,-1,2901,3308,1704,2026,5110,333003,10120,40040,101011,20032,-1,4012,333030,101100,200202,5150,3406,7012,80000,1901,20033,4105,-1,2016,333033,1700,2044,5810,333300,2910,6606,1140,20203,5071,-1,10121,3480,1016,200220,5091,333303,10472,-1,101101,2630,8015,40044,10122,333330,1907,200222,10456,10200,80008,101110,3204,5107,6660,9012,1400,202000,8051,10276,40400,101111,20223,5109,-1,4021,3608,1701,202002,5501,3404,10201,-1,1609,20230,104587,-1,10202,110000,2064,5510,10927,80080,1401,20232,1605,-1,10210,3430,1707,202020,10958,3306,4102,-1,110001,20233,5170,40404,2061,3380,1909,202022,4150,7021,60000,110010,3240,8105,-1,9021,10467,202200,10005,10211,804,110011,3026,10795,-1,4120,110100,202202,10658,3440,7102,-1,1910,20300,4501,60006,10212,3800,1710,2204,10015,10629,-1,1404,20302,10857,-1,10220,3460,110101,202220,5190,10724,80088,1060,20303,10050,40440,10221,1970,2060,10845,10222,-1,110110,3402,10576,-1,9102,3803,1410,202222,10051,3360,7120,40444,110111,20320,10985,-1,10426,1770,220000,10055,4003,11002,680,1990,20322,10574,-1,11012,1061,2240,8150,10972,-1,1440,3062,10105,-1,11020,3804,7001,220002,10659,4201,-1,111000,20323,10875,604,11021,9001,220020,4510,10627,80800,111001,3420,10115,-1,9120,3600,1740,220022,8501,11022,44000,1066,20330,10957,-1,4210,3808,111010,2062,10150,4030,7201,-1,9010,20332,104586,-1,11102,7010,2400,10151,3603,9201,80808,4001,20333,5701,-1,2106,4033,111011,220200,15089,10742,60060,111100,22003,10155,44004,11120,3830,10679,220202,5014,11200,-1,111101,20364,15078,-1,9210,4010,220220,1650,7210,840,111110,22023,5901,60066,10024,7011,220222,8510,4034,2160,-1,9011,22030,10745,-1,11201,3680,1000000,2402,10500,12079,-1,1460,22032,10058,-1,11202,4043,7017,2066,5910,10042,80880,22033,10657,44040,11210,9019,222000,10854,3606,10027,-1,4023,10501,-1,10692,3880,4017,222002,10505,11220,640,22203,105798,-1,10124,1106,222020,10510,4300,10072,80888,9091,3206,5041,-1,12000,7071,2404,10685,10029,-1,4011,22230,5710,60600,12001,3840,222022,9015,102476,-1,22300,10085,44044,12002,3630,7019,222200,5104,12010,88000,1160,4032,7015,-1,10092,4014,2206,10158,10127,44400,22302,10695,-1,10142,8003,7100,222202,10511,3604,12011,-1,9100,22303,104758,-1,2601,2420,10515,12097,806,4041,22320,10550,-1,12012,4303,1670,222220,15098,10204,-1,3260,7051,44404,12020,8030,9101}

This variant has been submitted to the OEIS too (here).




Commentaires

Posts les plus consultés de ce blog

Confingame, 3e étape

Square my chunks and add

Triples for the new year