Numbers k such that the last letter of k is the same as the first letter of k+1: Difference between revisions
Content deleted Content added
m →{{header|Julia}}: up to a trillion |
|||
Line 346: | Line 346: | ||
if ncount < 51 |
if ncount < 51 |
||
print(rpad(n, 5), ncount % 10 == 0 ? "\n" : "") |
print(rpad(n, 5), ncount % 10 == 0 ? "\n" : "") |
||
elseif ncount in [10^3, 10^4, 10^5, 10^6] |
elseif ncount in [10^3, 10^4, 10^5, 10^6, 10^7, 10^8] |
||
println("\nThe $(spelled_out(ncount))th number is $(format(n, commas = true)).") |
println("\nThe $(spelled_out(ncount))th number is $(format(n, commas = true)).") |
||
println("Breakdown by last digit of the qualifiers up to this:") |
println("Breakdown by last digit of the qualifiers up to this:") |
||
display(histogram(lastdigits, nbins = 10)) |
display(histogram(lastdigits, nbins = 10)) |
||
println() |
println() |
||
ncount == |
ncount == 100_000_000 && break |
||
end |
end |
||
end |
end |
||
Line 431: | Line 431: | ||
[ 8.0, 9.0) ┤███████████████████████████████ 299 990 |
[ 8.0, 9.0) ┤███████████████████████████████ 299 990 |
||
[ 9.0, 10.0) ┤███████████▌ 111 301 |
[ 9.0, 10.0) ┤███████████▌ 111 301 |
||
└ ┘ |
|||
Frequency |
|||
The ten millionth number is 106,650,962. |
|||
Breakdown by last digit of the qualifiers up to this: |
|||
┌ ┐ |
|||
[ 0.0, 1.0) ┤█▌ 121 134 |
|||
[ 1.0, 2.0) ┤███████████████▊ 1 301 301 |
|||
[ 2.0, 3.0) ┤██████████▏ 828 817 |
|||
[ 3.0, 4.0) ┤███████████████▊ 1 301 301 |
|||
[ 4.0, 5.0) ┤█▌ 121 121 |
|||
[ 5.0, 6.0) ┤███████████████▊ 1 301 301 |
|||
[ 6.0, 7.0) ┤█▌ 121 121 |
|||
[ 7.0, 8.0) ┤██████████████▋ 1 211 211 |
|||
[ 8.0, 9.0) ┤█████████████████████████████ 2 391 392 |
|||
[ 9.0, 10.0) ┤███████████████▊ 1 301 301 |
|||
└ ┘ |
|||
Frequency |
|||
The one hundred millionth number is 1,095,538,742. |
|||
Breakdown by last digit of the qualifiers up to this: |
|||
┌ ┐ |
|||
[ 0.0, 1.0) ┤█▌ 1 121 234 |
|||
[ 1.0, 2.0) ┤██████████████▊ 11 301 301 |
|||
[ 2.0, 3.0) ┤████████████████████████▋ 18 828 717 |
|||
[ 3.0, 4.0) ┤██████████████▊ 11 301 301 |
|||
[ 4.0, 5.0) ┤█▌ 1 121 121 |
|||
[ 5.0, 6.0) ┤██████████████▊ 11 301 301 |
|||
[ 6.0, 7.0) ┤█▌ 1 121 121 |
|||
[ 7.0, 8.0) ┤██████████████▋ 11 211 211 |
|||
[ 8.0, 9.0) ┤████████████████████████████ 21 391 392 |
|||
[ 9.0, 10.0) ┤██████████████▊ 11 301 301 |
|||
└ ┘ |
└ ┘ |
||
Frequency |
Frequency |