Numbers k such that the last letter of k is the same as the first letter of k+1: Difference between revisions
Numbers k such that the last letter of k is the same as the first letter of k+1 (view source)
Revision as of 18:39, 1 July 2023
, 11 months ago→{{header|Julia}}: minor speedups
(Added FreeBasic) |
m (→{{header|Julia}}: minor speedups) |
||
Line 322:
<syntaxhighlight lang="julia">using Formatting, SpelledOut, UnicodePlots
spelledcache = [spelled_out(n, lang = :en) for n in
firstcache, lastcache = map(first, spelledcache), map(last, spelledcache)
""" Return
function firstlastgroupings(n)
▲ groups = []
while n > 0
n,
end
return
end
firstletter(n) =
function lastletter(n)
return n % 1000 == 0 ? (n == 0 ? 'o' : n % 1_000_000 == 0 ? 'n' : 'd') :
end
|