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-6 of 6 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

A182469 Triangle read by rows in which row n lists the odd divisors of n.

Original entry on oeis.org

1, 1, 1, 3, 1, 1, 5, 1, 3, 1, 7, 1, 1, 3, 9, 1, 5, 1, 11, 1, 3, 1, 13, 1, 7, 1, 3, 5, 15, 1, 1, 17, 1, 3, 9, 1, 19, 1, 5, 1, 3, 7, 21, 1, 11, 1, 23, 1, 3, 1, 5, 25, 1, 13, 1, 3, 9, 27, 1, 7, 1, 29, 1, 3, 5, 15, 1, 31, 1, 1, 3, 11, 33, 1, 17, 1, 5, 7, 35, 1
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 30 2012

Keywords

Comments

n-th row = intersection of A005408 and of n-th row of A027750.

Examples

			The triangle begins:
.  1   {1}
.  2   {1}
.  3   {1,3}
.  4   {1}
.  5   {1,5}
.  6   {1,3}
.  7   {1,7}
.  8   {1}
.  9   {1,3,9}
. 10   {1,5}
. 11   {1,11}
. 12   {1,3}
. 13   {1,13}
. 14   {1,7}
. 15   {1,3,5,15}
. 16   {1} .
		

Crossrefs

Cf. A001227 (row lengths), A000593 (row sums), A136655 (row products).
Cf. also A237048.

Programs

  • Haskell
    a182469 n k = a182469_tabf !! (n-1) !! (k-1)
    a182469_row = a027750_row . a000265
    a182469_tabf = map a182469_row [1..]
    
  • Mathematica
    Flatten[Table[Select[Divisors[n],OddQ],{n,40}]] (* Harvey P. Dale, Aug 13 2012 *)
    Flatten[Table[Divisors[n / 2^IntegerExponent[n, 2]], {n, 40}]] (* Amiram Eldar, May 02 2025 *)
  • PARI
    tabf(nn) = {for (n=1, nn, fordiv(n, d, if (d%2, print1(d, ", "))); print(););} \\ Michel Marcus, Apr 22 2017
    
  • PARI
    row(n) = divisors(n >> valuation(n, 2)); \\ Amiram Eldar, May 02 2025
    
  • Python
    from sympy import divisors
    def row(n):
        return [d for d in divisors(n) if d % 2]
    for n in range(1, 21): print(row(n)) # Indranil Ghosh, Apr 22 2017

Formula

T(n,k) = A027750(A000265(n),k), 1 <= k <= A001227(n).
A000265(n) = T(n,A001227(n)).

A284466 Number of compositions (ordered partitions) of n into odd divisors of n.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 6, 2, 1, 20, 8, 2, 60, 2, 10, 450, 1, 2, 726, 2, 140, 3321, 14, 2, 5896, 572, 16, 26426, 264, 2, 394406, 2, 1, 226020, 20, 51886, 961584, 2, 22, 2044895, 38740, 2, 20959503, 2, 676, 478164163, 26, 2, 56849086, 31201, 652968, 184947044, 980, 2, 1273706934, 6620376, 153366, 1803937344
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 27 2017

Keywords

Examples

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

Crossrefs

Programs

  • Maple
    with(numtheory):
    a:= proc(n) option remember; local b, l;
          l, b:= select(x-> is(x:: odd), 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..60);  # Alois P. Heinz, Mar 30 2017
  • Mathematica
    Table[d = Divisors[n]; Coefficient[Series[1/(1 - Sum[Boole[Mod[d[[k]], 2] == 1] x^d[[k]], {k, Length[d]}]), {x, 0, n}], x, n], {n, 0, 57}]
  • Python
    from sympy import divisors
    from sympy.core.cache import cacheit
    @cacheit
    def a(n):
        l=[x for x in divisors(n) if x%2]
        @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(61)]) # Indranil Ghosh, Aug 01 2017, after Maple code

Formula

a(n) = [x^n] 1/(1 - Sum_{d|n, d positive odd} x^d).
a(n) = 1 if n is a power of 2.
a(n) = 2 if n is an odd prime.

A294141 Number of partitions of n into odd parts that do not divide n.

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 2, 3, 0, 5, 5, 2, 7, 5, 1, 11, 14, 6, 9, 20, 5, 18, 33, 5, 43, 50, 12, 58, 17, 16, 91, 96, 26, 58, 146, 23, 183, 148, 11, 241, 285, 88, 187, 152, 98, 367, 537, 87, 177, 376, 179, 857, 983, 77, 1195, 1274, 79, 1596, 468, 290, 2117, 1887, 549, 460, 3064, 440
Offset: 0

Views

Author

Ilya Gutkovskiy, Oct 23 2017

Keywords

Examples

			a(13) = 2 because we have [7, 3, 3] and [5, 5, 3].
		

Crossrefs

Programs

  • Mathematica
    Table[SeriesCoefficient[Product[1/(1 - Boole[Mod[n, k] > 0 && OddQ[k]] x^k), {k, 1, n}], {x, 0, n}], {n, 0, 72}]

A294142 Number of partitions of n into distinct odd parts that do not divide n.

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 2, 0, 3, 1, 2, 2, 3, 0, 4, 4, 4, 2, 6, 1, 6, 8, 4, 10, 12, 4, 12, 5, 7, 17, 17, 8, 14, 24, 9, 29, 24, 4, 33, 40, 25, 29, 28, 23, 45, 63, 23, 30, 52, 37, 84, 99, 26, 113, 112, 23, 143, 60, 57, 173, 143, 89, 70, 226, 87, 256, 256, 53, 245, 135, 127, 378, 233
Offset: 0

Views

Author

Ilya Gutkovskiy, Oct 23 2017

Keywords

Examples

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

Crossrefs

Programs

  • Mathematica
    Table[SeriesCoefficient[Product[1 + Boole[Mod[n, k] > 0 && OddQ[k]] x^k, {k, 1, n}], {x, 0, n}], {n, 0, 80}]

A327640 Number of partitions of n into divisors d of n such that n/d is odd.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 2, 2, 1, 5, 2, 2, 2, 2, 2, 14, 1, 2, 5, 2, 2, 18, 2, 2, 2, 7, 2, 23, 2, 2, 14, 2, 1, 26, 2, 26, 5, 2, 2, 30, 2, 2, 18, 2, 2, 286, 2, 2, 2, 9, 7, 38, 2, 2, 23, 38, 2, 42, 2, 2, 14, 2, 2, 493, 1, 44, 26, 2, 2, 50, 26, 2, 5, 2, 2, 698, 2, 50, 30, 2, 2
Offset: 0

Views

Author

Ilya Gutkovskiy, Sep 20 2019

Keywords

Crossrefs

Cf. A018818, A038550 (positions of 2's), A171565.

Programs

  • Magma
    [1] cat [#RestrictedPartitions(n,{d:d in Divisors(n)|IsOdd(n div d)}):n in [1..80]]; // Marius A. Burtea, Sep 20 2019
  • Maple
    with(numtheory):
    a:= proc(n) option remember; local b, l; l, b:= sort(
          [select(x-> is((n/x):: odd), 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, Dec 06 2021
  • Mathematica
    a[n_] := SeriesCoefficient[Product[1/(1 - Boole[OddQ[n/d]] x^d), {d, Divisors[n]}], {x, 0, n}]; Table[a[n], {n, 0, 80}]

Formula

a(n) = [x^n] Product_{d|n, n/d odd} 1 / (1 - x^d).
a(2^k) = 1.
Showing 1-6 of 6 results.