23 lines
530 B
Text
23 lines
530 B
Text
(() 0 shorten) :new
|
|
(((10 mod) (10 div)) cleave) :moddiv
|
|
((dup 0 ==) (pop new) 'moddiv 'cons linrec) :digits
|
|
(digits ((last 10 *) (first +)) cleave) :flnum
|
|
(mod 0 ==) :divisor?
|
|
(dup flnum divisor?) :gapful?
|
|
|
|
(
|
|
:target :n 0 :count
|
|
"$1 gapful numbers starting at $2:" (target n) => % puts!
|
|
(count target <) (
|
|
(n gapful?) (
|
|
count succ @count
|
|
n print! " " print!
|
|
) when
|
|
n succ @n
|
|
) while
|
|
newline
|
|
) :show-gapfuls
|
|
|
|
100 30 show-gapfuls newline
|
|
1000000 15 show-gapfuls newline
|
|
1000000000 10 show-gapfuls
|