OFFSET
2,3
LINKS
Seiichi Manyama, Table of n, a(n) for n = 2..10000
Eric Weisstein's World of Mathematics, Prime Partition
FORMULA
If p is prime, a(p^e) = e^p.
EXAMPLE
6 = 3*2.
x x x -> 3
x x -> 2
2*2*1=4. So a(6) = 4.
8 = 2*2*2.
x x -> 2
x x -> 2
x x -> 2
3*3=9. So a(8) = 9.
9 = 3*3.
x x x -> 3
x x x -> 3
2*2*2=8. So a(9) = 8.
10 = 5*2
x x x x x -> 5
x x -> 2
2*2*1*1*1=4. So a(10) = 4.
PROG
(Ruby)
require 'prime'
def A(ary)
y = ary.size
x = ary[0]
a = (0..y - 1).map{|i| [1] * ary[i] + [0] * (x - ary[i])}
(0..x - 1).map{|i| (0..y - 1).inject(0){|s, j| s + a[j][i]}}
end
def B(n)
n.prime_division.map{|i| [i[0]] * i[1]}.flatten
end
def C(n)
A(B(n).reverse).inject(:*)
end
def A354969(n)
(2..n).map{|i| C(i)}
end
p A354969(100)
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Jun 14 2022
STATUS
approved