OFFSET
1,2
FORMULA
a(p^k) = a(p^k-1)+1 for p prime (see A339453). - Chai Wah Wu, Dec 12 2024
EXAMPLE
a(6) = 8 subsets: {1}, {2}, {3}, {4}, {5}, {6}, {2, 6} and {1, 2, 3, 6}.
MATHEMATICA
a[n_] := Count[Subsets[Range[n]], _?(# != {} && IntegerQ[Mean[#]] && IntegerQ[HarmonicMean[#]] &)]; Array[a, 20] (* Amiram Eldar, Dec 10 2024 *)
PROG
(PARI) a(n) = {my(c = 0); forsubset(n, s, if(#s && !(vecsum(Vec(s)) % #s) && denominator(#s/sum(i=1, #s, 1/s[i])) == 1, c++)); c; } \\ Amiram Eldar, Dec 10 2024
(Python)
from math import lcm
from itertools import combinations
def A378844(n):
m = lcm(*range(2, n+1))
return sum(1 for l in range(1, n+1) for c in combinations(range(1, n+1), l) if not (sum(c)%l or l*m%sum(m//d for d in c))) # Chai Wah Wu, Dec 12 2024
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Ilya Gutkovskiy, Dec 09 2024
EXTENSIONS
a(25)-a(29) from Amiram Eldar, Dec 10 2024
a(30)-a(33) from Chai Wah Wu, Dec 12 2024
a(34)-a(38) from Chai Wah Wu, Dec 13 2024
STATUS
approved