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 08:32, 30 June 2023
, 11 months ago→{{header|Julia}}: refine histograms
m (→{{header|Julia}}: refine histograms) |
|||
Line 82:
ncount = 0
lastdigits = UInt8[]
println("First 50 qualifying numbers:")
for n in 0:typemax(Int32)
if qualifies(n)
Line 92:
println("\nThe $(spell(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_000 && break
Line 103:
</syntaxhighlight>{{out}}
<pre>
First 50 qualifying numbers:
0 18 28 38 79 81 83 85 97 102
122 132 142 152 162 172 182 192 208 228
Line 146:
The one hundred thousandth number is 1,095,542.
Breakdown by last digit of the qualifiers up to this:
┌ ┐
[ 0.0,
[
[
▲ [2.0, 2.5) ┤████████████████████████████▎ 18 829
[
[
[
▲ [4.0, 4.5) ┤█▋ 1 121
[
└ ┘▼
▲ [8.0, 8.5) ┤████████████████████████████████ 21 392
▲ └ ┘
The one millionth number is 10,984,428.
Breakdown by last digit of the qualifiers up to this:
┌ ┐
[ 0.0,
[
[
[
[
[
[
[
[
▲ [8.0, 8.5) ┤███████████████████████████████ 299 990
</pre>
=={{header|Wren}}==
|