Gapful numbers: Difference between revisions

Added Easylang
imported>Md1frejo
(Added Easylang)
 
(2 intermediate revisions by one other user not shown)
Line 1,501:
See [https://rosettacode.org/wiki/Gapful_numbers#Pascal Pascal].
 
== ==<nowiki>{{header|ElixirEasyLang}}</nowiki>== ==
<syntaxhighlight>
func gapful n .
m = n
l = n mod 10
while m >= 10
m = m div 10
.
return if n mod (m * 10 + l) = 0
.
proc show n gaps . .
print "First " & gaps & " gapful numbers >= " & n
while inc < gaps
if gapful n = 1
write n & " "
inc += 1
.
n += 1
.
print ""
print ""
.
show 100 30
show 1000000 15
show 1000000000 10
</syntaxhighlight>
{{out}}
<pre>
First 30 gapful numbers >= 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 >= 1000000
1000000 1000005 1000008 1000010 1000016 1000020 1000021 1000030 1000032 1000034 1000035 1000040 1000050 1000060 1000065
 
First 10 gapful numbers >= 1000000000
1000000000 1000000001 1000000005 1000000008 1000000010 1000000016 1000000020 1000000027 1000000030 1000000032
</pre>
 
=={{header|Elixir}}==
<syntaxhighlight lang="elixir">
def gapful(st,se,n) do
Line 1,507 ⟶ 1,545:
Enum.take(gp,n)
end
iex(2)> Rosetta.gapful(101,500,30)
[105, 108, 110, 120, 121, 130, 132, 135, 140, 143, 150, 154, 160, 165, 170, 176,
1,983

edits