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

Home > Just Math
Dudeney minus one: Dudezero (Posted on 2022-02-01) Difficulty: 3 of 5
Sloane's A046459 has an article on Dudeney numbers, which are integers equal to sum of the digits of their cubes.
For example: 183=5832, and 5+8+3+2=18. Accordingly, 18 is a Dudeney number.
The said article lists 0,1,8,18,26, and 27 as all possible Dudeney numbers.

A Dudezero number is a base 10 nonnegative integer the digits of whose cubes are each reduced by 1 and the said integer is equal to the sum of transformed digits.
For example, 5 is a Dudezero number, since: 53=125, and:
(1-1)+(2-1)+(5-1)=5

Determine all possible Dudezero numbers.

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 (spoiler) | Comment 1 of 6
for n=1:10000
   cube=n^3;
   cubestr=char(string(cube));
   tot=sod(cube)-length(cubestr);
   if tot==n
      disp([n cube]) 
   end
end

finds the given 125 and only two others:

     n   n^3
     
     5   125
     6   216
     7   343
     
Testing to 10000 was overkill, but clearly any larger number would result in 12-digit or higher numbers, which the sum of 12 single-digit numbers couldn't reach.     

The function sod() is in the path and defined as:

function sd = sod(n) 
    s=0;
    dgts=num2str(n) ;
    l=length(dgts) ;
    for i=1:l
        s=s+str2double(dgts(i));
    end
    sd=s;
end

  Posted by Charlie on 2022-02-01 07:56:48
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