Numbers which are the cube roots of the product of their proper divisors: Difference between revisions

Numbers which are the cube roots of the product of their proper divisors in FreeBASIC
m (→‎{{header|Phix}}: looks a bit too much like "8.25%" for my tastes)
(Numbers which are the cube roots of the product of their proper divisors in FreeBASIC)
Line 113:
50,000th: 223,735
</pre>
 
=={{header|FreeBASIC}}==
<syntaxhighlight lang="freebasic">Dim As Single limite = 500000
Dim As Integer pdc(1 To limite)
Dim As Integer i, j
For i = 1 To Ubound(pdc)
pdc(i) = 1
Next i
pdc(1) = 7
For i = 2 To Ubound(pdc)
For j = i + i To Ubound(pdc) Step i
pdc(j) += 1
Next j
Next i
 
Dim As Integer n5 = 500, cont = 0
Print "First 50 numbers which are the cube roots"
Print "of the products of their proper divisors:"
For i = 1 To Ubound(pdc)
If pdc(i) = 7 Then
cont += 1
If cont <= 50 Then
Print Using "####"; i;
If cont Mod 10 = 0 Then Print
Elseif cont = n5 Then
Print Using !"\n#########th: &"; cont; i;
n5 *= 10
End If
End If
Next i
Sleep</syntaxhighlight>
{{out}}
<pre>First 50 numbers which are the cube roots
of the products of their proper divisors:
1 24 30 40 42 54 56 66 70 78
88 102 104 105 110 114 128 130 135 136
138 152 154 165 170 174 182 184 186 189
190 195 222 230 231 232 238 246 248 250
255 258 266 273 282 285 286 290 296 297
 
500th: 2526
5000th: 23118
50000th: 223735</pre>
 
=={{header|J}}==
2,123

edits