How to resolve the algorithm Super-d numbers step by step in the Quackery programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Super-d numbers step by step in the Quackery programming language
Table of Contents
Problem Statement
A super-d number is a positive, decimal (base ten) integer n such that d × nd has at least d consecutive digits d where For instance, 753 is a super-3 number because 3 × 7533 = 1280873331.
Super-d numbers are also shown on MathWorld™ as super-d or super-d.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Super-d numbers step by step in the Quackery programming language
Source code in the quackery programming language
[ over findseq swap found ] is hasseq ( [ x --> b )
[ [] swap
[ 10 /mod
rot join swap
dup 0 = until ]
drop ] is digits ( n --> [ )
[ over ** over * digits
swap dup of hasseq ] is superd ( n --> b )
[] 5 times
[ [] 1 from
[ i^ 2 + index
superd if [ index join ]
dup size 10 = if end ]
nested join ]
witheach
[ i^ 2 + echo say " -> " echo cr ]
You may also check:How to resolve the algorithm Munching squares step by step in the AWK programming language
You may also check:How to resolve the algorithm Exceptions step by step in the Forth programming language
You may also check:How to resolve the algorithm Unicode variable names step by step in the Pike programming language
You may also check:How to resolve the algorithm Dot product step by step in the Picat programming language
You may also check:How to resolve the algorithm Knapsack problem/0-1 step by step in the J programming language