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.

A302300 a(n) = Sum_{p in P} (Sum_{k_j = 1} 1)^2, where P is the set of partitions of n, and the k_j are the frequencies in p.

Original entry on oeis.org

0, 1, 1, 5, 6, 12, 21, 33, 50, 79, 116, 169, 246, 346, 487, 675, 927, 1254, 1702, 2263, 3014, 3966, 5210, 6766, 8795, 11303, 14531, 18521, 23583, 29803, 37654, 47231, 59206, 73792, 91867, 113778, 140788, 173377, 213289, 261318, 319764, 389846, 474745, 576164
Offset: 0

Views

Author

Emily Anible, Apr 04 2018

Keywords

Comments

This sequence is part of the contribution to the b^2 term of C_{1-b,2}(q) for(1-b,2)-colored partitions - partitions in which we can label parts any of an indeterminate 1-b colors, but are restricted to using only 2 of the colors per part size. This formula is known to match the Han/Nekrasov-Okounkov hooklength formula truncated at hooks of size two up to the linear term in b.
It is of interest to enumerate and determine specific characteristics of partitions of n, considering each partition individually.

Examples

			For a(6), we sum over partitions of six. For each partition, we count 1 for each part which appears once, then square the total in each partition.
   6............1^2 = 1
   5,1..........2^2 = 4
   4,2..........2^2 = 4
   4,1,1........1^2 = 1
   3,3..........0^2 = 0
   3,2,1........3^2 = 9
   3,1,1,1......1^2 = 1
   2,2,2........0^2 = 0
   2,2,1,1......0^2 = 0
   2,1,1,1,1....1^2 = 1
   1,1,1,1,1,1..0^2 = 0
   --------------------
   Total.............21
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, p) option remember; `if`(n=0 or i=1, (
          `if`(n=1, 1, 0)+p)^2, add(b(n-i*j, i-1,
          `if`(j=1, 1, 0)+p), j=0..n/i))
        end:
    a:= n-> b(n$2, 0):
    seq(a(n), n=0..60);  # Alois P. Heinz, Apr 05 2018
  • Mathematica
    Array[Total@ Map[Count[Split@ #, ?(Length@ # == 1 &)]^2 &, IntegerPartitions[#]] &, 43] (* _Michael De Vlieger, Apr 05 2018 *)
    b[n_, i_, p_] := b[n, i, p] = If[n == 0 || i == 1, (
         If[n == 1, 1, 0] + p)^2, Sum[b[n - i*j, i - 1,
         If[j == 1, 1, 0] + p], {j, 0, n/i}]];
    a[n_] := b[n, n, 0];
    a /@ Range[0, 60] (* Jean-François Alcover, Jun 06 2021, after Alois P. Heinz *)
  • Python
    def frequencies(partition, n):
        tot = 0
        freq_list = []
        i = 0
        for p in partition:
            freq = [0 for i in range(n+1)]
            for i in p:
                freq[i] += 1
            for f in freq:
                if f == 0:
                    tot += 1
            freq_list.append(freq)
        return freq_list
    def sum_square_freqs_of_one(freq_part):
        tot = 0
        for f in freq_part:
            count = 0
            for i in f:
                if i == 1:
                    count += 1
            tot += count*count
        return tot
    import sympy.combinatorics
    def A302300(n): # rewritten by R. J. _Mathar, 2023-03-24
        a =0
        if n ==0 :
            return 0
        part = sympy.combinatorics.IntegerPartition([n])
        partlist = []
        while True:
            part = part.next_lex()
            partlist.append(part.partition)
            if len(part.partition) <=1 :
                break
        freq_part = frequencies(partlist, n)
        return sum_square_freqs_of_one(freq_part)
    for n in range(20): print(A302300(n))

Formula

a(n) = Sum_{p in P} (Sum_{k_j = 1} 1)^2, where P is the set of partitions of n, and k_j are the frequencies in p.