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.

A331844 Number of compositions (ordered partitions) of n into distinct squares.

Original entry on oeis.org

1, 1, 0, 0, 1, 2, 0, 0, 0, 1, 2, 0, 0, 2, 6, 0, 1, 2, 0, 0, 2, 6, 0, 0, 0, 3, 8, 0, 0, 8, 30, 0, 0, 0, 2, 6, 1, 2, 6, 24, 2, 8, 6, 0, 0, 8, 30, 0, 0, 7, 32, 24, 2, 8, 30, 120, 6, 24, 2, 6, 0, 8, 36, 24, 1, 34, 150, 0, 2, 12, 30, 24, 0, 2, 38, 150, 0, 12, 78, 144, 2
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 29 2020

Keywords

Examples

			a(14) = 6 because we have [9,4,1], [9,1,4], [4,9,1], [4,1,9], [1,9,4] and [1,4,9].
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, p) option remember;
          `if`(i*(i+1)*(2*i+1)/6n, 0, b(n-i^2, i-1, p+1))+b(n, i-1, p)))
        end:
    a:= n-> b(n, isqrt(n), 0):
    seq(a(n), n=0..82);  # Alois P. Heinz, Jan 30 2020
  • Mathematica
    b[n_, i_, p_] := b[n, i, p] = If[i(i+1)(2i+1)/6 < n, 0, If[n == 0, p!, If[i^2 > n, 0, b[n - i^2, i - 1, p + 1]] + b[n, i - 1, p]]];
    a[n_] := b[n, Sqrt[n] // Floor, 0];
    a /@ Range[0, 82] (* Jean-François Alcover, Oct 29 2020, after Alois P. Heinz *)

A331843 Number of compositions (ordered partitions) of n into distinct triangular numbers.

Original entry on oeis.org

1, 1, 0, 1, 2, 0, 1, 2, 0, 2, 7, 2, 0, 2, 6, 1, 4, 6, 2, 12, 24, 3, 8, 0, 8, 32, 6, 2, 13, 26, 6, 34, 36, 0, 32, 150, 3, 20, 50, 14, 54, 126, 32, 32, 12, 55, 160, 78, 122, 44, 174, 4, 72, 294, 36, 201, 896, 128, 62, 180, 176, 164, 198, 852, 110, 320, 159, 212, 414
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 29 2020

Keywords

Examples

			a(10) = 7 because we have [10], [6, 3, 1], [6, 1, 3], [3, 6, 1], [3, 1, 6], [1, 6, 3] and [1, 3, 6].
		

Crossrefs

Programs

  • Maple
    h:= proc(n) option remember; `if`(n<1, 0,
          `if`(issqr(8*n+1), 1+h(n-1), h(n-1)))
        end:
    b:= proc(n, i, p) option remember; (t->
          `if`(t*(i+2)/3n, 0, b(n-t, i-1, p+1)))))((i*(i+1)/2))
        end:
    a:= n-> b(n, h(n), 0):
    seq(a(n), n=0..73);  # Alois P. Heinz, Jan 31 2020
  • Mathematica
    h[n_] := h[n] = If[n<1, 0, If[IntegerQ @ Sqrt[8n+1], 1 + h[n-1], h[n-1]]];
    b[n_, i_, p_] := b[n, i, p] = Function[t, If[t (i + 2)/3 < n, 0, If[n == 0, p!, b[n, i-1, p] + If[t>n, 0, b[n - t, i - 1, p + 1]]]]][(i(i + 1)/2)];
    a[n_] := b[n, h[n], 0];
    a /@ Range[0, 73] (* Jean-François Alcover, Apr 27 2020, after Alois P. Heinz *)

A331845 Number of compositions (ordered partitions) of n into distinct cubes.

Original entry on oeis.org

1, 1, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 2, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6, 0, 0, 0, 0, 0, 0, 6, 24
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 29 2020

Keywords

Examples

			a(36) = 6 because we have [27,8,1], [27,1,8], [8,27,1], [8,1,27], [1,27,8] and [1,8,27].
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, p) option remember;
          `if`((i*(i+1)/2)^2n, 0, b(n-i^3, i-1, p+1))+b(n, i-1, p)))
        end:
    a:= n-> b(n, iroot(n, 3), 0):
    seq(a(n), n=0..100);  # Alois P. Heinz, Jan 30 2020
  • Mathematica
    b[n_, i_, p_] := b[n, i, p] = If[(i(i+1)/2)^2 < n, 0, If[n == 0, p!, If[i^3 > n, 0, b[n-i^3, i-1, p+1]] + b[n, i-1, p]]];
    a[n_] := b[n, Floor[n^(1/3)], 0];
    a /@ Range[0, 100] (* Jean-François Alcover, Oct 31 2020, after Alois P. Heinz *)

A331847 Number of compositions (ordered partitions) of n into distinct prime powers (1 excluded).

Original entry on oeis.org

1, 0, 1, 1, 1, 3, 2, 5, 3, 11, 10, 13, 18, 19, 52, 30, 61, 77, 114, 109, 146, 260, 318, 341, 356, 631, 666, 927, 848, 1849, 1978, 2305, 2213, 3560, 4302, 4748, 5588, 6779, 13952, 9044, 15534, 16897, 25084, 20731, 29524, 34882, 49360, 50765, 55112, 106903, 83652, 128552, 106638
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 29 2020

Keywords

Examples

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

Crossrefs

A331982 Number of compositions (ordered partitions) of n into distinct odd squarefree parts.

Original entry on oeis.org

1, 1, 0, 1, 2, 1, 2, 1, 4, 6, 2, 7, 4, 7, 4, 13, 30, 13, 8, 25, 32, 31, 56, 37, 82, 42, 104, 168, 128, 175, 152, 181, 226, 307, 252, 439, 326, 691, 372, 943, 1190, 1069, 1238, 1435, 2056, 1806, 2102, 2185, 3664, 2550, 4480, 3175, 6090, 3781, 7628, 9691
Offset: 0

Views

Author

Ilya Gutkovskiy, Feb 03 2020

Keywords

Examples

			a(8) = 4 because we have [7, 1], [5, 3], [3, 5] and [1, 7].
		

Crossrefs

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