login
A305403
Number of Ukrainian letters in Ukrainian name of n.
1
4, 4, 3, 3, 6, 4, 5, 3, 5, 6, 6, 10, 10, 10, 12, 10, 11, 10, 12, 12, 8, 12, 11, 11, 14, 12, 13, 11, 13, 14, 8, 12, 11, 11, 14, 12, 13, 11, 13, 14, 5, 9, 8, 8, 11, 9, 10, 8, 10, 11, 8, 12, 11, 11, 14, 12, 13, 11, 13, 14, 9, 13, 12, 12, 15, 13, 14, 12, 14, 15, 8, 12, 11, 11, 14, 12, 13, 11, 13, 14, 10, 14, 13
OFFSET
0,1
COMMENTS
Apostrophes, when the name is written with Ukrainian letters, are not counted as letters. If they were, then, for example, a(5) would be 5, but here, a(5) = 4, because the apostrophe is ignored.
EXAMPLE
Using the BGN/PCGN romanization system, the names of numbers are nul', odyn, dva, try, chotyry, .... Note that the number of letters in the romanized name of n does not necessarily coincide with the number of letters when the name of n is written in Ukrainian script.
MATHEMATICA
(* only works up to 999999 *)
upto20 = {0, 4, 3, 3, 6, 4, 5, 3, 5, 6, 6, 10, 10, 10, 12, 10, 11, 10, 12, 12, 8}
tens = {0, 6, 8, 8, 5, 8, 9, 8, 10, 9}
hundreds = {0, 3, 6, 6, 9, 6, 7, 6, 8, 8}
thousands = {0, 10, 9, 9, 12}
f[x_] := If[x == 0, 4, If[x > 999 && x < 5000, thousands[[Quotient[x, 1000] + 1]] + f[Mod[x, 1000]],
If[
x < 1000,
If[Mod[x, 100] <= 20, upto20[[Mod[x, 100] + 1]], upto20[[Mod[x, 10] + 1]] + tens[[Mod[Quotient[x, 10], 10] + 1]]] + hundreds[[Mod[Quotient[x, 100], 10] + 1]] + thousands[[Mod[Quotient[x, 1000], 10] + 1]],
5 + f[Quotient[x, 1000]] + If[Mod[x, 1000] == 0, 0, f[Mod[x, 1000]]]
]
]]
For[i = 0, i <= 10000, i++,
j = 0;
Print[i, " ", f[i]]
] (* E-Hern Lee, Jul 11 2018 *)
CROSSREFS
Cf. A005589 (English), A007005 (French), A026858 (Italian), A006994 (Russian), A011762 (Spanish).
Sequence in context: A209252 A265131 A344894 * A344895 A020805 A200587
KEYWORD
nonn,word
AUTHOR
Felix Fröhlich, May 31 2018
EXTENSIONS
More terms from E-Hern Lee, Jul 11 2018
STATUS
approved