# This Unusual Year

Our current year, 2021, has the unusual property that the digital sum (the sum of the digits) of its square is precisely equal to its digital sum squared. Indeed: 2021^2 = 4,084,441, whose digital sum is 25 (=4+0+8+4+4+4+1), which is the square of this year's digital sum.

When were the last ten times it happened that the digital sum of the square of the year was precisely equal to that very same year's digital sum squared?

When will the next ten such years be?

• 3 answers at the same time... Oct 10, 2021 at 1:08

The three other answers have already listed the correct years. What I'd like to add is a clean way of finding them:

Writing $$d(x)$$ for the digit sum of $$x$$ it is easily verified that

$$d(x^2) \leq d(x)^2$$ with equality if and only if there is no carry.

Indeed, expanding $$d(x)^2$$ yields

$$x_1^2+x_2^2+x_3^2+\ldots+2x_1x_2+2x_1x_3+\ldots$$ where $$x_1$$ is the first digit, $$x_2$$ the second and so forth

Doing the long multiplication $$z=x^2$$ yields (if there is no carry) the digits $$z_1 = x_1^2 \quad z_2 = 2x_1x_2 \quad z_3 = x_2^2 + 2x_1x_3$$ etc. and the proof can be completed by checking terms.

As carry always reduces the digit sum the converse also follows.

From this a number of simple but useful rules follow:

The only viable digits are

0,1,2,3

Further,

There can be at most one 3 and if there is there can be no 2's, nor can the 3 be flanked by two nonzeros.

Three consecutive 2's are not allowed, in fact, the sum of neighbours of a 2 cannot exceed 3.

The sum of all four digits cannot exceed 6. By the above rules the only combination left to check would be three 2's, one 1 which always triggers a carry in $$z_4$$.

More rules could be derived but the ones we have suffice to whittle the possible years down to a very manageable number.

• I solved it this way. Not simply bruteforcing is always a bonus. Oct 10, 2021 at 13:05

For the last ten times that this has happened, they are:

2020
2012
2011
2010
2002
2001
2000
1301
1300
1220

The next ten years are going to be:

2022
2100
2101
2102
2110
2111
2120
2121
2200
2201

My thinking process:

In theory, the digit sums of the numbers cannot go over $$7$$, as $$7^2$$ is still possible. For example, the number might be $$7,777,777$$, but that is not possible, even in the 2200's. So, out of all the numbers, we can eliminate many of the numbers. For the last ten times, I started from 2020, which had a digit sum of 4, and went straight to 2012, because any other number from 2020-2012 was not possible, because of the digit sums were more than 7. With that in mind, I then continued to go down towards 1300, as any number with 1900's digit sum is 10, which as we have said before, not possible.

The same likewise goes towards the next ten category, we can eliminate many numbers just because their digit sum goes above 7. Another note to make is that I did this all by hand.

Going down:

For a positive integer $$n$$, let $$s(n)$$ denote the sum of its digits.

For any $$x < 2021$$, we will have $$x^2 \leq 2020^2 < 10^7$$ which means that $$s(x^2) \leq 9 \times 7 = 63$$.

Therefore, if we have $$s(x^2) = s(x)^2$$, then necessarily $$s(x) \leq 7$$.

Now just listing out all numbers $$x$$ with $$s(x) \leq 7$$, in descending order from $$2020$$, testing each of them until we get ten.

The answer is: 2020, 2012, 2011, 2010, 2002, 2001, 2000, 1301, 1300, 1220

Below are all the numbers being tested. There are $$38$$ numbers in total.

2020, 2014, 2013, 2012, 2011, 2010, 2005, 2004, 2003, 2002, 2001, 2000, 1600, 1510, 1501, 1500, 1420, 1411, 1410, 1402, 1401, 1400, 1330, 1321, 1320, 1312, 1311, 1310, 1303, 1302, 1301, 1300, 1240, 1231, 1230, 1222, 1221, 1220

Going up:

Same strategy, assuming that the results don't exceed $$3000$$ (which is verified a posteriori).

The answer is: 2022, 2100, 2101, 2102, 2110, 2111, 2120, 2121, 2200, 2201

A total of $$25$$ numbers are tested:

2022, 2023, 2030, 2031, 2032, 2040, 2041, 2050, 2100, 2101, 2102, 2103, 2104, 2110, 2111, 2112, 2113, 2120, 2121, 2122, 2130, 2131, 2140, 2200, 2201

• 3 answer sniped :) Oct 10, 2021 at 1:08

I don't know how to do this without a computer, but with a computer, I found the next ten such years to be

2022, 2100, 2101, 2102, 2110, 2111, 2120, 2121, 2200, 2201

The previous ten years with the property were

2020, 2012, 2011, 2010, 2002, 2001, 2000, 1301, 1300, 1220

I find it interesting that

We are in the middle of a streak of 3 such years. And that there was a big gap from 1301 to 2000.

• 3 answer sniped :) Oct 10, 2021 at 1:08
• But when are the next ten times that will happen? Oct 10, 2021 at 1:09
• Never... 3 answer snipes are very rare. Oct 10, 2021 at 1:10