Deceptive numbers: Difference between revisions

Content added Content deleted
(LFE version)
m (Fixed bug in primality check (was reporting 4141 as prime))
Line 363: Line 363:
(cond
(cond
((=:= j (byte_size wheel))
((=:= j (byte_size wheel))
(prime? n d 2 wheel))
(prime? n d 3 wheel))
((> (* d d) n)
((> (* d d) n)
'true)
'true)
Line 387: Line 387:
#(ok deceptives)
#(ok deceptives)
lfe> (lfe_io:format "~w~n" (list (deceptives 10)))
lfe> (lfe_io:format "~w~n" (list (deceptives 10)))
(91 259 451 481 703 1729 2821 2981 3367 5461)
(91 259 451 481 703 1729 2821 2981 3367 4141)
ok
ok
</pre>
</pre>

=={{header|Mathematica}}/{{header|Wolfram Language}}==
=={{header|Mathematica}}/{{header|Wolfram Language}}==
<syntaxhighlight lang="mathematica">ClearAll[DeceptiveNumberQ]
<syntaxhighlight lang="mathematica">ClearAll[DeceptiveNumberQ]