All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Armstrong plus one : Armstwo (Posted on 2021-12-27) Difficulty: 3 of 5
An Armstrong number is a positive integer that equals the sum of M-th powers of their digits when the number is M-digit long.
153 is an Armstrong number, since: 13+53+33=153.
Sloane's A005188 has an article on this, in which inter-alia it is mentioned that the sequence of Armstrong numbers terminates at the 88th term.

An Armstwo number is a base ten, M-digit long positive integer which is equal to the sum of M-th powers of one greater than each of the digits.
For example, if we check for 153, we find that:
23+63+43= 288, which is NOT equal to 153.

Determine the smallest Armstwo number.

**** Heartfelt thanks to Larry for inspiring this puzzle.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Solution | Comment 1 of 3
A sincere "you're welcome" and many thanks to K Sengupta for inspirational credit.

I tested integers up to 10^7 and only found three solutions, the smallest being 141.

{141, 251, 560} is the set of solutions I found.

here is my Python code (I included a function to test for Armstrong numbers as a warm-up to testing for Armstwo numbers)

--------------
def isArmstrong(n):
    digits = list(str(n))
    power = len(digits)
    ans = 0
    for d in digits:
        ans += int(d)**power
    return ans == n

def isArmstwo(n):
    digits = list(str(n))
    power = len(digits)
    ans = 0
    for d in digits:
        ans += (int(d)+1)**power
    return ans == n

big = 10000000
count = 0
for i in range(big):
    if isArmstwo(i):
        print(i, 'is an Armstwo number')
        count += 1
print(count)
--------------
Output:
141 is an Armstwo number
251 is an Armstwo number
560 is an Armstwo number
3

  Posted by Larry on 2021-12-27 10:35:31
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (17)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information