Gapful numbers: Difference between revisions
Content deleted Content added
m →{{header|Phix}}: added syntax colouring the hard way |
Drkameleon (talk | contribs) Added Arturo implementation |
||
Line 82: | Line 82: | ||
First 10 gapful numbers ≥ 1,000,000,000: |
First 10 gapful numbers ≥ 1,000,000,000: |
||
1.0E+9 1.000000001E+9 1.000000005E+9 1.000000008E+9 1.00000001E+9 1.000000016E+9 1.00000002E+9 1.000000027E+9 1.00000003E+9 1.000000032E+9"</lang> |
1.0E+9 1.000000001E+9 1.000000005E+9 1.000000008E+9 1.00000001E+9 1.000000016E+9 1.00000002E+9 1.000000027E+9 1.00000003E+9 1.000000032E+9"</lang> |
||
=={{header|Arturo}}== |
|||
<lang rebol>gapful?: function [n][ |
|||
s: to :string n |
|||
divisor: to :integer (first s) ++ last s |
|||
0 = n % divisor |
|||
] |
|||
specs: [100 30, 1000000 15, 1000000000 10, 7123 25] |
|||
loop specs [start,count][ |
|||
print "----------------------------------------------------------------" |
|||
print ["first" count "gapful numbers starting from" start] |
|||
print "----------------------------------------------------------------" |
|||
i: start |
|||
took: 0 |
|||
while [took < count][ |
|||
if gapful? i [ |
|||
prints i |
|||
prints " " |
|||
took: took + 1 |
|||
] |
|||
i: i + 1 |
|||
] |
|||
print "\n" |
|||
]</lang> |
|||
{{out}} |
|||
<pre>---------------------------------------------------------------- |
|||
first 30 gapful numbers starting from 100 |
|||
---------------------------------------------------------------- |
|||
100 105 108 110 120 121 130 132 135 140 143 150 154 160 165 170 176 180 187 190 192 195 198 200 220 225 231 240 242 253 |
|||
---------------------------------------------------------------- |
|||
first 15 gapful numbers starting from 1000000 |
|||
---------------------------------------------------------------- |
|||
1000000 1000005 1000008 1000010 1000016 1000020 1000021 1000030 1000032 1000034 1000035 1000040 1000050 1000060 1000065 |
|||
---------------------------------------------------------------- |
|||
first 10 gapful numbers starting from 1000000000 |
|||
---------------------------------------------------------------- |
|||
1000000000 1000000001 1000000005 1000000008 1000000010 1000000016 1000000020 1000000027 1000000030 1000000032 |
|||
---------------------------------------------------------------- |
|||
first 25 gapful numbers starting from 7123 |
|||
---------------------------------------------------------------- |
|||
7125 7140 7171 7189 7210 7272 7275 7280 7296 7350 7373 7420 7425 7474 7488 7490 7560 7575 7630 7632 7676 7700 7725 7770 7777</pre> |
|||
=={{header|AutoHotkey}}== |
=={{header|AutoHotkey}}== |