Deceptive numbers: Difference between revisions

Content deleted Content added
m →‎{{header|Free Pascal}}: 1e6 from 5min -> 2 min 35 -> 1 min 10
PureFox (talk | contribs)
→‎{{header|Wren}}: As pointed out by Nigel, repunits can't be divisible by 5.
Line 301:
{{libheader|Wren-gmp}}
{{libheader|Wren-math}}
An embedded program so we can use GMP. Takes 0.021019 seconds to find the first 25 deceptive numbers.
 
The first 62 deceptive numbers (up to 97681 though not shown in full) are found in 0.179 seconds.
<lang ecmascript>/* deceptive_numbers.wren */
 
Line 313 ⟶ 315:
var deceptive = []
while (count < limit) {
if (!Int.isPrime(n) && n % 3 != 0 && n % 5 != 0) {
if (repunit.isDivisibleUi(n)) {
deceptive.add(n)