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

A186972 Irregular triangle T(n,k), n>=1, 1<=k<=A186971(n), read by rows: T(n,k) is the number of k-element subsets of {1, 2, ..., n} containing n and having pairwise coprime elements.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 4, 5, 2, 1, 2, 1, 1, 6, 11, 8, 2, 1, 4, 6, 4, 1, 1, 6, 12, 10, 3, 1, 4, 5, 2, 1, 10, 31, 42, 26, 6, 1, 4, 6, 4, 1, 1, 12, 45, 79, 72, 33, 6, 1, 6, 14, 16, 9, 2, 1, 8, 21, 25, 14, 3, 1, 8, 24, 36, 29, 12, 2, 1, 16, 79, 183, 228, 157, 56, 8, 1, 6, 15, 20, 15, 6, 1
Offset: 1

Views

Author

Alois P. Heinz, Mar 01 2011

Keywords

Comments

T(n,k) = 0 for k>A186971(n). The triangle contains all positive values of T.

Examples

			T(5,3) = 5 because there are 5 3-element subsets of {1,2,3,4,5} containing 5 and having pairwise coprime elements: {1,2,5}, {1,3,5}, {1,4,5}, {2,3,5}, {3,4,5}.
Irregular Triangle T(n,k) begins:
  1;
  1, 1;
  1, 2,  1;
  1, 2,  1;
  1, 4,  5, 2;
  1, 2,  1;
  1, 6, 11, 8, 2;
		

Crossrefs

Columns k=1-10 give: A000012, A000010 (for n>1), A185953, A185348, A186976, A186977, A186978, A186979, A186980, A186981.
Rightmost elements of rows give A186994.
Row sums are A186973.
Cf. A186971.

Programs

  • Maple
    with(numtheory):
    s:= proc(m,r) option remember; mul(`if`(in then 0
        elif k=1 then 1
        elif k=2 and t=n then `if`(n<2, 0, phi(n))
        else c:= 0;
             d:= 2-irem(t,2);
             for h from 1 to n-1 by d do
               if igcd(t, h)=1 then c:= c +b(s(t*h, h), h, k-1) fi
             od; c
          fi
    end:
    T:= proc(n,k) option remember; b(s(n,n),n,k) end:
    seq(seq(T(n, k), k=1..a(n)), n=1..20);
  • Mathematica
    s[m_, r_] := s[m, r] = Product[If[i < r, i, 1], {i, FactorInteger[m][[All, 1]]}]; a[n_] := a[n] = If[n < 4, n, PrimePi[n] - Length[FactorInteger[n]]+2]; b[t_, n_, k_] := b[t, n, k] = Module[{c, d, h}, Which[k == 0 || k > n, 0, k == 1, 1, k == 2 && t == n, If[n < 2, 0, EulerPhi[n]], True, c = 0; d = 2-Mod[t, 2]; For[h = 1, h <= n-1, h = h+d, If[GCD[t, h] == 1, c = c+b[s[t*h, h], h, k-1]]]; c]]; t[n_, k_] := t[n, k] = b[s[n, n], n, k]; Table[Table[t[n, k], {k, 1, a[n]}], {n, 1, 20}] // Flatten (* Jean-François Alcover, Dec 17 2013, translated from Maple *)

A186971 Maximal cardinality of a subset of {1, 2, ..., n} containing n and having pairwise coprime elements.

Original entry on oeis.org

1, 2, 3, 3, 4, 3, 5, 5, 5, 4, 6, 5, 7, 6, 6, 7, 8, 7, 9, 8, 8, 8, 10, 9, 10, 9, 10, 9, 11, 9, 12, 12, 11, 11, 11, 11, 13, 12, 12, 12, 14, 12, 15, 14, 14, 14, 16, 15, 16, 15, 15, 15, 17, 16, 16, 16, 16, 16, 18, 16, 19, 18, 18, 19, 18, 17, 20
Offset: 1

Views

Author

Alois P. Heinz, Mar 01 2011

Keywords

Comments

In general there exist different maximal subsets for a given n. One of these is S = {1, n} union ({primes <= n} \ {prime factors of n}). The number of different subsets is A186994(n).
Max { a(i) : i=1..n } = A036234(n).

Examples

			a(4) = 3 because 4 and 2 are not coprime and {1,3,4} is a maximal subset of {1,2,3,4} with pairwise coprime elements.
a(9) = 5, the maximal subsets are {1,2,5,7,9}, {1,4,5,7,9}, {1,5,7,8,9}.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    a:= n-> `if`(n<4, n, pi(n) -nops(factorset(n)) +2):
    seq(a(n), n=1..120);

Formula

a(n) = n if n<4, a(n) = A000720(n) - A001221(n) + 2 else.

A186973 Number of subsets of {1, 2, ..., n} containing n and having pairwise coprime elements; also row sums of A186972.

Original entry on oeis.org

1, 2, 4, 4, 12, 4, 28, 16, 32, 12, 116, 16, 248, 48, 72, 112, 728, 64, 1520, 192, 384, 256, 3872, 256, 3168, 736, 2752, 832, 15488, 256, 31232, 7424, 6272, 4096, 9600, 1792, 91648, 9344, 16000, 5632, 214272, 3072, 431616, 37376, 38912, 43008, 982528
Offset: 1

Views

Author

Alois P. Heinz, Mar 01 2011

Keywords

Examples

			a(6) = 4 because there are 4 subsets of {1,2,3,4,5,6} containing 6 and having pairwise coprime elements: {6}, {1,6}, {5,6}, {1,5,6}.
		

Crossrefs

Cf. A186971, A186972, A186994. Rightmost elements in rows of triangle A186975.

Programs

  • Maple
    with(numtheory):
    s:= proc(m, r) option remember; mul(`if`(i mul(ilog[j](n), j={ithprime(i)$i=1..pi(n)} minus factorset(n)):
    b:= proc(t, n, k) option remember; local c, d, h;
          if k=0 or k>n then 0
        elif k=1 then 1
        elif k=2 and t=n then `if`(n<2, 0, phi(n))
        else c:= 0;
             d:= 2-irem(t, 2);
             for h from 1 to n-1 by d do
               if igcd(t, h)=1 then c:= c +b(s(t*h, h), h, k-1) fi
             end; c
          fi
        end:
    a:= n-> h(n) + add(b(s(n, n), n, k), k=1..g(n)-1):
    seq(a(n), n=1..50);
  • Mathematica
    s[m_, r_] := s[m, r] = Product[If[in, 0, k == 1, 1, k == 2 && t == n, If[n<2, 0, EulerPhi[n]], True, c=0; d=2-Mod[t, 2]; For[h=1, h <= n-1, h=h+d, If[GCD[t, h] == 1, c=c+b[s[t*h, h], h, k-1]]]; c]]; t[n_, k_] := t[n, k] = b[s[n, n], n, k]; Table[Sum[t[n, k], {k, 1, a[n]}], {n, 1, 50}] (* Jean-François Alcover, Dec 04 2014, after Alois P. Heinz *)

A187092 Number of nonempty subsets S of {1, 2, ..., n} with pairwise coprime elements that are maximal with respect to inclusion of elements < max(S).

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 9, 10, 13, 15, 21, 22, 28, 30, 33, 35, 43, 44, 52, 54, 58, 60, 68, 69, 77, 81, 89, 95, 119, 120, 144, 150, 160, 166, 181, 183, 213, 219, 229, 232, 262, 264, 294, 300, 305, 311, 341, 343, 373, 379, 399, 411, 471, 475, 505, 511, 531
Offset: 1

Views

Author

Alois P. Heinz, Mar 04 2011

Keywords

Examples

			a(8) = 10; all nonempty subsets S of {1, 2, ..., 8} with pairwise coprime elements that are maximal with respect to inclusion of elements < max(S) are: {1}, {1,2}, {1,2,3}, {1,3,4}, {1,5,6}, {1,2,3,5}, {1,3,4,5}, {1,2,3,5,7}, {1,3,4,5,7}, {1,3,5,7,8}.
		

Crossrefs

Partial sums of A186994.

Programs

  • Maple
    with(numtheory):
    b:= n-> mul(ilog[j](n), j={ithprime(i)$i=1..pi(n)} minus factorset(n)):
    a:= proc(n) option remember; b(n) +`if`(n<2, 0, a(n-1)) end:
    seq(a(n), n=1..80);
  • Mathematica
    b[n_] := Product[Log[p, n] // Floor, {p, Select[Range[n-1], PrimeQ[#] && GCD[n, #] == 1&]}];
    A187092 = Array[b, 100] // Accumulate (* Jean-François Alcover, Mar 27 2017, adapted from Maple *)

A319187 Number of pairwise coprime subsets of {1,...,n} of maximum cardinality (A036234).

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 2, 3, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 16, 16, 24, 24, 24, 24, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 72, 72, 72, 72, 72, 72, 72, 72
Offset: 1

Views

Author

Gus Wiseman, Jan 09 2019

Keywords

Comments

Two or more numbers are pairwise coprime if no pair of them has a common divisor > 1. A single number is not considered to be pairwise coprime unless it is equal to 1.

Examples

			The a(8) = 3 subsets are {1,2,3,5,7}, {1,3,4,5,7}, {1,3,5,7,8}.
		

Crossrefs

Rightmost terms of A186974 and A320436.
Run lengths are A053707.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n],{PrimePi[n]+1}],CoprimeQ@@#&]],{n,24}] (* see A186974 for a faster program *)
  • PARI
    a(n) = prod(p=1, n, if (isprime(p), logint(n, p), 1)); \\ Michel Marcus, Dec 26 2020

Formula

a(n) = Product_{p prime <= n} floor(log_p(n)).
a(n) = A000005(A045948(n)). - Ridouane Oudra, Sep 02 2019
Showing 1-5 of 5 results.