In my last post on palindromic numbers, I looked at the frequencies of valid
& invalid
palindromic numbers and found that almost all invalid
palindromes are odd. To explore why this might be, I'll now look at the differences between even and odd palindromes. (By this I mean even and odd numbers, \(n\), that have palindromic representations in a base less than \(n - 1\).)
Of evens and odds
Of the 4997 valid
even palindromes through 10,000, over 62% have a length of 3 digits and just under 20% have a length of 2 digits. Palindromes of lengths ranging from 4 to 9 comprise the nearly 18% remaining. This is somewhat similar to the odds: just over 70% have length 3, a little less than 14% have length 2, and the bit more than 16% remaining have lengths ranging from 4 to 14. So the odds are spread out a bit more as far as lengths go, but they and the evens are fairly similar in that regard.
What about the frequency of bases? Do the evens have more or less of certain bases or ranges of bases? Well, as far as number of bases, the evens have a slightly higher (a little over 5.5%) diversity of (valid
, lowest) bases over the first 10,000 counting numbers. I don't think that's enough to be significant, though (I'd love to be proven wrong in the comments!), so let's look at the frequencies of individual bases:
Base | # of occurences |
---|---|
2 | 0 |
3 | 159 |
4 | 67 |
5 | 144 |
6 | 89 |
7 | 136 |
8 | 61 |
9 | 95 |
10 | 66 |
11 | 112 |
12 | 68 |
13 | 102 |
14 | 70 |
15 | 101 |
16 | 74 |
17 | 107 |
18 | 97 |
19 | 125 |
20 | 130 |
21 | 155 |
22 | 149 |
23 | 129 |
24 | 112 |
25 | 108 |
26 | 88 |
27 | 79 |
28 | 93 |
29 | 87 |
30 | 84 |
31 | 72 |
32 | 64 |
33 | 69 |
34 | 62 |
35 | 65 |
36 | 59 |
37 | 49 |
38 | 48 |
39 | 53 |
40 | 47 |
41 | 48 |
42 | 43 |
43 | 49 |
44 | 30 |
45 | 41 |
46 | 35 |
47 | 32 |
48 | 29 |
49 | 20 |
50 | 18 |
51 | 35 |
52 | 24 |
53 | 27 |
54 | 20 |
55 | 31 |
56 | 20 |
57 | 32 |
58 | 16 |
59 | 14 |
60 | 15 |
61–4986 (271 bases) |
943 |
Base | # of occurences |
---|---|
2 | 202 |
3 | 39 |
4 | 112 |
5 | 43 |
6 | 139 |
7 | 72 |
8 | 83 |
9 | 35 |
10 | 75 |
11 | 36 |
12 | 87 |
13 | 53 |
14 | 89 |
15 | 63 |
16 | 84 |
17 | 88 |
18 | 117 |
19 | 106 |
20 | 148 |
21 | 150 |
22 | 150 |
23 | 134 |
24 | 125 |
25 | 110 |
26 | 91 |
27 | 88 |
28 | 102 |
29 | 83 |
30 | 84 |
31 | 69 |
32 | 73 |
33 | 58 |
34 | 61 |
35 | 52 |
36 | 58 |
37 | 46 |
38 | 54 |
39 | 51 |
40 | 51 |
41 | 45 |
42 | 45 |
43 | 32 |
44 | 40 |
45 | 37 |
46 | 40 |
47 | 28 |
48 | 34 |
49 | 24 |
50 | 31 |
51 | 21 |
52 | 33 |
53 | 19 |
54 | 20 |
55 | 17 |
56 | 14 |
57 | 21 |
58 | 22 |
59 | 15 |
60 | 22 |
61–3256 (239 bases) |
860 |
Now here's where it gets fascinating. For the lower bases, the evens have much more odd bases and the odds have much more even bases. (Why do evens have no base-2 palindromes? A binary palindrome would have to end in a '1' — allowing leading zeroes would cause all sorts of problems — and binary numbers that end in '1' are odd.) In general, the larger the base, the lower the frequency, but around base-20, both the evens and odds see an upswing in frequencies of all bases that gradually tapers down to about base-50. It's here that we see a recurrence of the original pattern, albeit at a much smaller scale. (There is also a small uptick at base-28 for both evens and odds, and the high/low pattern makes a brief appearance in the early thirties.)
Can you take me higher?
Obviously, this particular patterning is the result of the limited number set we're working with. Does it continue for larger number groups?
Base | # of occurences |
---|---|
2 | 0 |
3 | 513 |
4 | 166 |
5 | 522 |
6 | 190 |
7 | 451 |
8 | 280 |
9 | 444 |
10 | 457 |
11 | 508 |
12 | 355 |
13 | 415 |
14 | 245 |
15 | 371 |
16 | 163 |
17 | 369 |
18 | 226 |
19 | 358 |
20 | 228 |
21 | 338 |
22 | 235 |
23 | 308 |
24 | 230 |
25 | 303 |
26 | 237 |
27 | 301 |
28 | 293 |
29 | 362 |
30 | 324 |
31 | 381 |
32 | 352 |
33 | 438 |
34 | 382 |
35 | 467 |
36 | 430 |
37 | 484 |
38 | 462 |
39 | 546 |
40 | 528 |
41 | 594 |
42 | 596 |
43 | 679 |
44 | 637 |
45 | 713 |
46 | 706 |
47 | 718 |
48 | 681 |
49 | 636 |
50 | 605 |
51 | 625 |
52 | 565 |
53 | 572 |
54 | 521 |
55 | 550 |
56 | 482 |
57 | 479 |
58 | 445 |
59 | 469 |
60 | 395 |
61 | 410 |
62 | 375 |
63 | 416 |
64 | 358 |
65 | 364 |
66 | 371 |
67 | 363 |
68 | 307 |
69 | 318 |
70 | 325 |
71 | 315 |
72 | 323 |
73 | 273 |
74 | 271 |
75 | 301 |
76 | 281 |
77 | 273 |
78 | 258 |
79 | 267 |
80 | 252 |
81 | 215 |
82 | 239 |
83 | 251 |
84 | 206 |
85 | 232 |
86 | 202 |
87 | 203 |
88 | 231 |
89 | 209 |
90 | 200 |
91 | 206 |
92 | 165 |
93 | 180 |
94 | 176 |
95 | 186 |
96 | 192 |
97 | 157 |
98 | 153 |
99 | 174 |
100 | 163 |
101–49,990 (1831 bases) |
14,306 |
Base | # of occurences |
---|---|
2 | 642 |
3 | 135 |
4 | 399 |
5 | 241 |
6 | 443 |
7 | 128 |
8 | 290 |
9 | 290 |
10 | 552 |
11 | 339 |
12 | 398 |
13 | 240 |
14 | 343 |
15 | 156 |
16 | 280 |
17 | 113 |
18 | 237 |
19 | 106 |
20 | 249 |
21 | 150 |
22 | 260 |
23 | 176 |
24 | 266 |
25 | 208 |
26 | 285 |
27 | 222 |
28 | 343 |
29 | 281 |
30 | 365 |
31 | 311 |
32 | 337 |
33 | 360 |
34 | 428 |
35 | 401 |
36 | 470 |
37 | 455 |
38 | 544 |
39 | 516 |
40 | 585 |
41 | 547 |
42 | 627 |
43 | 617 |
44 | 690 |
45 | 676 |
46 | 755 |
47 | 710 |
48 | 709 |
49 | 646 |
50 | 642 |
51 | 596 |
52 | 587 |
53 | 549 |
54 | 549 |
55 | 524 |
56 | 516 |
57 | 498 |
58 | 480 |
59 | 438 |
60 | 452 |
61 | 438 |
62 | 436 |
63 | 394 |
64 | 336 |
65 | 378 |
66 | 370 |
67 | 348 |
68 | 366 |
69 | 318 |
70 | 353 |
71 | 299 |
72 | 346 |
73 | 305 |
74 | 295 |
75 | 293 |
76 | 273 |
77 | 260 |
78 | 273 |
79 | 248 |
80 | 276 |
81 | 207 |
82 | 234 |
83 | 220 |
84 | 237 |
85 | 241 |
86 | 230 |
87 | 204 |
88 | 214 |
89 | 185 |
90 | 205 |
91 | 202 |
92 | 205 |
93 | 179 |
94 | 183 |
95 | 181 |
96 | 177 |
97 | 170 |
98 | 184 |
99 | 153 |
100 | 163 |
101–32,910 (1596 bases) |
13,869 |
It seems so. (With one order-of-magnitude increase, at least.)
More pointedly, the early alternating pattern continues, as does the overall swelling later and the return to the alternating pattern. But— there are some hiccups in the alternating pattern now, the swelling occurs later (and is now responsible for the highest frequencies), and the later alternation is less pronounced.
I won't check higher numbers because it takes quite some time to compute these numbers (at least with the quick script I wrote for the task, and I don't wish to spend the time to see if I can make a faster program). However, if the trends I see continue, it looks like the alternating pattern becomes most significant as the upper number limit approaches infinity. (I base this on the alternations continuing mostly unhindered and the swelling moving into higher ranges. As we approach an infinite upper bound, it would follow that the swelling would approach infinity as well.) So why are even numbers likely to have their lowest-base palindrome be in an odd base and vice-versa for the odds?
I don't have an answer to that question. I'd be interested if any readers did. In the meantime, I'll look at something I noticed about one of my first lists: the invalid
palindromes. For a refresher, let's look at those, this time through 10,000:
- 1
- 2
- 3
- 4
- 6
- 11
- 19
- 47
- 53
- 79
- 103
- 137
- 139
- 149
- 163
- 167
- 179
- 223
- 263
- 269
- 283
- 293
- 311
- 317
- 347
- 359
- 367
- 389
- 439
- 491
- 563
- 569
- 593
- 607
- 659
- 739
- 827
- 853
- 877
- 977
- 983
- 997
- 1019
- 1049
- 1061
- 1187
- 1213
- 1237
- 1367
- 1433
- 1439
- 1447
- 1459
- 1511
- 1553
- 1579
- 1669
- 1709
- 1753
- 1759
- 1907
- 1949
- 1993
- 1997
- 2011
- 2063
- 2087
- 2099
- 2111
- 2137
- 2179
- 2207
- 2287
- 2309
- 2339
- 2417
- 2459
- 2503
- 2657
- 2677
- 2683
- 2693
- 2713
- 2749
- 2897
- 2963
- 3023
- 3089
- 3119
- 3229
- 3253
- 3259
- 3323
- 3371
- 3407
- 3449
- 3547
- 3559
- 3583
- 3623
- 3643
- 3833
- 3847
- 4007
- 4073
- 4091
- 4099
- 4139
- 4157
- 4211
- 4283
- 4337
- 4339
- 4349
- 4391
- 4463
- 4523
- 4549
- 4643
- 4679
- 4729
- 4787
- 4871
- 4909
- 4919
- 4933
- 5011
- 5021
- 5039
- 5059
- 5099
- 5179
- 5231
- 5297
- 5303
- 5309
- 5351
- 5387
- 5417
- 5431
- 5471
- 5503
- 5527
- 5653
- 5693
- 5711
- 5791
- 5827
- 5839
- 5939
- 6047
- 6067
- 6079
- 6089
- 6131
- 6199
- 6229
- 6247
- 6269
- 6277
- 6311
- 6343
- 6359
- 6389
- 6551
- 6599
- 6653
- 6793
- 6871
- 6947
- 6983
- 6991
- 7019
- 7079
- 7159
- 7213
- 7247
- 7283
- 7433
- 7487
- 7691
- 7817
- 7877
- 7949
- 7963
- 8017
- 8069
- 8089
- 8123
- 8147
- 8221
- 8243
- 8287
- 8291
- 8293
- 8423
- 8539
- 8573
- 8669
- 8699
- 8783
- 8863
- 8941
- 9043
- 9059
- 9067
- 9173
- 9209
- 9227
- 9277
- 9337
- 9341
- 9377
- 9419
- 9421
- 9533
- 9587
- 9643
- 9689
- 9739
- 9781
- 9887
I've highlighted the non-prime numbers. There are only three: 1, 4 and 6. Aha! So, not only are all invalid
palindromes above 6 odd, they are all prime as well! (Assuming this continues beyond 10,000. I have no proof it does, but so far it works.)
Roadblocks
Unfortunately, I have no idea where to go with this information. I can't see any patterns in the primes that do not have valid
palindromes vs. those that do. Moreover, I have no clue of the mechanics behind a number having a palindrome in a particular base over another. We have some clues, but no full set of numbers that do or do not have valid
palindromes. Hmm….