Humble numbers: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (use wiki markup for links) |
|||
Line 4,471: | Line 4,471: | ||
total number of humble numbers found: 6,870,667 |
total number of humble numbers found: 6,870,667 |
||
</pre> |
|||
=={{header|Ring}}== |
|||
<lang ring> |
|||
load "stdlib.ring" |
|||
limit = 10 |
|||
numList = [] |
|||
for n2 = 0 to limit |
|||
for n3 = 0 to limit |
|||
for n5 = 0 to limit |
|||
for n7 = 0 to limit |
|||
num = pow(2,n2) * pow(3,n3) * pow(5,n5) * pow(7,n7) |
|||
add(numList,num) |
|||
next |
|||
next |
|||
next |
|||
next |
|||
numList = sort(numList) |
|||
see "The first 50 Humble numbers: " + nl |
|||
for n = 1 to 50 |
|||
see "" + numList[n] + " " |
|||
next |
|||
</lang> |
|||
Output: |
|||
<pre> |
|||
The first 50 Humble numbers: |
|||
1 2 3 4 5 6 7 8 9 10 12 14 15 16 18 20 21 24 25 27 28 30 32 35 36 40 42 45 48 49 50 54 56 60 63 64 70 72 75 80 81 84 90 96 98 100 105 108 112 120 |
|||
</pre> |
</pre> |
||