A358331 Number of integer partitions of n with arithmetic and geometric mean differing by one.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 2, 0, 2, 0, 1, 1, 0, 3, 3, 0, 0, 2, 2, 0, 4, 0, 0, 5, 0, 0, 4, 5, 4, 3, 2, 0, 3, 3, 10, 4, 0, 0, 7, 0, 0, 16, 2, 4, 4, 0, 0, 5, 24, 0, 6, 0, 0, 9, 0, 27, 10, 0, 7, 7, 1, 0, 44
Offset: 0
Keywords
Examples
The a(30) = 2 through a(36) = 3 partitions (C = 12, G = 16): (888222) . (99333311) (G2222222111) . (C9662) (G884) (8844111111) (C9833) (888222111111) (8884421) (G42222221111)
Links
- Chai Wah Wu, Table of n, a(n) for n = 0..143
- Wikipedia, Geometric mean
Crossrefs
Programs
-
Mathematica
Table[Length[Select[IntegerPartitions[n],Mean[#]==1+GeometricMean[#]&]],{n,0,30}]
-
PARI
a(n) = if (n, my(nb=0,vp); forpart(p=n, vp=Vec(p); if (vecsum(vp)/#p == 1 + sqrtn(vecprod(vp), #p), nb++)); nb, 0); \\ Michel Marcus, Nov 11 2022
-
Python
from math import prod from sympy import divisors, integer_nthroot from sympy.utilities.iterables import partitions def A358331(n): divs = {d:n//d-1 for d in divisors(n,generator=True)} return sum(1 for s,p in partitions(n,m=max(divs,default=0),size=True) if s in divs and (t:=integer_nthroot(prod(a**b for a, b in p.items()),s))[1] and divs[s]==t[0]) # Chai Wah Wu, Sep 24 2023
Extensions
a(61)-a(80) from Giorgos Kalogeropoulos, Nov 11 2022
a(81)-a(84) from Chai Wah Wu, Sep 24 2023
Comments