Factorions: Difference between revisions
Content added Content deleted
(adding lambdatalk) |
(Added uBasic/4tH version) |
||
Line 1,783: | Line 1,783: | ||
1 2</pre> |
1 2</pre> |
||
=={{header|uBasic/4tH}}== |
|||
{{trans|FreeBASIC}} |
|||
It will take some time, but it will get there. |
|||
<syntaxhighlight lang="uBasic/4tH">Dim @f(12) |
|||
@f(0) = 1: For n = 1 To 11 : @f(n) = @f(n-1) * n : Next |
|||
For b = 9 To 12 |
|||
Print "The factorions for base ";b;" are: " |
|||
For i = 1 To 1499999 |
|||
s = 0 |
|||
j = i |
|||
Do While j > 0 |
|||
d = j % b |
|||
s = s + @f(d) |
|||
j = j / b |
|||
Loop |
|||
If s = i Then Print i;" "; |
|||
Next |
|||
Print : Print |
|||
Next</syntaxhighlight> |
|||
{{Out}} |
|||
<pre>The factorions for base 9 are: |
|||
1 2 41282 |
|||
The factorions for base 10 are: |
|||
1 2 145 40585 |
|||
The factorions for base 11 are: |
|||
1 2 26 48 40472 |
|||
The factorions for base 12 are: |
|||
1 2 |
|||
0 OK, 0:379</pre> |
|||
=={{header|V (Vlang)}}== |
=={{header|V (Vlang)}}== |
||
{{trans|Go}} |
{{trans|Go}} |