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.

Showing 1-10 of 10 results.

A018818 Number of partitions of n into divisors of n.

Original entry on oeis.org

1, 2, 2, 4, 2, 8, 2, 10, 5, 11, 2, 45, 2, 14, 14, 36, 2, 81, 2, 92, 18, 20, 2, 458, 7, 23, 23, 156, 2, 742, 2, 202, 26, 29, 26, 2234, 2, 32, 30, 1370, 2, 1654, 2, 337, 286, 38, 2, 9676, 9, 407, 38, 454, 2, 3132, 38, 3065, 42, 47, 2, 73155, 2, 50, 493, 1828, 44, 5257, 2, 740, 50, 5066
Offset: 1

Views

Author

Keywords

Comments

From Reinhard Zumkeller, Dec 11 2009: (Start)
For odd primes p: a(p^2) = p + 2; for n > 1: a(A001248(n)) = A052147(n);
For odd primes p > 3, a(3*p) = 2*p + 4; for n > 2: a(A001748(n)) = A100484(n) + 4. (End)
From Matthew Crawford, Jan 19 2021: (Start)
For a prime p, a(p^3) = (p^3 + p^2 + 2*p + 4)/2;
For distinct primes p and q, a(p*q) = (p+1)*(q+1)/2 + 2. (End)

Examples

			The a(6) = 8 representations of 6 are 6 = 3 + 3 = 3 + 2 + 1 = 3 + 1 + 1 + 1 = 2 + 2 + 2 = 2 + 2 + 1 + 1 = 2 + 1 + 1 + 1 + 1 = 1 + 1 + 1 + 1 + 1 + 1.
		

Crossrefs

Programs

  • Haskell
    a018818 n = p (init $ a027750_row n) n + 1 where
       p _      0 = 1
       p []     _ = 0
       p ks'@(k:ks) m | m < k     = 0
                      | otherwise = p ks' (m - k) + p ks m
    -- Reinhard Zumkeller, Apr 02 2012
    
  • Magma
    [#RestrictedPartitions(n,{d:d in Divisors(n)}): n in [1..100]]; // Marius A. Burtea, Jan 02 2019
  • Maple
    A018818 := proc(n)
        local a,p,w,el ;
        a := 0 ;
        for p in combinat[partition](n) do
            w := true ;
            for el in p do
                if modp(n,el) <> 0 then
                    w := false;
                    break;
                end if;
            end do:
            if w then
                a := a+1 ;
            end if;
        end do:
        a ;
    end proc: # R. J. Mathar, Mar 30 2017
  • Mathematica
    Table[d = Divisors[n]; Coefficient[Series[1/Product[1 - x^d[[i]], {i, Length[d]}], {x, 0, n}], x, n], {n, 100}] (* T. D. Noe, Jul 28 2011 *)
  • PARI
    a(n)=numbpartUsing(n, divisors(n));
    numbpartUsing(n, v, mx=#v)=if(n<1, return(n==0)); sum(i=1,mx, numbpartUsing(n-v[i],v,i)) \\ inefficient; Charles R Greathouse IV, Jun 21 2017
    
  • PARI
    A018818(n) = { my(p = Ser(1, 'x, 1+n)); fordiv(n, d, p /= (1 - 'x^d)); polcoef(p, n); }; \\ Antti Karttunen, Jan 23 2025, after Vladeta Jovovic
    

Formula

Coefficient of x^n in the expansion of 1/Product_{d|n} (1-x^d). - Vladeta Jovovic, Sep 28 2002
a(n) = 2 iff n is prime. - Juhani Heino, Aug 27 2009
a(n) = f(n,n,1), where f(n,m,k) = f(n,m,k+1) + f(n,m-k,k)*0^(n mod k) if k <= m, otherwise 0^m. - Reinhard Zumkeller, Dec 11 2009
Paul Erdős, Andrew M. Odlyzko, and the Editors of the AMM give bounds; see Bowman et al. - Charles R Greathouse IV, Dec 04 2012

A073576 Number of partitions of n into squarefree parts.

Original entry on oeis.org

1, 1, 2, 3, 4, 6, 9, 12, 16, 21, 28, 36, 47, 60, 76, 96, 120, 150, 185, 228, 280, 342, 416, 504, 608, 731, 877, 1048, 1249, 1484, 1759, 2079, 2452, 2885, 3387, 3968, 4640, 5413, 6304, 7328, 8504, 9852, 11395, 13159, 15172, 17468, 20082, 23056, 26434, 30267
Offset: 0

Views

Author

Vladeta Jovovic, Aug 27 2002

Keywords

Comments

Euler transform of the absolute values of A008683. - Tilman Neumann, Dec 13 2008
Euler transform of A008966. - Vaclav Kotesovec, Mar 31 2018

Crossrefs

Cf. A058647.
Cf. A087188.
Cf. A225244.
Cf. A114374.

Programs

  • Haskell
    a073576 = p a005117_list where
       p _          0 = 1
       p ks'@(k:ks) m = if m < k then 0 else p ks' (m - k) + p ks m
    -- Reinhard Zumkeller, Jun 01 2015
    
  • Maple
    with(numtheory):
    a:= proc(n) option remember; `if`(n=0, 1, add(add(d*
          abs(mobius(d)), d=divisors(j)) *a(n-j), j=1..n)/n)
        end:
    seq(a(n), n=0..60);  # Alois P. Heinz, Mar 05 2015
  • Mathematica
    Table[Length[Select[Boole /@ Thread /@ SquareFreeQ /@ IntegerPartitions[n], FreeQ[#, 0] &]], {n, 48}] (* Jayanta Basu, Jul 02 2013 *)
    a[n_] := a[n] = If[n==0, 1, Sum[Sum[d*Abs[MoebiusMu[d]], {d, Divisors[j]}] * a[n-j], {j, 1, n}]/n]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Oct 10 2015, after Alois P. Heinz *)
    nmax = 60; CoefficientList[Series[Exp[Sum[Sum[Abs[MoebiusMu[k]] * x^(j*k) / j, {k, 1, Floor[nmax/j] + 1}], {j, 1, nmax}]], {x, 0, nmax}], x] (* Vaclav Kotesovec, Mar 31 2018 *)
  • Python
    from functools import lru_cache
    from sympy import mobius, divisors
    @lru_cache(maxsize=None)
    def A073576(n): return sum(sum(d*abs(mobius(d)) for d in divisors(i, generator=True))*A073576(n-i) for i in range(1,n+1))//n if n else 1 # Chai Wah Wu, Aug 23 2024

Formula

G.f.: 1/Product_{k>0} (1-x^A005117(k)).
a(n) = 1/n*Sum_{k=1..n} A048250(k)*a(n-k).
a(n) = A000041(n) - A114374(n) - A117395(n), n>0. - Reinhard Zumkeller, Mar 11 2006
G.f.: 1 + Sum_{i>=1} mu(i)^2*x^i / Product_{j=1..i} (1 - mu(j)^2*x^j). - Ilya Gutkovskiy, Jun 05 2017
a(n) ~ exp(2*sqrt(n)) / (4*Pi^(3/2)*n^(1/4)). - Vaclav Kotesovec, Mar 24 2018

A225245 Number of partitions of n into distinct squarefree divisors of n.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 2, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 4, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 3, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 3, 1, 1, 0, 0, 1, 3, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 2, 1, 0, 0, 1, 1, 2, 1, 1
Offset: 0

Views

Author

Reinhard Zumkeller, May 05 2013

Keywords

Comments

a(n) <= A033630(n);
a(n) = A033630(n) iff n is squarefree: a(A005117(n)) = A033630(A005117(n));
a(A225353(n)) = 0; a(A225354(n)) > 0.

Examples

			a(2*3)     = a(6)  = #{6, 3+2+1} = 2;
a(2*2*3)   = a(12) = #{6+3+2+1} = 1;
a(2*3*5)   = a(30) = #{30, 15+10+5, 15+10+3+2, 15+6+5+3+1} = 4;
a(2*2*3*5) = a(60) = #{30+15+10+5, 30+15+10+3+2, 30+15+6+5+3+1} = 3;
a(2*3*7)   = a(42) = #{42, 21+14+7, 21+14+6+1} = 3;
a(2*2*3*7) = a(84) = #{42+21+14+7, 42+21+14+6+1} = 2.
		

Crossrefs

Programs

  • Haskell
    a225245 n = p (a206778_row n) n where
       p _      0 = 1
       p []     _ = 0
       p (k:ks) m = if m < k then 0 else p ks (m - k) + p ks m
  • Mathematica
    a[n_] := If[n == 0, 1, Coefficient[Product[If[MoebiusMu[d] != 0, 1+x^d, 1], {d, Divisors[n]}], x, n]];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Nov 08 2021, after Ilya Gutkovskiy *)

Formula

a(n) = [x^n] Product_{d|n, mu(d) != 0} (1 + x^d), where mu() is the Moebius function (A008683). - Ilya Gutkovskiy, Jul 26 2017

A284345 Number of partitions of n into squares dividing n.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 4, 1, 1, 1, 6, 1, 3, 1, 6, 1, 1, 1, 7, 2, 1, 4, 8, 1, 1, 1, 15, 1, 1, 1, 27, 1, 1, 1, 11, 1, 1, 1, 12, 6, 1, 1, 28, 2, 3, 1, 14, 1, 7, 1, 15, 1, 1, 1, 16, 1, 1, 8, 46, 1, 1, 1, 18, 1, 1, 1, 114, 1, 1, 4, 20, 1, 1, 1, 66, 11, 1, 1, 22, 1, 1, 1, 23, 1, 11, 1, 24, 1, 1, 1, 91, 1, 3, 12, 67
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 25 2017

Keywords

Examples

			a(8) = 3 because 8 has 4 divisors {1, 2, 4, 8} among which 2 are squares {1, 4} therefore we have [4, 4], [4, 1, 1, 1, 1] and [1, 1, 1, 1, 1, 1, 1, 1].
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    a:= proc(n) option remember; local b, l; l, b:=
          sort(select(issqr, [divisors(n)[]])),
          proc(m, i) option remember; `if`(m=0, 1, `if`(i<1, 0,
            b(m, i-1)+`if`(l[i]>m, 0, b(m-l[i], i))))
          end; b(n, nops(l))
        end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Mar 30 2017
  • Mathematica
    Join[{1}, Table[d = Divisors[n]; Coefficient[Series[Product[1/(1 - Boole[Mod[DivisorSigma[0, d[[k]]], 2] == 1] x^d[[k]]), {k, Length[d]}], {x, 0, n}], x, n], {n, 1, 100}]]

Formula

a(n) = [x^n] Product_{d^2|n} 1/(1 - x^(d^2)).
a(n) = 1 if n is a squarefree.
a(n) = 2 if n is a square of prime.

A284289 Number of partitions of n into prime power divisors of n (not including 1).

Original entry on oeis.org

1, 0, 1, 1, 2, 1, 2, 1, 4, 2, 2, 1, 7, 1, 2, 2, 10, 1, 7, 1, 10, 2, 2, 1, 34, 2, 2, 5, 13, 1, 21, 1, 36, 2, 2, 2, 72, 1, 2, 2, 73, 1, 28, 1, 19, 13, 2, 1, 249, 2, 10, 2, 22, 1, 50, 2, 127, 2, 2, 1, 419, 1, 2, 17, 202, 2, 42, 1, 28, 2, 43, 1, 1260, 1, 2, 13, 31, 2, 49, 1, 801, 23, 2, 1, 774, 2, 2, 2, 280, 1, 608
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 24 2017

Keywords

Examples

			a(8) = 4 because 8 has 4 divisors {1, 2, 4, 8} among which 3 are prime powers {2, 4, 8} therefore we have [8], [4, 4], [4, 2, 2] and [2, 2, 2, 2].
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    a:= proc(n) option remember; local b, l; l, b:= sort(
          [select(x-> nops(ifactors(x)[2])=1, divisors(n))[]]),
          proc(m, i) option remember; `if`(m=0, 1, `if`(i<1, 0,
            b(m, i-1)+`if`(l[i]>m, 0, b(m-l[i], i))))
          end; b(n, nops(l))
        end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Mar 30 2017
  • Mathematica
    Table[d = Divisors[n]; Coefficient[Series[Product[1/(1 - Boole[PrimePowerQ[d[[k]]]] x^d[[k]]), {k, Length[d]}], {x, 0, n}], x, n], {n, 0, 90}] (* or *)
    a[0]=1; a[1]=0; a[n_] := Length@IntegerPartitions[n, All, Join @@ (#[[1]]^Range[#[[2]]] & /@ FactorInteger[n])]; a /@ Range[0, 90] (* Giovanni Resta, Mar 25 2017 *)

Formula

a(n) = [x^n] Product_{p^k|n, p prime, k >= 1} 1/(1 - x^(p^k)).
a(n) = 1 if n is a prime.
a(n) = 2 if n is a semiprime.

A284464 Number of compositions (ordered partitions) of n into squarefree divisors of n.

Original entry on oeis.org

1, 1, 2, 2, 5, 2, 25, 2, 34, 19, 129, 2, 1046, 2, 742, 450, 1597, 2, 44254, 2, 27517, 3321, 29967, 2, 1872757, 571, 200390, 18560, 854850, 2, 154004511, 2, 3524578, 226020, 9262157, 51886, 3353855285, 2, 63346598, 2044895, 1255304727, 2, 185493291001, 2, 1282451595, 345852035, 2972038875, 2, 6006303471178
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 27 2017

Keywords

Examples

			a(4) = 5 because 4 has 3 divisors {1, 2, 4} among which 2 are squarefree {1, 2} therefore we have [2, 2], [2, 1, 1], [1, 2, 1], [1, 2, 2] and [1, 1, 1, 1].
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    a:= proc(n) option remember; local b, l;
          l, b:= select(issqrfree, divisors(n)),
          proc(m) option remember; `if`(m=0, 1,
             add(`if`(j>m, 0, b(m-j)), j=l))
          end; b(n)
        end:
    seq(a(n), n=0..50);   # Alois P. Heinz, Mar 30 2017
  • Mathematica
    Table[d = Divisors[n]; Coefficient[Series[1/(1 - Sum[MoebiusMu[d[[k]]]^2 x^d[[k]], {k, Length[d]}]), {x, 0, n}], x, n], {n, 0, 48}]
  • Python
    from sympy import divisors
    from sympy.ntheory.factor_ import core
    from sympy.core.cache import cacheit
    @cacheit
    def a(n):
        l=[x for x in divisors(n) if core(x)==x]
        @cacheit
        def b(m): return 1 if m==0 else sum(b(m - j) for j in l if j <= m)
        return b(n)
    print([a(n) for n in range(51)]) # Indranil Ghosh, Aug 01 2017, after Maple code

Formula

a(n) = [x^n] 1/(1 - Sum_{d|n, |mu(d)| = 1} x^d), where mu(d) is the Moebius function (A008683).
a(n) = 2 if n is a prime.

A286852 Number of partitions of n into unitary prime divisors of n.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 2, 1, 0, 0, 2, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 2, 2, 1, 1, 0, 2, 0, 1, 1, 21, 1, 0, 2, 2, 2, 0, 1, 2, 2, 1, 1, 28, 1, 1, 1, 2, 1, 1, 0, 1, 2, 1, 1, 1, 2, 1, 2, 2, 1, 5, 1, 2, 1, 0, 2, 42, 1, 1, 2, 43, 1, 0, 1, 2, 1, 1, 2, 49, 1, 1, 0, 2, 1, 5, 2, 2, 2, 1, 1, 10, 2, 1, 2, 2, 2
Offset: 0

Views

Author

Ilya Gutkovskiy, Aug 01 2017

Keywords

Examples

			a(6) = 2 because 6 has 4 divisors {1, 2, 3, 6} among which 2 are unitary prime divisors {2, 3} therefore we have [3, 3] and [2, 2, 2].
		

Crossrefs

Programs

  • Mathematica
    Join[{1}, Table[d = Divisors[n]; Coefficient[Series[Product[1/(1 - Boole[GCD[n/d[[k]], d[[k]]] == 1 && PrimeQ[d[[k]]]] x^d[[k]]), {k, Length[d]}], {x, 0, n}], x, n], {n, 1, 95}]]
  • PARI
    A055231(n) = {my(f=factor(n)); for (k=1, #f~, if (f[k, 2] > 1, f[k, 2] = 0); ); factorback(f); } \\ From A055231
    unitary_prime_factors(n) = { my(ufs = factor(A055231(n))); ufs[,1]~; };
    partitions_into(n,parts,from=1) = if(!n,1,my(k = #parts, s=0); for(i=from,k,if(parts[i]<=n, s += partitions_into(n-parts[i],parts,i))); (s));
    A286852(n) = if(n<2,1-n,partitions_into(n,vecsort(unitary_prime_factors(n), , 4))); \\ Antti Karttunen, Jul 02 2018

Formula

a(n) = [x^n] Product_{p|n, p prime, gcd(p, n/p) = 1} 1/(1 - x^p).
a(n) = 0 if n is a powerful number (A001694).

A300585 Number of partitions of n into squarefree parts that do not divide n.

Original entry on oeis.org

1, 0, 0, 0, 0, 1, 0, 2, 1, 2, 1, 7, 1, 12, 3, 4, 8, 29, 2, 42, 8, 18, 18, 87, 7, 71, 36, 67, 32, 234, 3, 319, 98, 126, 118, 192, 31, 772, 205, 293, 98, 1347, 21, 1763, 338, 295, 574, 2973, 116, 2290, 298, 1359, 932, 6287, 214, 2670, 843, 2744, 2334, 12828, 66, 16155, 3620, 2835, 4584, 8380
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 09 2018

Keywords

Examples

			a(14) = 3 because we have [11, 3], [6, 5, 3] and [5, 3, 3, 3].
		

Crossrefs

Programs

  • Mathematica
    Table[SeriesCoefficient[Product[1/(1 - Boole[Mod[n, k] != 0 && SquareFreeQ[k]] x^k), {k, 1, n}], {x, 0, n}], {n, 0, 65}]

A327641 Number of partitions of n into divisors d of n such that n/d is squarefree.

Original entry on oeis.org

1, 1, 2, 2, 2, 2, 8, 2, 2, 2, 11, 2, 8, 2, 14, 14, 2, 2, 8, 2, 11, 18, 20, 2, 8, 2, 23, 2, 14, 2, 742, 2, 2, 26, 29, 26, 8, 2, 32, 30, 11, 2, 1654, 2, 20, 14, 38, 2, 8, 2, 11, 38, 23, 2, 8, 38, 14, 42, 47, 2, 742, 2, 50, 18, 2, 44, 5257, 2, 29, 50, 5066, 2, 8, 2, 59, 14
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 20 2019

Keywords

Crossrefs

Cf. A008683, A018818, A225244, A225245, A246655 (positions of 2's).

Programs

  • Magma
    [1] cat [#RestrictedPartitions(n,{d:d in Divisors(n)|IsSquarefree(n div d)}):n in [1..75]]; // Marius A. Burtea, Sep 20 2019
    
  • Mathematica
    a[n_] := SeriesCoefficient[Product[1/(1 - MoebiusMu[n/d]^2 x^d), {d, Divisors[n]}], {x, 0, n}]; Table[a[n], {n, 0, 75}]
  • PARI
    A327641(n) = if(!n, 1, my(p = Ser(1, 'x, 1+n)); fordiv(n, d, if(issquarefree(n/d), p /= (1 - 'x^d))); polcoef(p, n)); \\ Antti Karttunen, Jan 28 2025

Formula

a(n) = [x^n] Product_{d|n} 1 / (1 - mu(n/d)^2 * x^d).

A378843 Number of compositions (ordered partitions) of n into distinct squarefree divisors of n.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 7, 1, 0, 0, 1, 1, 24, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 151, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 31, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 864, 1, 1, 0, 0, 1, 127, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 7, 1, 0
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 09 2024

Keywords

Comments

From Robert Israel, Dec 15 2024: (Start)
If n is squarefree, a(n) >= 1, as [n] is a composition.
If n = b * c where b and c are coprime and c is squarefree, then a(n) >= a(b), as for any composition C of b into distinct squarefree divisors, multiplying each element of C by c gives a composition of n into distinct squarefree divisors. (End)

Examples

			a(6) = 7 because we have [6], [3, 2, 1], [3, 1, 2], [2, 3, 1], [2, 1, 3], [1, 3, 2] and [1, 2, 3].
a(12) = 24 because we have [6, 3, 2, 1] and 4! = 24 permutations.
		

Crossrefs

Programs

  • Maple
    ptns:= proc(S,n) option remember;
      # subsets of S with sum n
      local m,s;
      if convert(S,`+`) < n then return {} fi;
      if n = 0 then return {{}} fi;
      s:= max(S);
      if s > n then return procname(select(`<=`,S,n),n) fi;
      map(t -> t union {s}, procname(S minus {s},n-s)) union procname(S minus {s}, n)
      end proc:
    sfd:= proc(n) map(convert,combinat:-powerset(numtheory:-factorset(n)),`*`) end proc:
    f:= proc(n) local t;
         add((nops(t))!, t = ptns(sfd(n),n))
    end proc:
    map(f, [$0..100]); # Robert Israel, Dec 15 2024
  • Mathematica
    a[n_] := Module[{d = Select[Divisors[n], SquareFreeQ]}, Total[(Length /@ Select[Subsets[d], Total[#] == n &])!]]; a[0] = 1; Array[a, 100, 0] (* Amiram Eldar, Dec 10 2024 *)
Showing 1-10 of 10 results.