login
A349257
Largest integer that can be expressed as Sum_{k=1..n} k/p(k), where p is a permutation of [n].
1
0, 1, 2, 3, 6, 7, 10, 11, 15, 18, 21, 22, 27, 28, 32, 36, 40, 41, 46, 47
OFFSET
0,3
FORMULA
a(n) = 1 + a(n-1) if n is prime. - Alois P. Heinz, Nov 12 2021
PROG
(Ruby)
def A(n)
max = 0
(1..n).to_a.permutation{|i|
m = (1..n).inject(0){|s, j| s + j / i[j - 1].to_r}
if m.denominator == 1
max = m if max < m
end
}
max.to_i
end
def A349257(n)
(0..n).map{|i| A(i)}
end
p A349257(8)
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Seiichi Manyama, Nov 12 2021
EXTENSIONS
a(12)-a(19) from Alois P. Heinz, Nov 12 2021
STATUS
approved