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 11:15, 28 June 2023
, 11 months ago→{{header|J}}: bugfix (*last* letter of k, not first letter of k)
(J draft) |
(→{{header|J}}: bugfix (*last* letter of k, not first letter of k)) |
||
Line 38:
Using [[Number names#J|Number names]], we can generate a sample of the desired numbers which (in this example) are smaller than a million:
<syntaxhighlight lang=J> #sample=: I.({
91401
5 10$sample NB. first fifty
(],. sample {~ <:) 1e3 1e4 NB. 1000th and 10000th
1000
10000
(~.,.#/.~) /:~10|1e3{.sample NB. counts by final digit
0
1
2
3
4
5
6
7
8
9
(~.,.#/.~) /:~10|1e4{.sample NB. counts by final digit
0
1
2
3
4
5
6
7
8
9
=={{header|Wren}}==
|