Find a number m such that 2m and the square of m have the same digit sum - MATLAB Cody - MATLAB Central

Problem 58013. Find a number m such that 2m and the square of m have the same digit sum

Difficulty:Rate
The number m = 29 has the property that 2m = 58 and m^2 = 841 have the same digit sum. It is the seventh number, including zero, in the sequence of numbers with that property.
Write a function to find the nth term in the sequence, where n can be a vector.

Solution Stats

53.85% Correct | 46.15% Incorrect
Last Solution submitted on Jul 28, 2025

Problem Comments

Solution Comments

Show comments
Join Cody Contest 2025 — Have Fun and Win Prizes!
...
We’re excited to invite you to Cody Contest 2025! 🎉 Pick a team,...

Problem Recent Solvers6

Suggested Problems

More from this Author314

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!