Wednesday, 14 February 2024

A Fibonacci Variant

I was happy to discover a variant of the famous Fibonacci sequence today when I began searching the OEIS for properties of the number associated with my diurnal age today: 27345. Let's look at OEIS  A321021:


 A321021

a(0)=0, a(1)=1; thereafter a(\(n\)) = a(\(n\)-2)+a(\(n\)-1), keeping just the digits that appear exactly once.



This is a Fibonacci-like sequence in that the next term is formed from the sum of the two previous terms but the fact that we keep only the digits that appear exactly once in this addend makes a huge difference. After 171 terms, the sequence enters a 100 term loop shown in blue below with 27345 marked in bold (permalink):

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 0, 34, 34, 68, 102, 170, 7, 1, 8, 9, 17, 26, 43, 69, 2, 71, 73, 1, 74, 75, 149, 4, 153, 157, 310, 467, 0, 467, 467, 934, 40, 974, 4, 978, 982, 1960, 94, 2054, 2148, 40, 21, 61, 82, 143, 5, 148, 153, 301, 5, 306, 3, 309, 312, 621, 9, 630, 639, 1269, 1908, 31, 13, 0, 13, 13, 26, 39, 65, 104, 169, 273, 2, 275, 2, 2, 4, 6, 10, 16, 26, 42, 68, 0, 68, 68, 136, 204, 340, 5, 345, 350, 695, 1045, 1740, 2785, 42, 87, 129, 216, 345, 561, 906, 1467, 27, 19, 46, 65, 0, 65, 65, 130, 195, 325, 520, 845, 1365, 10, 1375, 1385, 2760, 15, 25, 40, 65, 105, 170, 275, 5, 280, 285, 6, 291, 297, 5, 302, 307, 609, 916, 12, 928, 940, 16, 956, 972, 1928, 29, 1957, 1986, 94, 28, 1, 29, 30, 59, 89, 148, 237, 385, 6, 391, 397, 7, 0, 7, 7, 14, 21, 35, 56, 91, 147, 238, 385, 623, 18, 641, 659, 13, 672, 685, 1357, 4, 36, 40, 76, 6, 82, 0, 82, 82, 164, 246, 410, 5, 415, 420, 835, 12, 847, 859, 1706, 26, 1732, 1758, 3490, 5248, 73, 5321, 5394, 75, 5469, 0, 5469, 5469, 10938, 16407, 27345, 43752, 109, 43861, 43970, 731, 701, 1432, 21, 1453, 17, 1470, 1487, 2957, 0, 2957, 2957, 5914, 71, 98, 169, 267, 436, 703, 39, 742, 781, 1523, 2304, 3827, 63, 3890, 95, 3985, 48, 40, 0, 40, 40, 80, 120, 2, 1, 3, 4, 7, 0, 7, 7, 14, 21, 35, ...

Thus 27345 is a term in this 100 term loop and this qualifies it for membership in OEIS  A321022:


 A321022

The 100 terms of the cycle that A321021 goes into.   
          


As with the Fibonacci sequence, this Fibonacci-like sequence need not begin with 0 and 1 but could be a Lucas-like sequence beginning with 2 and 1:

2, 1, 3, 4, 7, 0, 7, 7, 14, 21, 35, 56, 91, 147, 238, 385, 623, 18, 641, 659, 13, 672, 685, 1357, 4, 36, 40, 76, 6, 82, 0, 82, 82, 164, 246, 410, 5, 415, 420, 835, 12, 847, 859, 1706, 26, 1732, 1758, 3490, 5248, 73, 5321, 5394, 75, 5469, 0, 5469, 5469, 10938, 16407, 27345, 43752, 109, 43861, 43970, 731, 701, 1432, 21, 1453, 17, 1470, 1487, 2957, 0, 2957, 2957, 5914, 71, 98, 169, 267, 436, 703, 39, 742, 781, 1523, 2304, 3827, 63, 3890, 95, 3985, 48, 40, 0, 40, 40, 80, 120, 2, 1, 3, 4, 7, 0, 7, 7, 14, 21, 35, 56, ...

Again we end up with the same cycle of 100 terms, it just starts a little earlier. One can also try a tribonacci approach with starting points of 0, 1 and 2. This gives a loop of almost 1000 terms (permalink) with a maximum value reached of 120487 (shown in bold red):

0, 1, 2, 3, 6, 0, 9, 15, 24, 48, 87, 159, 294, 540, 3, 837, 1380, 0, 17, 1397, 0, 0, 1397, 1397, 2794, 0, 49, 2843, 89, 2981, 5913, 93, 97, 6103, 6293, 12493, 249, 19035, 31, 935, 21, 987, 1943, 2951, 51, 95, 3097, 24, 3216, 67, 7, 3290, 64, 61, 3415, 3540, 7016, 397, 10953, 183, 5, 4, 192, 201, 397, 790, 13, 12, 815, 840, 17, 1672, 59, 1748, 3479, 5286, 53, 1, 5340, 5394, 10735, 21469, 37598, 69802, 1269, 1089, 72160, 74518, 146, 1682, 734, 56, 47, 837, 940, 1824, 3601, 35, 5460, 6, 1, 5467, 57, 2, 26, 85, 3, 4, 92, 0, 96, 1, 97, 194, 9, 3, 206, 218, 427, 851, 1496, 24, 2371, 3891, 28, 6290, 129, 67, 48, 2, 7, 57, 0, 64, 2, 0, 0, 2, 2, 4, 8, 14, 26, 48, 0, 74, 1, 75, 150, 6, 231, 387, 624, 14, 1025, 13, 1052, 29, 1094, 2175, 3298, 57, 30, 85, 172, 287, 5, 6, 298, 309, 613, 10, 932, 1, 943, 1876, 80, 28, 1984, 9, 1, 14, 24, 39, 0, 63, 102, 165, 0, 267, 432, 6, 705, 43, 754, 1502, 0, 56, 18, 74, 148, 240, 462, 850, 12, 1324, 2186, 35, 34, 0, 69, 103, 172, 3, 278, 453, 734, 1465, 65, 64, 1594, 1723, 81, 98, 1902, 2081, 4081, 8064, 146, 9, 8219, 8374, 102, 195, 8671, 96, 8962, 129, 9187, 127, 93, 9407, 9627, 927, 6, 156, 1089, 25, 1270, 2384, 3679, 7, 67, 75, 149, 291, 1, 1, 293, 295, 589, 0, 4, 593, 597, 94, 1284, 1975, 5, 3264, 52, 21, 7, 80, 108, 195, 8, 3, 206, 217, 426, 849, 1492, 26, 2367, 35, 48, 2450, 25, 53, 58, 136, 247, 1, 384, 632, 7, 1023, 12, 1042, 20, 1074, 2136, 20, 20, 2176, 16, 1, 2193, 10, 4, 7, 21, 32, 60, 3, 95, 158, 256, 509, 923, 16, 18, 957, 1, 976, 1934, 29, 23, 1986, 2038, 7, 4031, 7, 5, 3, 15, 23, 41, 79, 143, 263, 485, 891, 1639, 3015, 4, 4658, 6, 48, 4712, 47, 4807, 95, 0, 4902, 47, 0, 0, 47, 47, 94, 1, 142, 237, 380, 759, 1376, 21, 2156, 0, 21, 21, 42, 84, 147, 273, 504, 924, 70, 1498, 49, 67, 64, 180, 3, 247, 430, 680, 1357, 2467, 50, 3874, 6391, 35, 13, 6439, 6487, 123, 13049, 165, 17, 2, 184, 203, 389, 6, 598, 3, 607, 1208, 0, 85, 1293, 1378, 2756, 5427, 9561, 1, 148, 9710, 85, 43, 93, 1, 137, 231, 369, 3, 603, 975, 58, 13, 1046, 7, 10, 1063, 18, 9, 19, 46, 74, 139, 259, 472, 870, 60, 1402, 0, 1462, 2864, 4326, 8652, 15842, 0, 29, 587, 1, 617, 1205, 1823, 3645, 73, 41, 3759, 87, 37, 0, 124, 6, 130, 260, 396, 786, 12, 94, 892, 8, 4, 904, 916, 1824, 36, 26, 16, 78, 120, 214, 412, 746, 1372, 2530, 68, 3970, 58, 4096, 8124, 178, 12398, 27, 12603, 508, 8, 39, 0, 47, 86, 1, 134, 1, 136, 271, 408, 815, 19, 14, 4, 37, 0, 41, 78, 9, 128, 215, 352, 695, 16, 1063, 14, 1093, 2170, 32, 3295, 5497, 24, 16, 37, 0, 53, 90, 143, 286, 519, 948, 1753, 30, 2731, 51, 81, 2863, 25, 26, 2914, 2965, 90, 56, 3, 149, 208, 360, 1, 569, 930, 15, 54, 0, 69, 123, 192, 384, 6, 582, 972, 1560, 34, 25, 69, 128, 0, 197, 325, 5, 527, 857, 1389, 23, 69, 48, 140, 257, 5, 402, 4, 4, 410, 418, 832, 10, 1260, 10, 1280, 20, 30, 10, 60, 1, 71, 132, 204, 407, 743, 1354, 2504, 4601, 8459, 164, 134, 85, 8, 7, 1, 16, 24, 41, 81, 146, 268, 495, 0, 763, 1258, 1, 0, 1259, 1260, 2519, 5038, 17, 54, 5109, 5180, 104, 109, 59, 7, 175, 241, 423, 839, 1503, 2765, 5107, 9375, 124, 140, 63, 327, 530, 920, 1, 45, 9, 0, 54, 63, 7, 124, 194, 325, 643, 62, 13, 718, 793, 1524, 5, 3, 1532, 1540, 3075, 6147, 10762, 184, 17093, 28039, 45316, 908, 74263, 120487, 1968, 9678, 2, 648, 10328, 10978, 21954, 43260, 76192, 6, 9458, 8, 9472, 193, 9673, 198, 164, 135, 497, 796, 1428, 71, 95, 1594, 1760, 39, 9, 10, 58, 0, 68, 126, 194, 3, 2, 1, 6, 9, 16, 31, 56, 103, 190, 349, 642, 8, 0, 650, 658, 1308, 21, 1987, 16, 4, 27, 47, 78, 152, 2, 3, 157, 162, 3, 3, 168, 174, 345, 687, 1206, 38, 93, 17, 148, 258, 423, 829, 50, 1302, 28, 1380, 2710, 48, 4138, 89, 4275, 8502, 128, 12905, 213, 13246, 234, 169, 13649, 14052, 280, 27981, 421, 6, 240, 7, 253, 5, 265, 523, 793, 58, 1374, 5, 1437, 2816, 4258, 85, 7159, 502, 46, 0, 548, 594, 42, 84, 720, 846, 1650, 3216, 5712, 10578, 19506, 35796, 650, 92, 658, 14, 764, 1436, 14, 14, 16, 0, 30, 46, 76, 152, 274, 502, 928, 1704, 14, 24, 1742, 1780, 3546, 7068, 12394, 238, 197, 189, 624, 0, 813, 1437, 50, 23, 50, 123, 196, 369, 6, 571, 946, 1523, 34, 2503, 46, 2583, 5132, 61, 6, 51, 8, 65, 124, 197, 386, 0, 583, 6, 589, 78, 673, 1340, 2091, 10, 31, 13, 54, 98, 165, 317, 580, 1062, 15, 1657, 2734, 6, 4397, 13, 16, 26, 0, 42, 68, 0, 0, 68, 68, 136, 7, 2, 145, 154, 301, 6, 461, 768, 1235, 26, 9, 1270, 1305, 2584, 19, 3908, 65, 32, 45, 142, 219, 406, 6, 631, 1043, 1680, 54, 2, 1736, 1792, 50, 3578, 5420, 9048, 18046, 32514, 59608, 68, 210, 596, 874, 1680, 3150, 5704, 10534, 193, 643, 370, 1206, 19, 19, 12, 50, 81, 143, 274, 498, 915, 1687, 31, 26, 17, 74, 7, 98, 179, 284, 561, 1024, 1869, 35, 98, 0, 1, 0, 1, 2, 3, ...

No comments:

Post a Comment