Jump to content

Numbers k such that the last letter of k is the same as the first letter of k+1: Difference between revisions

m
→‎{{header|Julia}}: up to a trillion
m (→‎{{header|Julia}}: up to a trillion)
Line 346:
if ncount < 51
print(rpad(n, 5), ncount % 10 == 0 ? "\n" : "")
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("Breakdown by last digit of the qualifiers up to this:")
display(histogram(lastdigits, nbins = 10))
println()
ncount == 1_000_000100_000_000 && break
end
end
Line 431:
[ 8.0, 9.0) ┤███████████████████████████████ 299 990
[ 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
4,108

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.