Monday, February 17, 2020

Applying Kevin McCall's logic to squares and other non-centered figurate numbers

Note: this post uses special terminology and notation introduced in the last post. You should read that first in order to understand what follows.


Kevin McCall's proof of the RPS theorem for reduced triangular numbers is based on the following observation:
The series of triangular numbers is generated by starting with 0, then adding 1, then adding 2, then 3, and so on through the succession of natural numbers. Due to the fact that k - n ≡ -n (mod k), one you've added numbers up to a certain point, you start doing the modular equivalent of subtracting those same numbers in reverse order, creating a palindrome.
Thus, if we consider the sequence of triangular numbers reduced modulo 10:

  • 0
  • +1
  • +2
  • +3
  • +4
  • +5
  • +6 ≡ -4 (mod 10)
  • +7 ≡ -3 (mod 10)
  • +8 ≡ -2 (mod 10)
  • +9 ≡ -1 (mod 10)
  • +10 ≡ 0 (mod 10)
  • +11 ≡ +1 (mod 10)
  • +12 ≡ +2 (mod 10)
  • +13 ≡ +3 (mod 10)
  • +14 ≡ +4 (mod 10)
  • +15 ≡ -5 (mod 10)
  • +16 ≡ -4 (mod 10)
  • +17 ≡ -3 (mod 10)
  • +18 ≡ -2 (mod 10)
  • +19 ≡ -1 (mod 10)
  • +20 ≡ +0 (mod 10)
  • etc.

At the end of this 20-step cycle, we are back where we started, with a number that is congruent to 0 (mod 10), and the cycle starts again.

Note that we have to go through two cycles of adding and subtracting the numbers because +5 ≡ -5 (mod 10). We count it as +5 the first time around and -5 the second time, so that it cancels out. If the modulus is odd, only one cycle is necessary.


Now let's consider the sequence of square numbers. We generate this series by starting with 0, then adding 1, then adding 3, then 5, and so on through the succession of odd natural numbers. This results in an RPS for much the same reason that the triangular series does: adding successive numbers is the modular equivalent of adding up to a certain point and then subtracting the same numbers in reverse order. Here's how it works modulo 10.
  • 0
  • +1
  • +3
  • +5
  • +7 ≡ -3 (mod 10)
  • +9 ≡ -1 (mod 10)
  • +11 ≡ +1 (mod 10)
  • +13 ≡ +3 (mod 10)
  • +15 ≡ -5 (mod 10)
  • +17 ≡ -3 (mod 10)
  • +19 ≡ -1 (mod 10)
  • etc.
As with the triangular numbers, we have to go through two cycles so that the two 5s cancel each other out. Notice that, unlike the triangular numbers, this sequence never returns to adding 0 (mod 10). That is why the triangular numbers reduced mod 10 = RPS (0136051865), while the squares are RPS (0)1496(5) -- the extra parentheses indicating that there are not two 5s in a row in the middle of the cycle, nor two 0s in a row at the end of one cycle and the beginning of the next.


Moving on to the pentagonal numbers, they are generated by starting with 0, then adding 1, then 4, then 7, then 10, and so on -- every third natural number. The pattern should be obvious by now: The sequence of n-gonal numbers is generated by starting with 0 and adding, successively, every (n - 2)th natural number, beginning with 1. Here's the generation of the pentagonal sequence modulo 10.

  • 0
  • +1
  • +4
  • +7
  • +10 ≡ +0 (mod 10)
  • +13 ≡ -7 (mod 10)
  • +16 ≡ -4 (mod 10)
  • +19 ≡ -1 (mod 10)
  • +22 ≡ +2 (mod 10)
  • +25 ≡ +5 (mod 10)
  • +28 ≡ +8 (mod 10)
  • +31 ≡ +1 (mod 10)
  • +34 ≡ +4 (mod 10)
  • +37 ≡ +7 (mod 10)
  • +40 ≡ +0 (mod 10)
  • +43 ≡ -7 (mod 10)
  • +46 ≡ -4 (mod 10)
  • +49 ≡ -1 (mod 10)
  • +52 ≡ -8 (mod 10)
  • +55 ≡ -5 (mod 10)
  • +58 ≡ -2 (mod 10)
  • +61 ≡ +1 (mod 10)
  • etc.
The cycle here is more involved because we are adding every third natural number, which means that after we reach the -1 which cancels out the original +1, we do not go on to either - or +1 and the cycle does not yet begin anew.



Skipping hexagonal numbers for the time being, let's jump straight to what we're really interested in: the heptagonal numbers -- the only figurate numbers yet examined which do not yield an RPS when reduced modulo 10. In keeping with the pattern, the heptagonal numbers are generated by adding, successively, every 5th natural number -- yielding, modulo 10:

  • 0
  • +1
  • +6
  • +11 ≡ +1 (mod 10)
  • +16 ≡ +6 (mod 10)
  • +21 ≡ +1 (mod 10)
  • +26 ≡ +6 (mod 10)
  • +31 ≡ +1 (mod 10)
  • +36 ≡ +6 (mod 10)
  • etc.
As can be seen, we just continue adding 1 and 6 (or subtracting 9 and 4) forever. This gives us a repeating cycle with a period of 20 -- because 10(1 + 6) ≡ 0 (mod 10) -- but no palindrome is created because we never reach -1/+9 or -6/+4.


My tentative conclusion is that the sequence of (non-centered) n-gonal numbers reduced modulo k will always be an RPS if n - 2 and k are relatively prime. When that condition holds, adding every (n - 2)th natural number in succession will (I think) mean in hitting all possible modular values, resulting in an RPS. The triangular numbers are a special case because for that sequence n - 2 = 1, which is coprime to every integer.

Where n - 2 and k are not coprime, an RPS may result, but not necessarily. I need to think a little more about what exactly determines which such sequences are RPSs and which are not.

No comments:

Knowledge is baking powder, France is baking.

Last night (the night of April 17), I visited Engrish.com , a site I used to check fairly regularly but hadn't been to in, oh, years pro...