Ludic numbers: Difference between revisions

Changed code so that ludic function is only called once for the largest value
(Added FreeBASIC)
(Changed code so that ludic function is only called once for the largest value)
Line 1,202:
Dim As Integer count = 1, count2
Dim As Integer i, j, k = 1
Dim As Integer ub = n * 11 22000 '' big enough to deal with up to 2005 ludic numbers
Dim a(2 To ub) As Integer
For i = 2 To ub : a(i) = i : Next
Line 1,239:
Dim i As Integer
Dim lu() As Integer
ludic(252005, lu())
Print "The first 25 Ludic numbers are :"
For i = 1 To 25
Line 1,245:
Print " ";
Next
Erase lu
Print
 
Dim As Integer Count = 0
ludic(1000, lu())
For i = 1 To 1000
If lu(i) <= 1000 Then
Line 1,257 ⟶ 1,255:
End If
Next
Erase lu
Print
Print "There are"; count; " Ludic numbers <= 1000"
Line 1,263 ⟶ 1,260:
 
Print "The 2000th to 2005th Ludics are :"
ludic(2005, lu())
For i = 2000 To 2005
Print lu(i); " ";
Next
Erase lu
Print : Print
 
Line 1,273 ⟶ 1,268:
Dim As Integer j, k, ldc
Dim b As Boolean
ludic(250, lu())
For i = 1 To 248
ldc = lu(i)
9,490

edits