# The magic number 376

376 is a magic number! When we raise it to some integer power then the result always ends in 376:

$$376^2 = 141376$$

$$376^3 = 53157376$$

$$376^4 = 19987173376$$

$$376^5 = 7515177189376$$

$$376^6 = 2825706623205376$$

$$376^7 = 1062465690325221376$$

...

Why is this so? Can you find another 3-digit number with this property?

This is because

$$376\times 376\equiv 376\pmod{1000}$$, and hence any two numbers ending $$\dots376$$ will have a product that ends in $$376$$. Equivalently, $$k=376$$ is such that $$k(k-1)$$ is a multiple of $$1000$$: one factor is divisible by $$2^3$$ and the other by $$5^3$$.

To find another number with this property,

we need to swap the two factors, so $$k$$ is a multiple of $$125$$ and $$k-1$$ is a multiple of $$8$$. The solution (unique by Chinese remainder theorem) is $$k=625$$.

• Surely you could, in theory, mix and match the factors of 2 and 5 too; it's just that it's pretty hard to find two consecutive numbers that are both multiples of 2, or both multiples of 5. :-)
– Bass
Jun 7 at 14:21
• Great answer! Well done. Jun 7 at 14:43
• Note that the other solution is easily found by $0\equiv k(k-1)\equiv (-k)(-k+1)\equiv l(l-1) \mod 1000$ where $l:\equiv 1-k\mod 1000$. Jun 7 at 15:01
• @loopywalt that's really neat actually! $𝑙=1000+1-𝑘$. It also extends to larger numbers. I would add that as another answer Jun 7 at 15:24
• "one factor is divisible by 8 and the other by 125" Good answer, but this is a bit shortsighted, you are missing that both factors can be on the same side, giving 2 other numbers: 000 and 001. That both are to be discarded because they are not 3 digit numbers (assuming leading zeros are not allowed) should be mentioned i.m.o. Jun 8 at 5:56

This pattern goes much further - if I remember rightly, there are two separate sequences (and allowing numbers to have leading zeros, to fill in some gaps):

5^n ends in 5; 25^n ends in 25; 625^n ends in 625; (0)625^n ends in 0625; 90625^n ends in 90625 ...

6^n ends in 6; 76^n ends in 76; 376^n ends in 376; 9376^n ends in 9376; ...

I believe these two sequences are unique, and there's also the very attractive connection:

5 + 6 = 11; 25 + 76 = 101; 625 + 376 = 1001; (0)625 + 9376 = 10001, ...

• They are indeed unique. The sequences are in here oeis.org/A003226 Jun 8 at 11:25
• If you define addition and multiplication in a sensible way on left-infinite strings of digits (there must be a better name for them than that!), then there are two such entities .A = ...625 and B = ...376 such that A^n = A, B^n = B for all n and A + B = A^n + B^n = 1 = 1^n. This was the basis of Ludwig Plutonium's "disproof" of Fermat's Last Theorem, but of course A and B are not natural numbers! Jun 8 at 13:12
• I think these are 10-adic numbers. Jun 8 at 13:40