Digital root/Multiplicative digital root: Difference between revisions
Content added Content deleted
m (→{{header|Go}}: add some examples with high MP) |
(Updated D entries) |
||
Line 316: | Line 316: | ||
writefln("%6d: (%s, %s)", n, n.mdRoot[]); |
writefln("%6d: (%s, %s)", n, n.mdRoot[]); |
||
auto table = |
auto table = (int[]).init.repeat.enumerate!int.take(10).assocArray; |
||
auto n = 0; |
auto n = 0; |
||
while (table.byValue.map!walkLength.reduce!min < 5) { |
while (table.byValue.map!walkLength.reduce!min < 5) { |
||
Line 372: | Line 372: | ||
writefln("%6d: (%s, %s)", n, n.mdRoot[]); |
writefln("%6d: (%s, %s)", n, n.mdRoot[]); |
||
auto table = |
auto table = (int[]).init.repeat.enumerate!int.take(10).assocArray; |
||
auto n = 0; |
auto n = 0; |
||
while (table.byValue.map!walkLength.reduce!min < 5) { |
while (table.byValue.map!walkLength.reduce!min < 5) { |
||
Line 410: | Line 410: | ||
writefln("%6d: %s", n, n.mdRoot); |
writefln("%6d: %s", n, n.mdRoot); |
||
auto table = |
auto table = (int[]).init.repeat.enumerate!int.take(10).assocArray; |
||
auto n = 0; |
auto n = 0; |
||
while (table.byValue.map!walkLength.reduce!min < 5) { |
while (table.byValue.map!walkLength.reduce!min < 5) { |