# Unexpected pattern in consecutive 7 digit “double” palindromes?

Why does this branching structure appear in consecutive 7 digit "double" palindromes?

Dots at the end of the rows indicate that I excluded following values for that row
(because of the character limit for the post - see the link below for full pattern)

(Scroll around)

3 :
4 :1325
5 :12
6 :8110 432 4
7 :100 4  164051
8 :122  564   414 6129
9 :1111421 136 644  81  5 167
10 :163 24   5 815 13 87  6128 118    5
11 :  187  6 19    11296   105  22106   720275   121
12 :218   6 21   145  6   126 16 8  126   3486 97   127  6  15 127
13 :249    742129    21   6  151 16    8  149  17 10555  79  7    148    818 150
14 :282     7198     22    7 1433418      7 176  18   187 18 442 17     7   174   18   8 176    17 188
15 :317      20214      352116936     9204 20     214 20  521      7  20519      8204   18     214  19  208 7
16 :355      20  243       60 194 8       23     24522     24422    268 2789      295      923621      243 21     2368  21  236   8
17 :395      21   274        20 267 9       25    236 64     27724    27724   3119       288 41     20 279     2929     276 12 10     266  91113  266    9 64
18 :437      21     308       22  300 9        2131 24624  43    337    31226    685  9        21 4    338    21  3059    326   9    30122   11    299   1011 14
19 :481     23     344        22    335 10       23 31224   9       29    23353   36511    36214   383  11      22  336   9      30   24    33910   24 339   9   362     10   336 23    12   334    22  15
20 :527     23       382       24     372 10        23   373   10       247   25 312  76   405 11   402 13   424  13    399    10      2436      333    3810  27   375   10  26 375     10  37624       11  373  24     13 372     23
21 :575    25       423       24      412 11       25   412    10        24 37  348 27   51  447  10   444  13  926     12    13 11 414     11    36 13  14     34667   10 1316   413     11 29413        10 415 25        12 412   25      456
22 :625    1312         465      26      454 11        25    454    11       26 428 27    11      36  30461  11  488   12  486   15  509     14  14 11  455      12    14  468      11  26  1213   15    454    121418 454       12484         12456  27        466    27
23 :677   1413         510      1412       498 12       27    498    11        26  47129    12      38 32 426   75  11  534    12 532    14  556     16528       14   14  512       11   16  56    452       39   27   17 498      26 516        51429         511   29        510    29      572
24 :731   14 12          557     1513       544 12        1413     544    12       28  51629     12       2846  468  30     44  12 33549    12 580     14 1203      16 14    557        13  16   557        12 18  38      16 544     27    561       28 563        559 31        557    31        591      621       28
25 :787  15 13          606     15 12        592 13       15 13     592    12        28   593     13       29563  30      12     29 13 35 596    13630      13 627      16656     32    606        15 15     604         13 18    605         31  7    28       608      29    609        28  57933       607  33        606   33       1321       29     5
26 :845  15  13          657    16 13        642 14       15  13     642    13       30   642      13        30612 32      13     451522  558    83   14682      14679       15710    695       32     655         1517      654          32    655          40     31      658       30    660       31 62835       657  35       657   35       726    695       29     7 2213
27 :905 16  14          710    16  13        694 15      16  14     694    13        1615   694      14       32663 32       13      85   606   33      48   54696     15733        1534      32       708        33      706           32       705           33    42        708       32      711      33   713       32 67937      710  37       749      782    30       694 17      16...
28 :967 16   14          765   17  14        748 16      16   14     748    14       17 15   748      14        3371634       14      748   33       14    32  3225 749     804       802         837     33       764       33        761          33       759            33       760            33    4      34        763      35     766      34   768      3573239      765 39  ...
29 :103117   15          822   17   14        804 17     17   15     804    14        17  15   804      15       171877134        14       804  35       15    67  25  708     91    59804       860         897    863      34        819         33         816           34        815             33       816             43     37       820      36     823     37  825      36...
30 :109717    15          881  18   15        862 18     17    15     862    15       18   15   862      15        17 18863        15       862  35        15     97  763    36        51    33 27862      921         1887     34          878        34         876          34          873             34         872              34       47         877     38       879  ...
31 :1182    16          942  18    15        922 19    18    16     922    16       18    15   922      16       18  18922         15        922 37        16     922    36         15   35   35  27922      34949        981           1021    35          940       34           937         35          935            34           932              35         933         ...
32 :1252     16          1005 19    16        984 20    18     16     984    17      19    16   984      16        18   18984         16       19966 37         16      984   38         16   74    27879      99     36 1011        1045          1088   1050     36           1001        35            998          36           996             35           995              36 ...
33 :1324     17          1070 19     16        1048 21   19     17     1048    18      19     16   1048      17       19    181048         16        19 102939         17      1048   38          16    108940     39         55     37  1075       371075          2276    36             1066      37            1064         36             1061           37            1059            ...
34 :1398      17          113720     17        1114 22   19      17     1114    19     20     17   1114      17        19     181114         17       20  109439          17       201094  40          17    1114     39          17  38    39   1141       38 1141         1179           1224  38             1134     37              1131       38             1129          37          ...
35 :1474      18          120620      17        1182 23  20      18     1182    20     20      17   1182      18       20      181182         17        20   1201          18       20 1161  40           17     1182    41          18  83    1095       107      40  1209         1248           1297 1256   39              41 1159      38               1198        39              1196   ...
36 :1552       18          1297      18        1252 24  20       18     1252    21    21      18   1252      19       20       181252         18       21    1270           18        20  1230 42           18     1252    41           18   1252      42           58      41   1279        421279           2701  39                41   1228    40               421228       2019      ...
37 :1632       19          1370       18        1324 25 21       19     1324    22    21       18   1324      20      21       191324         18        21     1342           19       21   1301 42            18      231301   43           19   1324      42            18 41     43    1351        43 1351          1395           144541                1346   40                 42  ...
38 :1714        19          1445       19        1398 26 21        19     1398    23   22       19   1398      21      21        191398         19       22      1416           19        21    137444            19      23 1374   43            19    1398     44            19 91     1302        115       45  1425          441426           3004 42                 43    1372    2219 ...
39 :1798        20          1522        19        1474 2722        20     1474    24   22        19   1474      22     22        201474         19        22       1492           20       22     144944             19       23  1449  45            20    251449     44             19  1474       45            62       46   1501         46 1502           316242                 ...
40 :1884         20          1601        20        1552 2822         20     1552    25  23        20   1552      23     22         201552         20       23        1570           20        22      1571             20       23   1526  45             20     25 1526    46             20  1552       45             2044      48    1579         47  1579           1629         ...
41 :1972         21          1682         20        1632 51         21     1632    26  23         20   1632      24    23         211632         21       23         1650           21       23       1650              20        23    1605 47             21     25  1605    46              20   1632      47             21100     1527         123        49   1659           49...
42 :2062          21          1765         21        1714 52          21     1714    27 24         21   1714      25    23          211714         22      24         1733           21        23        1732              21       24     1686 47              21      25   1686   48              21   281686      47              21 1714        48              65        50...
43 :2154          22          1850          21        1798 53          22     1798    28 24          21   1798      26   24          221798         23      24          1817           22       24         1816              21        24      176949              22      25    1769   48               21    28 1769     49              22 1798        48               67  ...
44 :2248           22          1937          22        1884 54           22     1884    2925          22   1884      27   24           221884         24     25          1904           22        24          1902              22       25       185449               22       25     1854  50               22    28  1854     49               22  301854       50          ...
45 :2344           23          2026           22        1972 55           23     1972    3025           22   1972      28  25           231972         25     25           1992           23       25           1990              22        25        1991               23       25      1941  50                22     28   1941    51               23  30 1941       50   ...
46 :2442            23          2117           23        2062 56            23     2062    56           23   2062      29  25            232062         26    26           2083           24       25            2080              23       26         2080                23        25       2030 52                23     28    2030    51                23   30  2030   ...
47 :2542            24          2210            23        2154 57            24     2154    57            23   2154      30 26            242154         27    26            2175           25      26            2173              23        26          2172                24       26        2121 52                 23      28     2121   53                24   30 ...
48 :2644             24          2305            24        2248 58             24     2248    58            24   2248      31 26             242248         28   27            2270           26      26             2267              24       27           2266                24        26         221454                 24      28      2214   53                 ...
49 :2748             25          2402             24        2344 59             25     2344    59             24   2344      3227             252344         29   27             2366           27     27             2364              24        27            2362                25       27          230954                  24       28       2309  55            ...
50 :2854              25          292472             25        2442 60              25     2442    60             25   2442      3327              252442         30  28             2465           28     27              2462              25       28             2460                25        27           2461                  25       28        2406  55      ...
51 :2962              26          302572              25        2542 61              26     2542    61              25   2542      61              262542         31  28              2565           29    28              2563              26       28              2560                26       28            2560                   25        28         2505 57  ...
52 :3072               26          30 2674              26        2644 62               26     2644    62              26   2644      62               262644         32 29              2668           30    28               2665              27      29              2663                26        28             2662                   26       29          ...
53 :3184               27          31 2778               26        2748 63               27     2748    63               26   2748      63               272748         33 29               2772           31   29               2770              28      29               2767                27       29              2766                   26        29      ...
54 :3298                27          31  2884               27        2854 64                27     2854    64               27   2854      64                272854         3430               2879           32   29                2876              29     30               2874                27        29               2872                   27       30  ...
55 :3414                28          32  2992                27        342928 65                28     2962    65                27   2962      65                282962         3530                2987           33  30                2985              30     30                2982                28       30                2980                   27      ...
56 :3532                 28          32   3102                28        353037 66                 28     3072    66                28   3072      66                 283072         66                3098           34  30                 3095              31    31                3093                29       30                 3090                   28  ...
57 :3652                 29          33   3214                 28        35 3148 67                 29     3184    67                 28   3184      67                 293184         67                 3210           35 31                 3208              32    31                 3205                30      31                 3203                   ...
58 :3774                  29          33    3328                 29        36 3261 68                  29     3298    68                 29   3298      68                  293298         68                 3325           36 31                  3322              33   32                 3320                31      31                  3317              ...
59 :3898                  30          34    3444                  29        36  3376 69                  30     3414    69                  29   3414      69                  303414         69                  3441           3732                  3439              34   32                  3436                32     32                  3434           ...
60 :4024                   30          34     3562                  30        37  3493 70                   30     393493    70                  30   3532      70                   303532         70                  3560           3832                   3557              35  33                  3555                33     32                   3552     ...
61 :4152                   31          35     3682                   30        37   3612 71                   31     403612    71                   30   3652      71                   313652         71                   3680           71                   3678              36  33                   3675                34    33                   3673  ...
62 :4282                    31          35      3804                   31        38   3733 72                    31     40 3733    72                   31   3774      72                    313774         72                   3803           72                    3800              37 34                   3798                35    33                 ...
63 :4414                    32          36      3928                    31        38    3856 73                    32     41 3856    73                    31   3898      73                    323898         73                    3927           73                    3925              38 34                    3922                36   34             ...
64 :4548                     32          36       4054                    32        39    3981 74                     32     41  3981    74                    32   4024      74                     324024         74                    4054           74                     4051              3935                    4049                37   34        ...
65 :4684                     33          37       4182                     32        39     4108 75                     33     42  4108    75                     32   444108      75                     334152         75                     4182           75                     4180              4035                     4177                38  35   ...
66 :4822                      33          37        4312                     33        40     4237 76                      33     42   4237    76                     33   454237      76                      334282         76                     4313           76                      4310              76                     4308                39 ...
67 :4962                      34          38        4444                      33        40      4368 77                      34     43   4368    77                      33   45 4368      77                      344414         77                      4445           77                      4443              77                      4440            ...
68 :5104                       34          38         4578                      34        41      4501 78                       34     43    4501    78                      34   46 4501      78                       344548         78                      4580           78                       4577              78                      4575      ...
69 :5248                       35          39         4714                       34        41       4636 79                       35     44    4636    79                       34   46  4636      79                       354684         79                       4716           79                       4714              79                       4711...
70 :5394                        35          39          4852                       35        42       4773 80                        35     44     4773    80                       35   47  4773      80                        35494773         80                       4855           80                        4852              80                 ...
71 :5542                        36          40          4992                        35        42        4912 81                        36     45     4912    81                        35   47   4912      81                        36504912         81                        4995           81                        4993              81            ...
72 :5692                         36          40           5134                        36        43        5053 82                         36     45      5053    82                        36   48   5053      82                         3650 5053         82                        5138           82                         5135              82     ...
73 :5844                         37          41           5278                         36        43         5196 83                         37     46      5196    83                         36   48    5196      83                         3751 5196         83                         5282           83                         5280              83...
74 :5998                          37          41            5424                         37        44         5341 84                          37     46       5341    84                         37   49    5341      84                          3751  5341         84                         5429           84                          5426        ...
75 :6154                          38          42            5572                          37        44          5488 85                          38     47       5488    85                          37   49     5488      85                          3852  5488         85                          895488           85                          5575  ...
76 :6312                           38          42             5722                          38        45          5637 86                           38     47        5637    86                          38   50     5637      86                           3852   5637         86                          915637           86                       ...
77 :6472                           39          43             5874                           38        45           5788 87                           39     48        5788    87                           38   50      5788      87                           3953   5788         87                           91 5788           87                 ...
78 :6634                            39          43              6028                           39        46           5941 88                            39     48         5941    88                           39   51      5941      88                            3953    5941         88                           93 5941           88           ...
79 :6798                            40          44              6184                            39        46            6096 89                            40     49         6096    89                            39   51       6096      89                            4054    6096         89                            93  6096           89     ...
80 :6964                             40          44               6342                            40        47            6253 90                             40     49          6253    90                            40   52       6253      90                             4054     6253         90                            95  6253           ...
81 :7132                             41          45               6502                             40        47             6412 91                             41     50          6412    91                             40   52        6412      91                             4155     6412         91                             95   6412     ...
82 :7302                              41          45                6664                             41        48             6573 92                              41     50           6573    92                             41   53        6573      92                              4155      6573         92                             97   ...
83 :7474                              42          46                6828                              41        48              6736 93                              42     51           6736    93                              41   53         6736      93                              4256      6736         93                             ...
84 :7648                               42          46                 6994                              42        49              6901 94                               42     51            6901    94                              42   54         6901      94                               4256       6901         94                       ...
85 :7824                               43          47                 7162                               42        49               7068 95                               43     52            7068    95                               42   54          7068      95                               4357       7068         95                   ...
86 :8002                                43          47                  7332                               43        50               7237 96                                43     52             7237    96                               43   55          7237      96                                4357        7237         96             ...
87 :8182                                44          48                  7504                                43        50                7408 97                                44     53             7408    97                                43   55           7408      97                                4458        7408         97         ...


You can view more values Here, first $114$ number bases with all values each.
(zoom out to see more of the pattern at the same time)

How to generate the above pattern:

"Double" palindrome or Palindrome$^2$ - this is a number which is palindromic in two consecutive number bases $b,b+1$ . For example, number $10$ is a palindrome$^2$ (write $p^2$ short, from now on) since $10=22_3=101_4$

Now, consider only $p^2$ who have exactly $7$ digits in number bases $b,b+1$.

Each row starts with "$b:$" in the above pattern. Then every number after that in the row is the gap between two consecutive $p^2$'s divided by the smallest gap in the entire row (Which is $b+2$ in all observed rows so far); and ignore the remainder (round down).

All the smallest gaps divided by the smallest gap equal $1$. But you don't see any $1$'s in the pattern? That's because all $1$'s were replaced with an empty space "".

The gaps count the number of palindromes palindromic only in $b$, and not in $b+1$, which are in between two consecutive $p^2$'s.

How did I get this idea?

Well, I was trying to find a formula/algorithm to calculate/generate all $7$ digit $p^2$'s in a specific number base $b$. But I couldn't make sense of the patterns in the digits of consecutive $p^2$'s neither in their decimal values. Then I tried looking only at palindromes in base $b$ and at the gaps between two $p^2$'s. I noticed the smallest gap $(b+2)$ repeats a lot, so I divided every gap with the smallest gap while ignoring the remainder and replacing $1$'s with empty spaces. Then the pattern started to be more visible.

Question:

What is this pattern? Is there anything similar to it out there?

Q: How we determine/predict gaps at the next number base if we know the gaps at previous?

Observation: You can notice "splits" every $5$ number bases starting at $b=50$. In other words, a line of numbers splitting into two more lines. After the split, the line and lines around it seem to follow a constant pattern.

Example: notice 2402 at base $49$ becoming (splitting into) 29,2472 at base $50$.
Then 29 and 2472 start increasing by a constant pattern going down.

My python code for the above pattern: run it on repl.it!

How can we directly generate this pattern (exact numbers and gaps) without needing to check every single palindrome? (predicting the gaps/patterns?)

P.S. I managed to find a formula to generate all $p^2$'s with $3$ digits here, but it's rather straightforward unlike $7$ digits here. $9$ digits seem to have even more unpredictable gaps.