Brazilian numbers: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (Automated syntax highlighting fixup (second round - minor fixes)) |
(→{{header|Vlang}}: Rename "Vlang" in "V (Vlang)") |
||
Line 4,356: | Line 4,356: | ||
</pre> |
</pre> |
||
The point of utilizing a sieve is that it caches or memoizes the results. Since we are going through a long sequence of possible Brazilian numbers, it pays off to check the prime factoring in an efficient way, rather than one at a time. |
The point of utilizing a sieve is that it caches or memoizes the results. Since we are going through a long sequence of possible Brazilian numbers, it pays off to check the prime factoring in an efficient way, rather than one at a time. |
||
=={{header|Vlang}}== |
=={{header|V (Vlang)}}== |
||
{{trans|Go}} |
{{trans|Go}} |
||
<syntaxhighlight lang="vlang">fn same_digits(nn int, b int) bool { |
<syntaxhighlight lang="v (vlang)">fn same_digits(nn int, b int) bool { |
||
f := nn % b |
f := nn % b |
||
mut n := nn/b |
mut n := nn/b |
||
Line 4,470: | Line 4,470: | ||
The 100,000th Brazilian number: 110468 |
The 100,000th Brazilian number: 110468 |
||
</pre> |
</pre> |
||
=={{header|Wren}}== |
=={{header|Wren}}== |
||
{{trans|Go}} |
{{trans|Go}} |