Here’s a neat problem from Patrick Vennebush of Math Jokes 4 Mathy Folks:

Append the digit 1 to the end of every triangular number. For instance, from 3 you’d get 31, and from 666 you’d get 6,661. Now take a look at all of the divisors of the numbers you’ve created. What are the units digits of the divisors for every number created in this way? Can you prove that this result always holds?

Just for fun I have dubbed these numbers — the ones you get by appending a unit to triangular numbers — the *triangunit* numbers. I’ve found a pattern and even checked it for the first 10,000 triangular numbers using a computer, but so far a proof has eluded me!

By the way, the triangunit numbers are sequence A062786 in the Online Encyclopedia of Integer Sequences, but that page contains a spoiler (I think, I didn’t read it) so don’t peek if you want to figure it out yourself!

The triangular numbers are T(n) = n(n+1)/2

The traingunit numbers are A(n) = 10(T(n))+1

A(n) = 10(n(n+1)/2)+1 = 5n(n+1) + 1 = 5n^2 + 5n + 1

All divisors of A(n) are congruent to 1 or -1, modulo 10; that is, they end in the decimal digit 1 or 9.

MathPhan: You have indeed found the right pattern. I deleted your proof since you obviously just copied and pasted it from the OEIS page, and that proof needs a lot of expanding/explaining anyway.

Hi Brent,

Here is my first attempt at a partial proof—which I assure you is independent of the OEIS page since I don’t know what that is.

As MathPhan notes, the triangunit numbers look like 5n^2 + 5n + 1. One notices that the divisors all seem to end in 1 or 9. So let’s assume we could find a combination of factors *3 and *7 whose product is of the form of a triangunit number. We could write these numbers as u*10^s + 3 and v*10^t + 7 where s, t are positive integers.

Multiplying we get:

5n^2 + 5n + 1 = (u*10^s + 3)(v*10^t + 7) = uv*10^(s+t) + 7u*10^s + 3v*10^t + 21.

Subtracting 1 and dividing by 5 gives:

n^2 + n = (2uv)*10^(s+t-1) + (14u)*10^(s-1) + (6v)*10^(t-1) + 4

Case 1: s, t> 1

In this case, the right hand side is congruent to 4 modulo 10 (since 10 divides the first three terms. However, n^2 + n always ends in 0, 2 or 6. This gives a contradiction.

Case 2: s = t = 1

This case—presumably—cannot occur as an exhaustive computer search (that I can’t perform now) will show. Simply check that all 81 products of pairs of two-digit numbers that end with 3 and 7, respectively, cannot be written as as product of two consecutive positive integers.

Case 3: s = 1 XOR t = 1

This I don’t see yet how to resolve.

So, essentially, I can prove that if a triangunit number has a factor ending in 3 or 7, then one of the factors must have only two digits.

Adam: if such a number has a factor ending in 3 or 7, then both factors end in 3 or 7. So your case 3 reduces to checking that none of 13, 17, 23, 27, …, 97 can be a factor of 5n^2 + 5n + 1 — or, alternatively, that 5n^2 + 5n + 1 mod k is never zero, for any of k = 13, 17, …, 97. But this only requires checking 5n^2 + 5n + 1 is not a multiple of k for any of n = 1, 2, …, k — so we only have to check finitely many possibilities. Certainly it’s inelegant, but it works.

As for the OEIS solution, it looks like the proof given there can be fleshed out using standard results one would learn in a first number theory course, although my first and only number theory course was quite some years ago.

Nice, Adam and Michael, thanks for the analysis. And (as if we didn’t already know) the required check indeed works out:

I do hope to understand the OEIS proof and write up a less telegraphic explanation of it, if no one else does.

I found the OEIS proof (due to Nick Hobson) and I think I get it.

First, we only need to consider prime divisors since if they all end in 1 or 9, their products will all end in 1 or 9. So let p be an odd prime dividing 5n^2 + 5n + 1. We see that p is not 5 since 5 does not divide 5n^2 + 5n + 1. In order to complete the square, we multiply by 4*5=20 and see that p must also divide 20(5n^2 + 5n + 1) = 100n^2 + 100n + 20 = 25(4n^2 + 4n + 1) – 5 = 25(2n-1)^2 – 5. Hence 25(2n-1)^2 is congruent to 5 modulo p. More importantly, 5 is a square modulo p. As p and 5 are relatively prime and 5 is congruent to 1 modulo 4, the law of quadratic reciprocity implies that p is also a square modulo 5, i.e., that p is congruent to 1 or 4 modulo 5. This implies that the last digit of p is 1,4,6 or 9. But p is odd, so the last digit must be 1 or 9.

Ah, I see now, thanks Adam. For some reason I never encountered quadratic reciprocity in any of my courses and although I’ve seen it a few times since then I can never remember what it actually is. Maybe now I will remember!

Pingback: Triangunit divisors and quadratic reciprocity | The Math Less Traveled

Pingback: Triangunit divisors and quadratic reciprocity | The Math Less Traveled