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

A300706 Number of compositions (ordered partitions) of n into squarefree parts that do not divide n.

Original entry on oeis.org

1, 0, 0, 0, 0, 2, 0, 5, 2, 5, 2, 27, 2, 67, 12, 16, 28, 366, 4, 848, 28, 182, 153, 4591, 20, 4172, 554, 2217, 558, 57695, 6, 134118, 3834, 14629, 6972, 97478, 258, 1684852, 24467, 120869, 5308, 9104710, 189, 21165023, 124427, 117017, 297830, 114373157, 3394, 126979537, 72158, 7655405
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 11 2018

Keywords

Examples

			a(18) = 4 because we have [13, 5], [11, 7], [7, 11] and [5, 13].
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    a:= proc(m) option remember; local b; b:= proc(n) option
          remember; `if`(n=0, 1, add(`if`(not issqrfree(j) or
           irem(m, j)=0, 0, b(n-j)), j=2..n)) end; b(m)
        end:
    seq(a(n), n=0..70);  # Alois P. Heinz, Mar 11 2018
  • Mathematica
    Table[SeriesCoefficient[1/(1 - Sum[Boole[Mod[n, k] != 0 && SquareFreeQ[k]] x^k, {k, 1, n}]), {x, 0, n}], {n, 0, 51}]

A286851 Number of compositions (ordered partitions) of n into unitary divisors of n.

Original entry on oeis.org

1, 1, 2, 2, 2, 2, 25, 2, 2, 2, 129, 2, 170, 2, 742, 450, 2, 2, 4603, 2, 1503, 3321, 29967, 2, 9278, 2, 200390, 2, 13460, 2, 154004511, 2, 2, 226020, 9262157, 51886, 127654, 2, 63346598, 2044895, 170354, 2, 185493291001, 2, 1304512, 567124, 2972038875, 2, 59489916, 2, 20367343494, 184947044, 14324735, 2
Offset: 0

Views

Author

Ilya Gutkovskiy, Aug 01 2017

Keywords

Examples

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

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local b, l; l, b:=
          select(x-> igcd(x, n/x)=1, numtheory[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, Aug 01 2017
  • Mathematica
    Join[{1}, Table[d = Divisors[n]; Coefficient[Series[1/(1 - Sum[Boole[GCD[n/d[[k]], d[[k]]] == 1] x^d[[k]], {k, Length[d]}]), {x, 0, n}], x, n], {n, 1, 53}]]
  • Python
    from sympy import divisors, gcd
    from sympy.core.cache import cacheit
    @cacheit
    def a(n):
        l=[x for x in divisors(n) if gcd(x, n//x)==1]
        @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, gcd(d, n/d) = 1} x^d).
a(n) = 2 if n is a prime power (A246655).

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