Forbidden numbers: Difference between revisions

Content added Content deleted
(julia example)
Line 462: Line 462:
end
end


for fbmax in [500, 5000, 50_000, 500_000]
for fbmax in [500, 5000, 50_000, 500_000, 500_000_000]
println("\nThere are $(sum(x <= fbmax for x in f500M)) forbidden numbers <= $fbmax.")
println("\nThere are $(sum(x <= fbmax for x in f500M)) forbidden numbers <= $fbmax.")
end
end
</syntaxhighlight>{{out}} Same as Python.
</syntaxhighlight>{{out}}
<pre>
7 15 23 28 31 39 47 55 60 63
71 79 87 92 95 103 111 112 119 124
127 135 143 151 156 159 167 175 183 188
191 199 207 215 220 223 231 239 240 247
252 255 263 271 279 284 287 295 303 311

There are 82 forbidden numbers <= 500.

There are 831 forbidden numbers <= 5000.

There are 8330 forbidden numbers <= 50000.

There are 83331 forbidden numbers <= 500000.

There are 83333328 forbidden numbers <= 500000000.
</pre>


=={{header|Nim}}==
=={{header|Nim}}==