login
Largest integer that can be expressed as Sum_{k=1..n} k/p(k), where p is a permutation of [n].
1

%I #26 Nov 13 2021 02:18:35

%S 0,1,2,3,6,7,10,11,15,18,21,22,27,28,32,36,40,41,46,47

%N Largest integer that can be expressed as Sum_{k=1..n} k/p(k), where p is a permutation of [n].

%F a(n) = 1 + a(n-1) if n is prime. - _Alois P. Heinz_, Nov 12 2021

%o (Ruby)

%o def A(n)

%o max = 0

%o (1..n).to_a.permutation{|i|

%o m = (1..n).inject(0){|s, j| s + j / i[j - 1].to_r}

%o if m.denominator == 1

%o max = m if max < m

%o end

%o }

%o max.to_i

%o end

%o def A349257(n)

%o (0..n).map{|i| A(i)}

%o end

%o p A349257(8)

%Y Cf. A022819, A073090, A349277.

%K nonn,more

%O 0,3

%A _Seiichi Manyama_, Nov 12 2021

%E a(12)-a(19) from _Alois P. Heinz_, Nov 12 2021