Anonymous user
Digital root/Multiplicative digital root: Difference between revisions
Digital root/Multiplicative digital root (view source)
Revision as of 23:11, 3 May 2014
, 10 years ago→untra-fast version: optimized for a MDR of seven.
m (→untra-fast version: expanded the target to 25.) |
m (→untra-fast version: optimized for a MDR of seven.) |
||
Line 584:
say '═══ ' copies("═",10+(target+2)**2%2)
do k=0 for 10; hits=0; _= /*show #'s that have an MDR of K.*/
if k==7 then _=@7; else /*handle special seven case. */
do m=0 until hits==target /*find five #'s with an MDR of K.*/
?=right(m,1) /*obtain right-most digit of M. */
Line 599 ⟶ 601:
end /*m*/ /* [↑] built a list of MDRs = k */
say " "k': ['strip(_,,',')"]" /*display the K (mdr) and list.*/
if k==3 then @7=translate(_,7,k) /*save for later, special 7 case.*/
end /*k*/ /* [↑] done with the K mdr list.*/
exit /*stick a fork in it, we're done.*/
/*──────────────────────────────────MDR subroutine──────────────────────*/
|