Casting out nines: Difference between revisions
→{{header|Common Lisp}}
Basicgames (talk | contribs) |
|||
Line 513:
36 potential Kaprekar numbers remain (~87.50% filtered out).
(1 16 17 32 33 48 49 64 65 80 ...)</pre>
=={{header|Craft Basic}}==
<syntaxhighlight lang="basic">define base = 10, c1 = 0, c2 = 0, k = 1
for k = 1 to base ^ 2
let c1 = c1 + 1
if k % (base - 1) = (k * k) % (base - 1) Then
let c2 = c2 + 1
print k
endif
Next k
print "trying ", c2, " numbers instead of ", c1, " numbers saves ", 100 - (100 * c2 / c1), "%"
end</syntaxhighlight>
=={{header|D}}==
{{trans|Python}}
|