A337101 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.
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, 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, 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
Offset: 1
Links
Programs
-
Mathematica
Table[Sum[1 - Ceiling[2*i*(n - i)/n] + Floor[2*i*(n - i)/n], {i, Floor[n/2]}], {n, 100}] Table[Sum[Sum[KroneckerDelta[(i^2 + (n - i)^2)/k, n], {k, n - 1}], {i, Floor[n/2]}], {n, 100}]
-
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
Formula
a(n) = Sum_{i=1..floor(n/2)} (1 - ceiling(2*i*(n-i)/n) + floor(2*i*(n-i)/n)).
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
Comments