VM
я только по упаковку шаров нашел https://www.pnas.org/content/116/2/436
Size: a a a
VM
АО
VM
АО
VS
VS
VM
АО
RS
*
1 * 8 + 1 = 9
12 * 8 + 2 = 98
123 * 8 + 3 = 987
1234 * 8 + 4 = 9876
12345 * 8 + 5 = 98765
123456 * 8 + 6 = 987654
1234567 * 8 + 7 = 9876543
12345678 * 8 + 8 = 98765432
123456789 * 8 + 9 = 987654321
1 * 9 + 2 = 11
12 * 9 + 3 = 111
123 * 9 + 4 = 1111
1234 * 9 + 5 = 11111
12345 * 9 + 6 = 111111
123456 * 9 + 7 = 1111111
1234567 * 9 + 8 = 11111111
12345678 * 9 + 9 = 111111111
123456789 * 9 + 10 = 1111111111
1 * 1 = 1
11 * 11 = 121
111 * 111 = 12321
1111 * 1111 = 1234321
11111 * 11111 = 123454321
111111 * 111111 = 12345654321
1111111 * 1111111 = 1234567654321
11111111 * 11111111 = 123456787654321
111111111 * 111111111 = 12345678987654321
RS
seq_d(r) = reduce((x, y,) -> x * 10 + y, 1:r)
seq_b(r) = repeat('1', r)
calc(f) = map(1:9) do i
expr = f(i) |> Meta.parse
(string(expr), string(eval(expr)))
end
res = [
calc(i -> "$(seq_d(i)) * 8 + $(i)")...,
calc(i -> "$(seq_d(i)) * 9 + $(1 + i)")...,
calc(i -> "$(seq_b(i)) * $(seq_b(i))")...
]
field_size = maximum(t -> length(first(t)), res)
map(res) do (expr, val)
repeat(' ', field_size - length(expr)) * "$(expr) = $(val)"
end |> s -> join(s, '\n') |> println
RS
AP
ЛЛ
KH
FO
fortran
Print *, "С Новым Годом!"
End
С Новым Годом!
KT
KT
KT
V