cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A358331 Number of integer partitions of n with arithmetic and geometric mean differing by one.

This page as a plain text file.
%I A358331 #37 Sep 25 2023 10:58:39
%S A358331 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,
%T A358331 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,
%U A358331 0,0,5,24,0,6,0,0,9,0,27,10,0,7,7,1,0,44
%N A358331 Number of integer partitions of n with arithmetic and geometric mean differing by one.
%C A358331 The arithmetic and geometric mean from such partition is a positive integer. - _David A. Corneth_, Nov 11 2022
%H A358331 Chai Wah Wu, <a href="/A358331/b358331.txt">Table of n, a(n) for n = 0..143</a>
%H A358331 Wikipedia, <a href="https://en.wikipedia.org/wiki/Geometric_mean">Geometric mean</a>
%e A358331 The a(30) = 2 through a(36) = 3 partitions (C = 12, G = 16):
%e A358331   (888222)      .  (99333311)  (G2222222111)  .  (C9662)    (G884)
%e A358331   (8844111111)                                   (C9833)    (888222111111)
%e A358331                                                  (8884421)  (G42222221111)
%t A358331 Table[Length[Select[IntegerPartitions[n],Mean[#]==1+GeometricMean[#]&]],{n,0,30}]
%o A358331 (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
%o A358331 (Python)
%o A358331 from math import prod
%o A358331 from sympy import divisors, integer_nthroot
%o A358331 from sympy.utilities.iterables import partitions
%o A358331 def A358331(n):
%o A358331     divs = {d:n//d-1 for d in divisors(n,generator=True)}
%o A358331     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
%Y A358331 The version for subsets seems to be close to A178832.
%Y A358331 These partitions are ranked by A358332.
%Y A358331 A000041 counts partitions.
%Y A358331 A067538 counts partitions with integer average, ranked by A316413.
%Y A358331 A067539 counts partitions with integer geometric mean, ranked by A326623.
%Y A358331 A078175 lists numbers whose prime factors have integer average.
%Y A358331 A320322 counts partitions whose product is a perfect power.
%Y A358331 Cf. A078174, A102627, A271654, A326027, A326624, A326625, A326028, A326641, A326645, A357710.
%K A358331 nonn
%O A358331 0,29
%A A358331 _Gus Wiseman_, Nov 09 2022
%E A358331 a(61)-a(80) from _Giorgos Kalogeropoulos_, Nov 11 2022
%E A358331 a(81)-a(84) from _Chai Wah Wu_, Sep 24 2023