Super-d numbers: Difference between revisions

Added FreeBASIC
(Added FreeBASIC)
 
(One intermediate revision by one other user not shown)
Line 787:
</pre>
 
=={{header|FōrmulæFreeBASIC}}==
{{trans|Visual Basic .NET}}
<syntaxhighlight lang="vbnet">Dim rd(7) As String = {"22", "333", "4444", "55555", "666666", "7777777", "88888888", "999999999"}
 
For n As Integer = 2 To 9
Dim cont As Integer = 0
Dim j As Uinteger = 3
Print Using !"\nFirst 10 super-# numbers:"; n
Do
Dim k As Ulongint = n * (j ^ n)
Dim ix As Uinteger = Instr(Str(k), rd(n - 2))
If ix > 0 Then
cont += 1
Print j; " " ;
End If
j += 1
Loop Until cont = 10
Next n</syntaxhighlight>
 
=={{header|Fōrmulæ}}==
{{FormulaeEntry|page=https://formulae.org/?script=examples/Super-d_numbers}}
 
Line 2,081 ⟶ 2,100:
{{libheader|Wren-fmt}}
Managed to get up to 8 but too slow for 9.
<syntaxhighlight lang="ecmascriptwren">import "./big" for BigInt
import "./fmt" for Fmt
 
var start = System.clock
Line 2,138 ⟶ 2,157:
{{libheader|Wren-gmp}}
Much sprightlier with 8 now being reached in 11.7 seconds and 9 in 126.5 seconds.
<syntaxhighlight lang="ecmascriptwren">/* superSuper-d_numbers_gmpd_numbers_2.wren */
 
import "./gmp" for Mpz
2,122

edits