A357710 Number of integer compositions of n with integer geometric mean.
0, 1, 2, 2, 3, 4, 4, 8, 4, 15, 17, 22, 48, 40, 130, 88, 287, 323, 543, 1084, 1145, 2938, 3141, 6928, 9770, 15585, 29249, 37540, 78464, 103289, 194265, 299752, 475086, 846933, 1216749, 2261920, 3320935, 5795349, 9292376, 14825858, 25570823, 39030115, 68265801, 106030947, 178696496
Offset: 0
Keywords
Examples
The a(6) = 4 through a(9) = 15 compositions: (6) (7) (8) (9) (33) (124) (44) (333) (222) (142) (2222) (1224) (111111) (214) (11111111) (1242) (241) (1422) (412) (2124) (421) (2142) (1111111) (2214) (2241) (2412) (2421) (4122) (4212) (4221) (111111111)
Crossrefs
Programs
-
Mathematica
Table[Length[Select[Join @@ Permutations/@IntegerPartitions[n],IntegerQ[GeometricMean[#]]&]],{n,0,15}]
-
Python
from math import prod, factorial from sympy import integer_nthroot from sympy.utilities.iterables import partitions def A357710(n): return sum(factorial(s)//prod(factorial(d) for d in p.values()) for s,p in partitions(n,size=True) if integer_nthroot(prod(a**b for a, b in p.items()),s)[1]) if n else 0 # Chai Wah Wu, Sep 24 2023
Extensions
More terms from David A. Corneth, Oct 17 2022
Comments