From a Rachinsky Quintet to a Pythagorean Triplet

About a decade ago an interesting question was asked on MathOverflow.net. It’s based on a problem appearing on the black board in a painting by the Russian painter, pedagogue and academician Nikolay Bogdanov-Belsky. The problem which intrigued peasant students in the painting has also caught the attention of users of social media.

One of the solutions to solving the problem with minimal calculations centers around the fact that 102 + 112 +122 = 132 + 142 = 365. Stringing all the squares together in a sum is really twice that sum of 365, divided by 365. So the answer is 2

But more interesting is the fact that this is an example of a Rachinsky quintet. Russian nuclear physicist, Zurab Silagadze, challenges readers to find a formula generating other sets of numbers that behave this way. After all, there is a well-known Euclidean formula that generates so-called Pythagorean triplets, which are whole numbers satisfying a2 +b2 = c2.

If you focus on 12 in the equation 102 + 112 +122 = 132 + 142, and pretend we did not know its value, we could replace it with algebra’s favorite letter x. (There is no x in the Italian alphabet, which begs the question: do algebra books in the land of sun, olives and olive-skin still teem with x’s? Of course, but I digress.) The equation would become (x – 2)2 + ( x- 1)2 + x2 = (x + 1)2 + (x + 2)2. Notice the symmetry of adding 1 and 2 to x on the right hand side of the equation and subtracting 1 and 2 on the right hand side. If we replace 1 and 2 with a and b, we will obtain:

(x – a)2 + ( x- b)2 +x2 = (x + a)2 + (x + b)2.

Simplifying and factoring, we get x( x- 4(a+ b)) = 0, which means that x can be zero or

x = 4(a+ b). To avoid redundancy, we can choose any whole number values of and b, where the greatest common divisor of a and b equals 1. So if we chose a = 1 and b=2, we would end up with x = 4(1+2)=12. And plugging all that into (x – a)2 + ( x- b)2 +x2 = (x + a)2 + (x + b)2 would yield our original 102 + 112 +122 = 132 + 142.

But if you wanted something different, we could choose a = 2 and b = 3. Then x = 20, which would generate the Rachinsky quintet, 172 + 182 + 202 = 222 + 232. Unfortunately the numbers are not all consecutive. Our first equation is the only quintet with consecutive whole numbers. But there’s hope.

We can create a septet of squares. (x – a)2 + ( x- b)2 + ( x – c)2 + x2 = (x + a)2 + (x + b)2+ ( x + c)2. This simplifies to x = 4( a + b + c). To make the numbers consecutive, we choose a = 1; b = 2; and c= 3, yielding x = 24, leading to the pretty septet: 212 + 222 + 232 + 242 = 252 + 262 + 272 = 2030.

In general, for an n number of terms that we want on the right hand side of the quintet, septet, duodectet or whatever our hearts desire, ( a + b + c+…n) =

If, for example, we wanted 6 terms on the right hand side, x = 2(6)(7) = 84 and we’d get the tredectet:

782 + 792 + 802 + 812 +822 + 832 + 842 = 852 + 862 + 872 + 882 + 892 + 902 .

Want to keep it simpler? No problem. Have only one term on the right. Then x =2n(n+1) with n=1 becomes 2(1)(1+1)= 4, leading to the classic Pythagorean triplet : 32 + 42 = 52.

Sunday reading in a village school, 1895, N. B. Belsky

To conclude with another digression, if you look at another of Belsky’s paintings (above), do you notice someone who was also present in the first painting? After Belsky’s art had been considered inappropriate in the Soviet Union, he was forced to relocate. When he fell ill in 1945, he was taken to a hospital in Berlin, which the Allies bombed, ending his life.

A Divisibility Test For Most Odd Numbers

What’s neater than any math trick is why it works. Tricks at first seem like magic, but one word that describes mathematical magic is logic. Of course, it’s magical how animals like us can have brains capable of logic, given that we can’t explain why our neurons have such potential. What’s even more astounding is, given that I get disoriented going up the stairs in my own house and that I have to use the right hand rule to figure out which way to turn a screw driver, I was able to see a pattern where there did not seem to be one. But I digress.

If you consider divisibility tests for 3, 7 or 11, you won’t really come up with a pattern. For 3, you have to add up all the digits in a number. If the sum is divisible by three, then the original is also a multiple of 3. For 11, from left to right, you have to subtract each pair of digits and add all the differences along with the leftover digit, if applicable. If the sum of those is divisible by 11, so is the original number.

Then we come to 7, and encounter another unrelated trick but one which holds the key to different divisibility tests for not only 3 and 11 but for most odd numbers. The trick to testing divisibility by 7 is to multiply the last digit by -2 and then adding the product(which is negative) to the number formed by the rest of the digits. Repeat this until you recognize a multiple of 7. If that happens, 7 divides into the original number. For example is 5523 divisible by 7? Well 3×(-2) = -6, and 552 – 6= 546. Repeat. 6×(-2)= -12. And finally, 54-12= 42, which is indeed a multiple of 7; so yes 7 divides evenly into 5523.

Why does the trick work? Let the original number = N. Let the last digit = a. After dropping the last digit, let the newly created number be represented by y. Recall that to y we added -2× a. Then to pass the test, the difference had to be a multiple of 7.

Thus y – 2a = 7w or

Now what was the original number, N? N had y,  but before stripping it of the units digit, a , it was a y-multiple of 10 plus the units number. For example before 5523 became y=552, it was 552×10, plus 3, or N = 552×10 +3. In general terms N =10y+a. Substituting for y, we get

Collecting like terms,

N = 21a + 7w

Given that 21 and 7 are each divisible by 7, regardless of the values of a and w, N will be divisible by 7 if and only if y was the sum of 2a and some multiple of 7.

Now for the “magic” key. There is a similar trick for 13, except that the last digit is not multiplied by (-2), but by 4. But the rest of the trick is the same. You add something × a to the number y created by dropping the last digit a. Then you check if that new number is a multiple of 13.

Now let’s say we did not know whether to use -2 ( as in 7’s case) or the 4, like we did for 13.

Then y +ka = T or

where k is the multiple we’ll use for the divisibility for a  number, T. So far, T would be either 7 or 13, but we’ll soon see for which other odd numbers it works.

The number we are checking to see whether it’s divisible by T is N, so as previously,

N= 10y +a. Then substituting for y

N = 10(T-ka)+a = 10T – 10ka +a = 10T + a(1-10k)

For N to be divisible by T, 10T is guaranteed not to give us a remainder when divided by T. “a”, in most cases, will be smaller than T, so for N to be divisible by T,  it’s really all up to ( 1-10k).

If we solve for k in the equation 1-10k = Tp, or

we’ll know what number to use for T depending on the divisibility test.

For example, let’s say we want to test if a number divides 19 evenly. Then

10k + 19p = 1.

An obvious solution is k= 2 and p =-1. We can only use integer values for both k and p. And if there is a common factor between 10 and T that is greater than 1, then forget about it. There won’t be any values for p and k that satisfy the equation. So this will not lead to a divisibility test of that particular value of T. But it works for any odd number that’s not a multiple of 5.

So let’s see if 2 works for divisibility by 19. Does 19 divide evenly into 14991? Well, 2×1= 2. 1499+2= 1501. Then 150 + (2×1) = 152. Finally 15 +(2× 2 )= 19, so yes. 14981 is a multiple of 19.

Now let’s return to 7. If we didn’t know k=-2, we could have solved 10k + Tp =1 for T=7,

10k + 7p= 1.

One solution is k=-2; p= 3. But a more general solution is k= -2 + 7n where n= 0,1,2, …. In other words if we had wanted to avoid using a negative number, we could have used n= 1 instead of 0, and k = -2 +7×1 = 5. First notice that k=5 with p= -7 does indeed satisfy 10k + 7p = 1. But let’s go back to testing 5523 ÷7 by using 5 in the trick instead of 2.

552 + (5×3) = 567 and 56 +(7×5)= 91 and 9 +(1×5)= 14, which is a multiple of 7.

Having two options is useful. In some cases, it won’t matter. If you want to get a k value to see if division by, say, 11 works, and use this kind of trick instead of the one where you have to subtract each pair of successive digits, you get lucky. The choices between multiplying the last digit by, either 10 or -1, are both easy to use. But for a divisibility test for 21, it’s nice to have the choice between the cumbersome 19 and the smaller -2.

Those familiar with congruence in number theory realize that obtaining k boils down to solving the congruence

10k ≡ 1 ( mod T )

For smaller values of T, the equation can easily be solved for k by inspection. For larger ones it can easily be solved using the Euclidean algorithm. Here’s a summary of the k values for T values up to 27.

TPositive kNegative k
31-2
5nonenone
75-2
91-8
1110-1
134-9
15nonenone
1712-5
192-17
2119-2
237-16
25nonenone
2719-8

What’s really funny is that after coming up with the above, I was proud of it, but I wasn’t expecting it to be something highly original. It’s just too obvious. And besides, if I could come with it, somebody else surely did. And it’s the case based on a Google Scholar search. But surprisingly, it appeared very recently in the literature, in late 2021, or at least the authors claim. They even named the test after themselves, the Frey-Hammett test. Perhaps my self-deprecation is causing me to be unfair to the authors. They do acknowledge how simple the mechanism is:

Given an odd prime p different from 5, we show how one might go about “inventing” divisibility tests for p. The simple mechanism we provide makes clear that not just one, but infinitely many divisibility tests for p arise in this way.

It doesn’t really matter. Math does not care about names any more than a rose does. Unfortunately, my name is not Math. 🙂 

The Use of an Attention Center in the Classroom

Not discussing it would indeed be a missed opportunity! In a graduate program for prospective teachers, we were encouraged to use an “attention center” to introduce or reinforce a concept in science. The strategy often works because the “attention center” piggybacks on something that is already interesting or at least familiar to most students. For example, on January 5 2024, an Alaskan Airlines flight 1282 experienced a rapid decompression when its plugged exit door separated from the airframe. As a result, a smart phone was “sucked” out of the plane. But the phone was found intact and functioning after falling from a height of 4900 meters. (Say 16000 feet if you’re teaching in the United States 🙂 )

Regarding atmospheric pressure, one can point out that the phone wasn’t really “sucked out”. Rather there is a more accurate way of looking at it. The initial higher pressure inside the plane was able to push loose objects against the lower force per unit area found in the thin atmosphere exposed by the hole in the plane. In fact, even drinking with a straw is made possible by an imbalance of forces per unit area, given that the reduced pressure inside the straw results from expanding one’s chest cavity. More volume creates less collisions per unit area within the straw, which is connected to the respiratory system by tight lips. Then the atmospheric pressure pushes the liquid up the straw and into the sucker’s mouth. All sorts of other interesting questions will arise in class such as “Why does the atmosphere thin out with rising altitude in the first place?” and ” If heat rises, why is it cold outside a flying airplane?”

Or, if one is covering ionic size or crystallization in chemistry, one can point out that manufacturers of smart phones have recently made the glass in the screen more shock-resistant. This has been achieved by replacing smaller sodium ions(Na+) in the glass with larger potassium ions(K+) by soaking the glass in a potassium nitrate(KNO3) solution. The newly arrived and larger ions then place more compressive stress on the glass, effectively strengthening it.

Image source: https://www.neg.co.jp/en/rd/topics/product-dinorex/

Once can’t go without pointing out the significant fact that the phone was found in a bush. This cushioned the blow by lengthening the time of impact. Since the product of time and force is equivalent to a fixed and conserved momentum, lengthening the time it took for the fast-moving phone to come to a complete stop lowered the force of impact. Landing parallel to the surface also distributes the force over a larger area, thus lowering the pressure experienced by the glass.

Finally, and not least importantly, phones falling from tall buildings or airplanes reach similar terminal velocities. Air friction eventually prevents a falling object from gaining more speed, and to what degree friction comes into play is affected by an object’s shape and surface to weight ratio. It’s the reason that a 1 gram penny falling on your head from the Empire State Building will hurt you but won’t have enough mass and speed to crack your skull. A 50 gram bolt or a 175 gram smart phone, on the other hand, will have slightly higher terminal velocity than the penny but they could easily kill, given that momentum, a product of both velocity and mass, matters. The writer of the Slate article consulted a physicist to obtain an estimate of the phone’s final velocity. Students without such a scientist in their social circles can consult an online terminal velocity calculator where they can enter numbers for the factors that come into play such as the phone’s mass, its cross sectional area, drag coefficient and the air’s density. ( All these factors are ignored when we assume constant acceleration and no friction). And of course coming up with the equation to plug in those variables is not a feat of algebra but of calculus.

One does not have to restrict oneself to media stories when using attention centers. The everyday world, if observed carefully, can be richer than what the media covers. Hoarfrost on windows is as beautiful to explain as it is to admire. Looking at the night sky without a telescope, one could observe the contrast between Orion’s peachy color and Rigel’s whiteness. From Wien’s Displacement Law, we know from their maximum wavelengths that the surface temperatures of Betelgeuse and Rigel are ~3300K and 12100 K, respectively. Wien’s particle in ionized gas, which years later was accepted to be a proton, is found in the Orion Nebula’s colored HII region. The different H regions and how hydrogen behaves in them is a great reminder (and a potential attention center) of how hydrogen can exist in molecular, atomic or ionic form.