A Narcissistic 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 a Narcissistic 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 Narcissistic numbers terminates at the 88th term.
A Cerossistic number is a base ten M-digit long positive integer which is equal to the sum of M-th powers of one less than each of the digits.
For example, if we check for 371 we find that:
23+63+03 = 224, which is NOT equal to 371.
Determine the smallest Cerossistic number.
Note: No Cerossistic number can admit of the digit zero.
for i=1:100000000
n=char(string(i)); t=0;
p=length(n);
t=sum((n-49).^p);
if t==i
disp(i);
end
end
finds
26
126
217
729
4193
134068
10875747
24228197
so the smallest is 26.
The prohibition on zero was not programmed into the algorithm, explaining the inclusion of 134068. It's included on the list as
0^6 + 2^6 + 3^6 + (-1)^6 +5^6 + 7^6 = 134068
and likewise for 10875747, but this doesn't affect the fact that 26 is the smallest.
|
Posted by Charlie
on 2023-01-05 10:14:00 |