Jump to content

Eban numbers: Difference between revisions

Added Quackery.
(→‎{{header|Vlang}}: Rename "Vlang" in "V (Vlang)")
(Added Quackery.)
Line 2,177:
Run time in seconds: 1134.289519125
</pre>
 
=={{header|Quackery}}==
 
<syntaxhighlight lang="Quackery">
[ 20 /mod
4 /mod
[ table 0 2 4 6 ]
swap
[ table 0 30 40 50 60 ]
+
over 0 = iff
nip done
swap
recurse 1000 * + ] is n->eban ( n --> n )
 
[] 1
[ dup n->eban
dup 10000001 < while
swap dip join
1+ again ]
2drop
dup dup
say "eban numbers up to and including 1000:"
cr
findwith [ 1000 > ] [ ]
split drop dup echo cr
say "count: " size echo
cr cr
say "eban numbers between 1000 and 4000 (inclusive):"
cr
dup dup
findwith [ 999 > ] [ ]
split nip
dup
findwith [ 4001 > ] [ ]
split drop dup echo cr
say "count: " size echo
cr cr
say "number of eban numbers up to and including 10000: "
dup findwith [ 10001 > ] [ ]
echo
cr cr
say "number of eban numbers up to and including 100000: "
dup findwith [ 100001 > ] [ ]
echo
cr cr
say "number of eban numbers up to and including 1000000: "
dup findwith [ 1000001 > ] [ ]
echo
cr cr
say "number of eban numbers up to and including 10000000: "
findwith [ 10000001 > ] [ ]
echo</syntaxhighlight>
 
{{out}}
 
<pre>eban numbers up to and including 1000
[ 2 4 6 30 32 34 36 40 42 44 46 50 52 54 56 60 62 64 66 ]
count: 19
 
eban numbers between 1000 and 4000 (inclusive):
[ 2000 2002 2004 2006 2030 2032 2034 2036 2040 2042 2044 2046 2050 2052 2054 2056 2060 2062 2064 2066 4000 ]
count: 21
 
number of eban numbers up to and including 10000: 79
 
number of eban numbers up to and including 100000: 399
 
number of eban numbers up to and including 1000000: 399
 
number of eban numbers up to and including 10000000: 1599</pre>
 
=={{header|Raku}}==
1,462

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.