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.

A060957 Number of different products (including the empty product) of any subset of {1, 2, 3, ..., n}.

Original entry on oeis.org

1, 1, 2, 4, 8, 16, 26, 52, 88, 152, 238, 476, 648, 1296, 2016, 2984, 4232, 8464, 11360, 22720, 30544, 43744, 67072, 134144, 166336, 242752, 370992, 498144, 656832, 1313664, 1581312, 3162624, 3960384, 5517248, 8386080, 11111232, 13065792, 26131584, 39690432
Offset: 0

Views

Author

Jonas Wallgren, May 10 2001

Keywords

Comments

a(n) <= 2*a(n-1), with equality iff n is prime or n = 4. - Martin Fuller, Jun 03 2006
a(n) = 2^k * b(n) where k is the number of primes p such that n/2 < p <= n, and b(n) is the number of different products of subsets of {1, 2, ..., n} that exclude these primes. - David Radcliffe, Feb 11 2019
Conjecture: Let p <= n be prime. If m and p^a*m are two such products, then so is p^k*m for all 0 < k < a. - Yan Sheng Ang, Feb 13 2020
a(n) is even for n > 1. Since k is a product implies that n!/k is a product, a(n) is odd implies that n! is a square, which is impossible for n > 1 because of the Bertrand's postulate: for n > 1, there is a prime p in the range (n/2, n], so p divides n! while p^2 does not. - Jianing Song, Sep 26 2022

Examples

			a(4) = 8: the subsets of {1, 2, 3, 4} are {}, {1}, {2}, {3}, {4}, {1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}, {1, 2, 3}, {1, 2, 4}, {1, 3, 4}, {2, 3, 4}, {1, 2, 3, 4}. The 16 numbers as the product are 1, 1, 2, 3, 4, 2, 3, 4, 6, 8, 12, 6, 8, 12, 24. There are only 8 distinct numbers: 1, 2, 3, 4, 6, 8, 12, 24.
a(6) = 26: the set {1, 2, 3, 4, 5, 6, 2*3, 2*4, 2*5, ..., 5*6, 2*3*4, 2*3*5, ..., 4*5*6, ..., ...2*3*4*5*6} contains 26 different values: {1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 18, 20, 24, 30, 36, 40, 48, 60, 72, 90, 120, 144, 180, 240, 360, 720}
		

Crossrefs

Programs

  • Maple
    s:= proc(n) option remember; `if`(n=0, {1},
          map(x-> [x, x*n][], s(n-1)))
        end:
    a:= n-> nops(s(n)):
    seq(a(n), n=0..25);  # Alois P. Heinz, Aug 25 2016
  • Mathematica
    (* Script not convenient for n > 24 *) a[n_] := Times @@@ Subsets[Range[n]] // Union // Length; Table[Print["a(", n, ") = ", an = a[n]]; an, {n, 1, 24}] (* Jean-François Alcover, Feb 02 2015 *)
    s[n_] := s[n] = If[n == 0, {1}, Map[Function[x, {x, x*n}], s[n-1]]  // Flatten // Union]; a[n_] := Length[s[n]]; Table[an = a[n]; Print[n, " ", an]; an, {n, 0, 30}] (* Jean-François Alcover, Nov 01 2016, after Alois P. Heinz *)
  • Python
    from functools import cache
    @cache
    def s(n): return {1} if n == 0 else s(n-1) | set(x*n for x in s(n-1))
    def a(n): return len(s(n))
    print([a(n) for n in range(30)]) # Michael S. Branicky, Jul 31 2022 after Alois P. Heinz

Extensions

More terms from Lior Manor, May 26 2002
a(26)-a(32) from Giovanni Resta, Feb 14 2006
More terms from Martin Fuller, Jun 03 2006
a(0)=1 and a(37)-a(38) from Alois P. Heinz, Aug 25 2016

A070861 Triangle of all possible distinct numbers obtained as a product of distinct numbers from 1..n.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 6, 1, 2, 3, 4, 6, 8, 12, 24, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 20, 24, 30, 40, 60, 120, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 18, 20, 24, 30, 36, 40, 48, 60, 72, 90, 120, 144, 180, 240, 360, 720, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 15, 18, 20, 21, 24, 28, 30, 35, 36, 40, 42
Offset: 0

Views

Author

Amarnath Murthy, May 16 2002

Keywords

Comments

Factorials are a subsequence (A000142). - Reinhard Zumkeller, Jul 02 2011
More generally, all sequences of positive integers are subsequences. - Charles R Greathouse IV, Mar 06 2017

Examples

			Triangle begins:
  1;
  1;
  1, 2;
  1, 2, 3, 6;
  1, 2, 3, 4, 6, 8, 12, 24;
  ...
		

Crossrefs

Row sums give A070863.
Row products give A283261.

Programs

  • Haskell
    a070861 n = a070861_list !! (n-1)
    a070861_list = concat a070861_tabf
    a070861_tabf = [1] : f 2 [1] where
       f n ps = ps' : f (n+1) ps' where ps' = m ps $ map (n*) ps
       m []         ys = ys
       m xs'@(x:xs) ys'@(y:ys)
           | x < y     = x : m xs ys'
           | x == y    = x : m xs ys
           | otherwise = y : m xs' ys
    b070861 = bFile' "A070861" (concat $ take 20 a070861_tabf) 1
    -- Reinhard Zumkeller, Jul 02 2011
    
  • Maple
    T:= proc(n) option remember; `if`(n=0, 1,
          sort([map(x-> [x, x*n][], {T(n-1)})[]])[])
        end:
    seq(T(n), n=0..7);  # Alois P. Heinz, Aug 01 2022
  • Mathematica
    row[n_] := Times @@@ Subsets[Range[n]] // Flatten // Union; Table[row[n], {n, 1, 20}] // Flatten (* Jean-François Alcover, Feb 02 2015 *)
  • PARI
    row(n)=my(v=[2..n]); Set(vector(2^(n-1),i, factorback(vecextract(v,i-1)))) \\ Charles R Greathouse IV, Mar 06 2017

Formula

T(n,A060957(n)) = A000142(n) = n!. - Alois P. Heinz, Aug 01 2022

Extensions

Corrected and extended by Lior Manor, May 23 2002
Row n=0 prepended by Alois P. Heinz, Aug 01 2022

A283261 Product of the different products of subsets of the set of numbers from 1 to n.

Original entry on oeis.org

1, 1, 2, 36, 331776, 42998169600000000, 13974055172471046820331520000000000000, 1833132881579690383668380351534446872452674453158326975200092938148249600000000000000000000000000
Offset: 0

Views

Author

Jaroslav Krizek, Mar 04 2017

Keywords

Comments

Product of numbers in n-th row of A070861.

Examples

			Rows with subsets of the sets of numbers from 1 to n:
  {},
  {}, {1};
  {}, {1}, {2}, {1, 2};
  {}, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3};
  ...
Rows with the products of elements of these subsets:
  1;
  1, 1;
  1, 1, 2, 2;
  1, 1, 2, 3, 2, 3, 6, 6;
  ...
Rows with the different products of elements of these subsets:
  1;
  1;
  1, 2;
  1, 2, 3, 6;
  ...
a(0) = 1, a(1) = (1), a(2) = (1*2) = 2, a(3) = (1*2*3*6) = 36, ... .
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, {1},
          map(x-> [x, x*n][], b(n-1)))
        end:
    a:= n-> mul(i, i=b(n)):
    seq(a(n), n=0..7);  # Alois P. Heinz, Aug 01 2022
  • Mathematica
    Table[Times @@ Union@ Map[Times @@ # &, Subsets@ Range@ n], {n, 7}] (* Michael De Vlieger, Mar 05 2017 *)
  • PARI
    a(n)=my(v=[2..n]); factorback(Set(vector(2^(n-1),i, factorback(vecextract(v,i-1))))) \\ Charles R Greathouse IV, Mar 06 2017

Formula

a(n) <= n!^((A000005(n!))/2) = n!^(A027423(n)/2). - David A. Corneth, Mar 05 2017
a(n) = n!^(A263292(n)). - David A. Corneth, Mar 06 2017

Extensions

a(0)=1 prepended by Alois P. Heinz, Aug 01 2022
Showing 1-3 of 3 results.