Digit fifth powers: Difference between revisions
Content added Content deleted
m (→{{header|Sidef}}: go up to 8) |
(PicoLisp version) |
||
Line 1,145: | Line 1,145: | ||
</pre> |
</pre> |
||
=={{header|PicoLisp}}== |
|||
<lang PicoLisp> |
|||
(de sum5th (N) |
|||
(sum |
|||
'((D) (** (format D) 5)) |
|||
(chop N))) |
|||
(setq solutions |
|||
(cdr # exclude 1 |
|||
(make |
|||
(for N `(* 6 (** 9 5)) |
|||
(when (= N (sum5th N)) |
|||
(link N)))))) |
|||
(prinl "The numbers that can be written as the sum of the 5th power of their digits are:" ) |
|||
(prin " ") (println solutions) |
|||
(prinl "Their sum is " (apply + solutions)) |
|||
(bye) |
|||
</lang> |
|||
{{Out}} |
|||
<pre> |
|||
The numbers that can be written as the sum of the 5th power of their digits are: |
|||
(4150 4151 54748 92727 93084 194979) |
|||
Their sum is 443839 |
|||
</pre> |
|||
=={{header|PILOT}}== |
=={{header|PILOT}}== |
||
<lang pilot>C :max=9*(9*(9*(9*(9*6)))) |
<lang pilot>C :max=9*(9*(9*(9*(9*6)))) |