Wednesday 6 December 2023

The Commas Sequence

The number associated with my diurnal age today, 27275, was one of those numbers for which there was a paucity of information. However, after some searching I discovered a reference to the number on this site with this interesting introduction:

Hello Math-Fun & SeqFan, 
WARNING! 
This sequence is *not* for OEIS mathematicians!
  • it is base-dependent!
  • it has black spots on its shirt!
  • it is badly defined (in pidgin-English)!
  • it is computed by hand...
(I would recommend it only for drunken ophthalmologists.)

I did not really understand the information provided on the site but the sequence of terms listed there, when entered into the OEIS, revealed that 27275 is a member of OEIS A121805:


 A121805

The "commas sequence": the lexicographically earliest sequence of positive numbers with the property that the sequence formed by the pairs of digits adjacent to the commas between the terms is the same as the sequence of successive differences between the terms.


The OEIS comments state that:
An equivalent, but more formal definition, is: a(1) = 1; for \(n \gt 1\), let \(x\) be the least significant digit of a(\(n\)-1); then:$$ \text{a}(n) = \text{a}(n-1) + x \times 10 + y$$where \(y\) is the most significant digit of a(\(n\)) and is the smallest such \(y\), if such a \(y\) exists. If no such \(y\) exists, stop. The sequence contains exactly 2137453 terms, with a(2137453)=99999945. The next term does not exist.

Replace each comma in the original sequence by the pair of digits adjacent to the comma; the result is the sequence of first differences between the terms of the sequence:

Sequence:   1, 12, 35, 94, 135, 186, 248, 331, 344, 387, 461, 475, ...

Differences: 11, 23, 59, 41 , 51 , 62 , 83 , 13 , 43 , 74 , 14 , ...

To illustrate the formula in the comment: a(6) = 186 and a(7) = 248 = 186 + 62.

The comments also provide Python code that will generate the sequence (permalink) but I don't really understand it. However, with the formula provided above was able to develop some SageMath code that generates the terms as well (permalink). The initial terms are:

1, 12, 35, 94, 135, 186, 248, 331, 344, 387, 461, 475, 530, 535, 590, 595, 651, 667, 744, 791, 809, 908, 997, 1068, 1149, 1240, 1241, 1252, 1273, 1304, 1345, 1396, 1457, 1528, 1609, 1700, 1701, 1712, 1733, 1764, 1805, 1856, 1917, 1988, 2070, 2072, 2094, 2136, 2198, 2280, 2282, 2304, 2346, 2408, 2490, 2492, 2514, 2556, 2618, 2700, 2702, 2724, 2766, 2828, 2910, 2912, 2934, 2976, 3039, 3132, 3155, 3208, 3291, 3304, 3347, 3420, 3423, 3456, 3519, 3612, 3635, 3688, 3771, 3784, 3827, 3900, 3903, 3936, 3999, 4093, 4127, 4201, 4215, 4269, 4363, 4397, 4471, 4485, 4539, 4633, 4667, 4741, 4755, 4809, 4903, 4937, 5012, 5037, 5112, 5137, 5212, 5237, 5312, 5337, 5412, 5437, 5512, 5537, 5612, 5637, 5712, 5737, 5812, 5837, 5912, 5937, 6013, 6049, 6145, 6201, 6217, 6293, 6329, 6425, 6481, 6497, 6573, 6609, 6705, 6761, 6777, 6853, 6889, 6985, 7042, 7069, 7166, 7233, 7270, 7277, 7354, 7401, 7418, 7505, 7562, 7589, 7686, 7753, 7790, 7797, 7874, 7921, 7938, 8026, 8094, 8142, 8170, 8178, 8266, 8334, 8382, 8410, 8418, 8506, 8574, 8622, 8650, 8658, 8746, 8814, 8862, 8890, 8898, 8986, 9055, 9114, 9163, 9202, 9231, 9250, 9259, 9358, 9447, 9526, 9595, 9654, 9703, 9742, 9771, 9790, 9799, 9898, 9987, 10058, 10139, 10230, 10231, 10242, 10263, 10294, 10335, 10386, 10447, 10518, 10599, 10690, 10691, 10702, 10723, 10754, 10795, 10846, 10907, 10978, 11059, 11150, 11151, 11162, 11183, 11214, 11255, 11306, 11367, 11438, 11519, 11610, 11611, 11622, 11643, 11674, 11715, 11766, 11827, 11898, 11979, 12070, 12071, 12082, 12103, 12134, 12175, 12226, 12287, 12358, 12439, 12530, 12531, 12542, 12563, 12594, 12635, 12686, 12747, 12818, 12899, 12990, 12991, 13002, 13023, 13054, 13095, 13146, 13207, 13278, 13359, 13450, 13451, 13462, 13483, 13514, 13555, 13606, 13667, 13738, 13819, 13910, 13911, 13922, 13943, 13974, 14015, 14066, 14127, 14198, 14279, 14370, 14371, 14382, 14403, 14434, 14475, 14526, 14587, 14658, 14739, 14830, 14831, 14842, 14863, 14894, 14935, 14986, 15047, 15118, 15199, 15290, 15291, 15302, 15323, 15354, 15395, 15446, 15507, 15578, 15659, 15750, 15751, 15762, 15783, 15814, 15855, 15906, 15967, 16038, 16119, 16210, 16211, 16222, 16243, 16274, 16315, 16366, 16427, 16498, 16579, 16670, 16671, 16682, 16703, 16734, 16775, 16826, 16887, 16958, 17039, 17130, 17131, 17142, 17163, 17194, 17235, 17286, 17347, 17418, 17499, 17590, 17591, 17602, 17623, 17654, 17695, 17746, 17807, 17878, 17959, 18050, 18051, 18062, 18083, 18114, 18155, 18206, 18267, 18338, 18419, 18510, 18511, 18522, 18543, 18574, 18615, 18666, 18727, 18798, 18879, 18970, 18971, 18982, 19003, 19034, 19075, 19126, 19187, 19258, 19339, 19430, 19431, 19442, 19463, 19494, 19535, 19586, 19647, 19718, 19799, 19890, 19891, 19902, 19923, 19954, 19995, 20047, 20119, 20211, 20223, 20255, 20307, 20379, 20471, 20483, 20515, 20567, 20639, 20731, 20743, 20775, 20827, 20899, 20991, 21003, 21035, 21087, 21159, 21251, 21263, 21295, 21347, 21419, 21511, 21523, 21555, 21607, 21679, 21771, 21783, 21815, 21867, 21939, 22031, 22043, 22075, 22127, 22199, 22291, 22303, 22335, 22387, 22459, 22551, 22563, 22595, 22647, 22719, 22811, 22823, 22855, 22907, 22979, 23071, 23083, 23115, 23167, 23239, 23331, 23343, 23375, 23427, 23499, 23591, 23603, 23635, 23687, 23759, 23851, 23863, 23895, 23947, 24019, 24111, 24123, 24155, 24207, 24279, 24371, 24383, 24415, 24467, 24539, 24631, 24643, 24675, 24727, 24799, 24891, 24903, 24935, 24987, 25059, 25151, 25163, 25195, 25247, 25319, 25411, 25423, 25455, 25507, 25579, 25671, 25683, 25715, 25767, 25839, 25931, 25943, 25975, 26027, 26099, 26191, 26203, 26235, 26287, 26359, 26451, 26463, 26495, 26547, 26619, 26711, 26723, 26755, 26807, 26879, 26971, 26983, 27015, 27067, 27139, 27231, 27243, 27275, 27327, 27399, 27491, 27503, 27535, 27587, 27659, 27751, 27763, 27795, 27847, 27919, 28011, 28023, 28055, 28107, 28179, 28271, 28283, 28315, 28367, 28439, 28531, 28543, 28575, 28627, 28699, 28791, 28803, 28835, 28887, 28959, 29051, 29063, 29095, 29147, 29219, 29311, 29323, 29355, 29407, 29479, 29571, 29583, 29615, 29667, 29739, 29831, 29843, 29875, 29927, 29999, 30092, 30115, 30168, 30251, 30264, 30307, 30380, 30383, 30416, 30479, 30572, 30595, 30648, 30731, 30744, 30787, 30860, 30863, 30896, 30959, 31052, 31075, 31128, 31211, 31224, 31267, 31340, 31343, 31376, 31439, 31532, 31555, 31608, 31691, 31704, 31747, 31820, 31823, 31856, 31919, 32012, 32035, 32088, 32171, 32184, 32227, 32300, 32303, 32336, 32399, 32492, 32515, 32568, 32651, 32664, 32707, 32780, 32783, 32816, 32879, 32972, 32995, 33048, 33131, 33144, 33187, 33260, 33263, 33296, 33359, 33452, 33475, 33528, 33611, 33624, 33667, 33740, 33743, 33776, 33839, 33932, 33955, 34008, 34091, 34104, 34147, 34220, 34223, 34256, 34319, 34412, 34435, 34488, 34571, 34584, 34627, 34700, 34703, 34736, 34799, 34892, 34915, 34968, 35051, 35064, 35107, 35180, 35183, 35216, 35279, 35372, 35395, 35448, 35531, 35544, 35587, 35660, 35663, 35696, 35759, 35852, 35875, 35928, 36011, 36024, 36067, 36140, 36143, 36176, 36239, 36332, 36355, 36408, 36491, 36504, 36547, 36620, 36623, 36656, 36719, 36812, 36835, 36888, 36971, 36984, 37027, 37100, 37103, 37136, 37199, 37292, 37315, 37368, 37451, 37464, 37507, 37580, 37583, 37616, 37679, 37772, 37795, 37848, 37931, 37944, 37987, 38060, 38063, 38096, 38159, 38252, 38275, 38328, 38411, 38424, 38467, 38540, 38543, 38576, 38639, 38732, 38755, 38808, 38891, 38904, 38947, 39020, 39023 

The OEIS comments also state that:

The similar sequence OEIS A139284, which starts at a(1)=2, persists even longer, ending at a(194697747222394) = 9999999999999918. 


 A139284

Analog of A121805, but starting with 2. 
                              


For some reason, my SageMath code only generates about a dozen times before looping endlessly but the Python code works fine and generates the following initial terms (permalink):

2, 24, 71, 89, 180, 181, 192, 214, 256, 319, 413, 447, 522, 547, 623, 659, 756, 824, 872, 901, 920, 929, 1020, 1021, 1032, 1053, 1084, 1125, 1176, 1237, 1308, 1389, 1480, 1481, 1492, 1513, 1544, 1585, 1636, 1697, 1768, 1849, 1940, 1941, 1952, 1973, 2005, 2057, 2129, 2221, 2233, 2265, 2317, 2389, 2481, 2493, 2525, 2577, 2649, 2741, 2753, 2785, 2837, 2909, 3002, 3025, 3078, 3161, 3174, 3217, 3290, 3293, 3326, 3389, 3482, 3505, 3558, 3641, 3654, 3697, 3770, 3773, 3806, 3869, 3962, 3985, 4039, 4133, 4167, 4241, 4255, 4309, 4403, 4437, 4511, 4525, 4579, 4673, 4707, 4781, 4795, 4849, 4943, 4977, 5052, 5077, 5152, 5177, 5252, 5277, 5352, 5377, 5452, 5477, 5552, 5577, 5652, 5677, 5752, 5777, 5852, 5877, 5952, 5977, 6053, 6089, 6185, 6241, 6257, 6333, 6369, 6465, 6521, 6537, 6613, 6649, 6745, 6801, 6817, 6893, 6929, 7026, 7093, 7130, 7137, 7214, 7261, 7278, 7365, 7422, 7449, 7546, 7613, 7650, 7657, 7734, 7781, 7798, 7885, 7942, 7969, 8067, 8145, 8203, 8241, 8259, 8357, 8435, 8493, 8531, 8549, 8647, 8725, 8783, 8821, 8839, 8937, 9016, 9085, 9144, 9193, 9232, 9261, 9280, 9289, 9388, 9477, 9556, 9625, 9684, 9733, 9772, 9801, 9820, 9829, 9928, 10009, 10100, 10101, 10112, 10133, 10164, 10205, 10256, 10317, 10388, 10469, 10560, 10561, 10572, 10593, 10624, 10665, 10716, 10777, 10848, 10929, 11020, 11021, 11032, 11053, 11084, 11125, 11176, 11237, 11308, 11389, 11480, 11481, 11492, 11513, 11544, 11585, 11636, 11697, 11768, 11849, 11940, 11941, 11952, 11973, 12004, 12045, 12096, 12157, 12228, 12309, 12400, 12401, 12412, 12433, 12464, 12505, 12556, 12617, 12688, 12769, 12860, 12861, 12872, 12893, 12924, 12965, 13016, 13077, 13148, 13229, 13320, 13321, 13332, 13353, 13384, 13425, 13476, 13537, 13608, 13689, 13780, 13781, 13792, 13813, 13844, 13885, 13936, 13997, 14068, 14149, 14240, 14241, 14252, 14273, 14304, 14345, 14396, 14457, 14528, 14609, 14700, 14701, 14712, 14733, 14764, 14805, 14856, 14917, 14988, 15069, 15160, 15161, 15172, 15193, 15224, 15265, 15316, 15377, 15448, 15529, 15620, 15621, 15632, 15653, 15684, 15725, 15776, 15837, 15908, 15989, 16080, 16081, 16092, 16113, 16144, 16185, 16236, 16297, 16368, 16449, 16540, 16541, 16552, 16573, 16604, 16645, 16696, 16757, 16828, 16909, 17000, 17001, 17012, 17033, 17064, 17105, 17156, 17217, 17288, 17369, 17460, 17461, 17472, 17493, 17524, 17565, 17616, 17677, 17748, 17829, 17920, 17921, 17932, 17953, 17984, 18025, 18076, 18137, 18208, 18289, 18380, 18381, 18392, 18413, 18444, 18485, 18536, 18597, 18668, 18749, 18840, 18841, 18852, 18873, 18904, 18945, 18996, 19057, 19128, 19209, 19300, 19301, 19312, 19333, 19364, 19405, 19456, 19517, 19588, 19669, 19760, 19761, 19772, 19793, 19824, 19865, 19916, 19977, 20049, 20141, 20153, 20185, 20237, 20309, 20401, 20413, 20445, 20497, 20569, 20661, 20673, 20705, 20757, 20829, 20921, 20933, 20965, 21017, 21089, 21181, 21193, 21225, 21277, 21349, 21441, 21453, 21485, 21537, 21609, 21701, 21713, 21745, 21797, 21869, 21961, 21973, 22005, 22057, 22129, 22221, 22233, 22265, 22317, 22389, 22481, 22493, 22525, 22577, 22649, 22741, 22753, 22785, 22837, 22909, 23001, 23013, 23045, 23097, 23169, 23261, 23273, 23305, 23357, 23429, 23521, 23533, 23565, 23617, 23689, 23781, 23793, 23825, 23877, 23949, 24041, 24053, 24085, 24137, 24209, 24301, 24313, 24345, 24397, 24469, 24561, 24573, 24605, 24657, 24729, 24821, 24833, 24865, 24917, 24989, 25081, 25093, 25125, 25177, 25249, 25341, 25353, 25385, 25437, 25509, 25601, 25613, 25645, 25697, 25769, 25861, 25873, 25905, 25957, 26029, 26121, 26133, 26165, 26217, 26289, 26381, 26393, 26425, 26477, 26549, 26641, 26653, 26685, 26737, 26809, 26901, 26913, 26945, 26997, 27069, 27161, 27173, 27205, 27257, 27329, 27421, 27433, 27465, 27517, 27589, 27681, 27693, 27725, 27777, 27849, 27941, 27953, 27985, 28037, 28109, 28201, 28213, 28245, 28297, 28369, 28461, 28473, 28505, 28557, 28629, 28721, 28733, 28765, 28817, 28889, 28981, 28993, 29025, 29077, 29149, 29241, 29253, 29285, 29337, 29409, 29501, 29513, 29545, 29597, 29669, 29761, 29773, 29805, 29857, 29929, 30022, 30045, 30098, 30181, 30194, 30237, 30310, 30313, 30346, 30409, 30502, 30525, 30578, 30661, 30674, 30717, 30790, 30793, 30826, 30889, 30982, 31005, 31058, 31141, 31154, 31197, 31270, 31273, 31306, 31369, 31462, 31485, 31538, 31621, 31634, 31677, 31750, 31753, 31786, 31849, 31942, 31965, 32018, 32101, 32114, 32157, 32230, 32233, 32266, 32329, 32422, 32445, 32498, 32581, 32594, 32637, 32710, 32713, 32746, 32809, 32902, 32925, 32978, 33061, 33074, 33117, 33190, 33193, 33226, 33289, 33382, 33405, 33458, 33541, 33554, 33597, 33670, 33673, 33706, 33769, 33862, 33885, 33938, 34021, 34034, 34077, 34150, 34153, 34186, 34249, 34342, 34365, 34418, 34501, 34514, 34557, 34630, 34633, 34666, 34729, 34822, 34845, 34898, 34981, 34994, 35037, 35110, 35113, 35146, 35209, 35302, 35325, 35378, 35461, 35474, 35517, 35590, 35593, 35626, 35689, 35782, 35805, 35858, 35941, 35954, 35997, 36070, 36073, 36106, 36169, 36262, 36285, 36338, 36421, 36434, 36477, 36550, 36553, 36586, 36649, 36742, 36765, 36818, 36901, 36914, 36957, 37030, 37033, 37066, 37129, 37222, 37245, 37298, 37381, 37394, 37437, 37510, 37513, 37546, 37609, 37702, 37725, 37778, 37861, 37874, 37917, 37990, 37993, 38026, 38089, 38182, 38205, 38258, 38341, 38354, 38397, 38470, 38473, 38506, 38569, 38662, 38685, 38738, 38821, 38834, 38877, 38950, 38953, 38986, 39049, 39142, 39165, 39218, 39301

Other starting numbers lead to other sequences. Starting with 4 we get OEIS A366492 for example. However, some starting values lead to a quickly terminating sequence. Some examples are 3 --> 36, 31 --> 45, 15 --> 72 and 43 --> 81. The OEIS crossreferences are helpful in this regard:
See A366487 and A367349 for first differences.
Comma sequences in base 10, starting with 1, 2, 4, 5, 6, 7, 8, 9, 10 are A121805, A139284, A366492, A367337, A367350, A367351, A367352, A367353, A367354. Starting with 3 is trivial, and those starting with 11, 12, 13 are essentially duplicates.
See also A260261, A042948.

No comments:

Post a Comment