login
Number of partitions of n into two positive parts (s,t), s <= t, such that the harmonic mean of s and t is an integer.
5

%I #20 Jan 07 2022 14:11:29

%S 0,1,0,1,0,1,0,2,1,1,0,1,0,1,0,2,0,3,0,1,0,1,0,2,2,1,1,1,0,1,0,4,0,1,

%T 0,3,0,1,0,2,0,1,0,1,1,1,0,2,3,5,0,1,0,3,0,2,0,1,0,1,0,1,1,4,0,1,0,1,

%U 0,1,0,6,0,1,2,1,0,1,0,2,4,1,0,1,0,1,0,2,0,3,0,1,0,1,0,4,0,7

%N Number of partitions of n into two positive parts (s,t), s <= t, such that the harmonic mean of s and t is an integer.

%C Number of solutions, (s,t,k), to s^2 + t^2 = k*n such that s + t = n, 1 <= s <= t and 1 <= k <= n-1. - _Wesley Ivan Hurt_, Oct 01 2020

%H Antti Karttunen, <a href="/A337101/b337101.txt">Table of n, a(n) for n = 1..20000</a>

%H <a href="/index/Par#part">Index entries for sequences related to partitions</a>

%F a(n) = Sum_{i=1..floor(n/2)} (1 - ceiling(2*i*(n-i)/n) + floor(2*i*(n-i)/n)).

%F a(n) = A004526(n) - A337102(n).

%F a(n) = Sum_{i=1..floor(n/2)} Sum_{k=1..n-1} [i^2 + (n-i)^2 = n*k], where [ ] is the Iverson bracket. - _Wesley Ivan Hurt_, Oct 01 2020

%t Table[Sum[1 - Ceiling[2*i*(n - i)/n] + Floor[2*i*(n - i)/n], {i, Floor[n/2]}], {n, 100}]

%t Table[Sum[Sum[KroneckerDelta[(i^2 + (n - i)^2)/k, n], {k, n - 1}], {i, Floor[n/2]}], {n, 100}]

%o (PARI) A337101(n) = { my(u,t); sum(s=1, n\2, t = n-s; u = (s^2 + t^2); (!(u%n) && (u/n) <= n-1)); }; \\ _Antti Karttunen_, Dec 12 2021

%Y Cf. A004526, A337102, A337945, A338021, A338117.

%K nonn,easy

%O 1,8

%A _Wesley Ivan Hurt_, Aug 15 2020