I was solving some very basic coding questions. I came across a problem - “Find if a given number is an Armstrong Number”
Now me being as ignorant as I am , I didn’t know what they were. I did a bit of digging to understand them, and I found some very interesting things.
But before that….
What are Armstrong Numbers?
Say you have a number with the count of digits n, and you raise each of the digits to the nth power, and sum it up. You get back the number itself.
Let’s understand this with an example.
We take the number 153. The count of the digit is 3.
That means,
which is the same as the number itself.
Therefore , 153 is an Armstrong Number.
Some Interesting Things About Them!
Having learnt what armstrong numbers are , I got fascinated by them and started digging again.
And it turns out that there are only 89 armstrong numbers in total!
And how do we know that?
Because it has been proven that there are no Armstrong numbers with more than 39 digits.
And how did we prove that?
Well I don’t know or understand the proof yet, but once I do, I’ll get back. But there is a proof.
The largest armstrong number is 115,132,219,018,763,992,565,095,597,973,971,522,401 having 39 digits!
I wrote a code to check the armstrong numbers between 1,1000 and I noticed something special.
370 and 371 are both armstrong numbers. So on my quest to find other pairs of consecutive armstrong numbers, I found out that consecutive armstrong numbers are very rare and that there are only 9 pairs in total. The smallest being 370 and 371 , the biggest being 115,132,219,018,763,992,565,095,597,973,971,522,400 and 115,132,219,018,763,992,565,095,597,973,971,522,401.
Now try finding some of the other armstrong numbers yourself and with that also some of the 9 pairs of consecutive armstrong numbers (Use code! and even with code , only go up to a certain range, or else you might need to keep your computer running forever to find them all!)
That’s it for today, happy learning!