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

Home > Numbers
Distinct Powers (Posted on 2024-02-20) Difficulty: 3 of 5
How many distinct terms are in the sequence generated by a^b for integers a and b, where 2 ≤ a ≤ 100, and 2 ≤ b ≤ 100? Can you find the answer without computing the value of each a^b? (Project Euler problem #29)

See The Solution Submitted by Steven Lord    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 2 of 3 |
p=string.empty;
for a=sym(2):100
  for b=2:100
    v=a^b;
    p(end+1)=string(v);
  end
end
p=unique(p);
length(p)     

finds 9183 distinct values.

Answer to the second question:

No, I couldn't do it without actual calculation.

  Posted by Charlie on 2024-02-20 11:55:58
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 (9)
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