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

Home > Logic
Positive Integer and Power Puzzle (Posted on 2015-08-10) Difficulty: 3 of 5
N is a 6-digit positive integer whose sum of digits is 43.
Determine N, given that precisely one of the following statements is false:
  1. N is a perfect square
  2. N is a perfect cube
  3. N < 500000

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 computer solution Comment 2 of 2 |
The following Python program finds:  499849
as the sole solution

def sod(n):
    """ Input an integer.  Returns the Sum of the Digits  """
    aList = list(str(n))
    ans = 0
    for c in aList:
        ans = ans + int(c)
    return ans

for n in range(100000,1000000):
    if sod(n) != 43:
        continue
    score = 0
    if round(n**(1/2))**2 == n:
        score += 1
    if round(n**(1/3))**3 == n:
        score += 1
    if n < 500000:
        score += 1
    if score == 2:
        print (n)
  Posted by Larry on 2020-07-06 07:12:55
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (12)
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