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.

A045778 Number of factorizations of n into distinct factors greater than 1.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 2, 2, 1, 3, 1, 3, 2, 2, 1, 5, 1, 2, 2, 3, 1, 5, 1, 3, 2, 2, 2, 5, 1, 2, 2, 5, 1, 5, 1, 3, 3, 2, 1, 7, 1, 3, 2, 3, 1, 5, 2, 5, 2, 2, 1, 9, 1, 2, 3, 4, 2, 5, 1, 3, 2, 5, 1, 9, 1, 2, 3, 3, 2, 5, 1, 7, 2, 2, 1, 9, 2, 2, 2, 5, 1, 9, 2, 3, 2, 2, 2, 10, 1, 3, 3, 5, 1, 5, 1, 5
Offset: 1

Views

Author

Keywords

Comments

This sequence depends only on the prime signature of n and not on the actual value of n.
Also the number of strict multiset partitions (sets of multisets) of the prime factors of n. - Gus Wiseman, Dec 03 2016
Number of sets of integers greater than 1 whose product is n. - Antti Karttunen, Feb 20 2024

Examples

			24 can be factored as 24, 2*12, 3*8, 4*6, or 2*3*4, so a(24) = 5. The factorization 2*2*6 is not permitted because the factor 2 is present twice. a(1) = 1 represents the empty factorization.
		

Crossrefs

Cf. A036469, A114591, A114592, A316441 (Dirichlet inverse).
Cf. A156648 (2*Dgf at s=2), A073017 (2*Dgf at s=3), A258870 (2*Dgf at s=4).
Cf. also A069626 (Number of sets of integers > 1 whose least common multiple is n).
Cf. A287549 (partial sums).

Programs

  • APL
    ⍝ Dyalog dialect
    divisors ← {ð←⍵{(0=⍵|⍺)/⍵}⍳⌊⍵*÷2 ⋄ 1=⍵:ð ⋄ ð, (⍵∘÷)¨(⍵=(⌊⍵*÷2)*2)↓⌽ð}
    A045778 ← { D←1↓divisors(⍵) ⋄ T←(⍴D)⍴2 ⋄ +/⍵⍷{×/D/⍨T⊤⍵}¨(-∘1)⍳2*⍴D } ⍝ (simple, but a memory hog)
    A045778 ← { ⍺←⌽divisors(⍵) ⋄ 1=⍵:1 ⋄ 0=≢⍺:0 ⋄ R←⍺↓⍨⍺⍳⍵∘÷ ⋄ Ð←{⍺/⍨0=⍺|⍵} ⋄ +/(((R)Ð⊢)∇⊢)¨(⍵∘÷)¨⍺ } ⍝ (more efficient) - Antti Karttunen, Feb 20 2024
  • Maple
    with(numtheory):
    b:= proc(n, k) option remember;
          `if`(n>k, 0, 1) +`if`(isprime(n), 0,
          add(`if`(d>k, 0, b(n/d, d-1)), d=divisors(n) minus {1, n}))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=1..120);  # Alois P. Heinz, May 26 2013
  • Mathematica
    gd[m_, 1] := 1; gd[1, n_] := 0; gd[1, 1] := 1; gd[0, n_] := 0; gd[m_, n_] := gd[m, n] = Total[gd[# - 1, n/#] & /@ Select[Divisors[n], # <= m &]]; Array[ gd[#, #] &, 100]  (* Alexander Adam, Dec 28 2012 *)
  • PARI
    v=vector(100,k,k==1); for(n=2,#v, v+=dirmul(v,vector(#v,k,k==n)) ); v /* Max Alekseyev, Jul 16 2014 */
    
  • PARI
    A045778(n, k=n) = ((n<=k) + sumdiv(n, d, if(d > 1 && d <= k && d < n, A045778(n/d, d-1)))); \\ After Alois P. Heinz's Maple-code by Antti Karttunen, Jul 23 2017, edited Feb 20 2024
    
  • PARI
    A045778(n, m=n) = if(1==n, 1, sumdiv(n,d,if((d>1)&&(d<=m),A045778(n/d,d-1)))); \\ Antti Karttunen, Feb 20 2024
    
  • Python
    from sympy.core.cache import cacheit
    from sympy import divisors, isprime
    @cacheit
    def b(n, k): return (0 if n>k else 1) + (0 if isprime(n) else sum(0 if d>k else b(n//d, d - 1) for d in divisors(n)[1:-1]))
    def a(n): return b(n, n)
    print([a(n) for n in range(1, 121)]) # Indranil Ghosh, Aug 19 2017, after Maple code
    

Formula

Dirichlet g.f.: Product_{n>=2} (1 + 1/n^s).
Let p and q be two distinct prime numbers and k a natural number. Then a(p^k) = A000009(k) and a(p^k*q) = A036469(k). - Alexander Adam, Dec 28 2012
Let p_i with 1<=i<=k k distinct prime numbers. Then a(Product_{i=1..k} p_i) = A000110(k). - Alexander Adam, Dec 28 2012

Extensions

Edited by Franklin T. Adams-Watters, Jun 04 2009

A076078 a(n) is the number of nonempty sets of distinct positive integers that have a least common multiple of n.

Original entry on oeis.org

1, 2, 2, 4, 2, 10, 2, 8, 4, 10, 2, 44, 2, 10, 10, 16, 2, 44, 2, 44, 10, 10, 2, 184, 4, 10, 8, 44, 2, 218, 2, 32, 10, 10, 10, 400, 2, 10, 10, 184, 2, 218, 2, 44, 44, 10, 2, 752, 4, 44, 10, 44, 2, 184, 10, 184, 10, 10, 2, 3748, 2, 10, 44, 64, 10, 218, 2, 44, 10, 218, 2, 3392, 2, 10
Offset: 1

Views

Author

Amarnath Murthy, Oct 05 2002

Keywords

Comments

a(n)=1 iff n=1, a(p^k)=2^k, a(p*q)=10; where p & q are unique primes. a(n) cannot equal an odd number >1. - Robert G. Wilson v
If m has more divisors than n, then a(m) > a(n). - Matthew Vandermast, Aug 22 2004
If n is of the form p^r*q^s where p & q are distinct primes and r & s are nonnegative integers then a(n)=2^(rs)*(2^(r+s+1) -2^r-2^s+1); for example f(1400846643)=f(3^5*7^8)=2^(5*8)*(2^ (5+8+1)-2^5-2^8+1)=17698838672310272. Also if n=p_1^r_1*p_2^r_2*...*p_k^r_k where p_1,p_2,...,p_k are distinct primes and r_1,r_2,...,r_k are natural numbers then 2^(r_1*r_2*...*r_k)||a(n). - Farideh Firoozbakht, Aug 06 2005
None of terms is divisible by Mersenne numbers 3 or 7. For any n, a(n) is congruent to A008836(n) mod 3. Since A008836(n) is always 1 or -1, this implies that A000225(2)=3 never divides a(n). - Matthew Vandermast, Oct 12 2010
There are terms divisible by larger Mersenne numbers. For example, a(2*3*5*7*11*13*19*23^3) is divisible by 31. - Max Alekseyev, Nov 18 2010

Examples

			a(6) = 10. The sets with LCM 6 are {6}, {1,6}, {2,3}, {2,6}, {3,6}, {1,2,3}, {1,2,6}, {1,3,6}, {2,3,6}, {1,2,3,6}.
		

Crossrefs

Programs

  • Maple
    with(numtheory): seq(add(mobius(n/d)*(2^tau(d)-1), d in divisors(n)), n=1..80); # Ridouane Oudra, Mar 12 2024
  • Mathematica
    f[n_] := Block[{d = Divisors[n]}, Plus @@ (MoebiusMu[n/d](2^DivisorSigma[0, d] - 1))]; Table[ f[n], {n, 75}] (* Robert G. Wilson v *)
  • PARI
    a(n) = local(f, l, s, t, q); f = factor(n); l = matsize(f)[1]; s = 0; forvec(v = vector(l, i, [0, 1]), q = sum(i = 1, l, v[i]); t = (-1)^(l - q)*2^prod(i = 1, l, f[i, 2] + v[i]); s += t); s; \\ Definition corrected by David Wasserman, Dec 26 2007

Formula

2^d(n) - 1 = Sum_{m|n} a(m), where d(n) = A000005(n) is the number of divisors of n, so a(n) = Sum_{m|n} mu(n/m)*(2^d(m) - 1).
a(n) = 2*A069626(n), for n > 1. - Ridouane Oudra, Mar 12 2024

Extensions

Edited by Dean Hickerson, Oct 08 2002
Definition corrected by David Wasserman, Dec 26 2007
Edited by Charles R Greathouse IV, Aug 02 2010
Edited by Max Alekseyev, Nov 18 2010

A286518 Number of finite connected sets of positive integers greater than one with least common multiple n.

Original entry on oeis.org

1, 1, 1, 2, 1, 4, 1, 4, 2, 4, 1, 20, 1, 4, 4, 8, 1, 20, 1, 20, 4, 4, 1, 88, 2, 4, 4, 20, 1, 96, 1, 16, 4, 4, 4, 196, 1, 4, 4, 88, 1, 96, 1, 20, 20, 4, 1, 368, 2, 20, 4, 20, 1, 88, 4, 88, 4, 4, 1, 1824, 1, 4, 20, 32, 4, 96, 1, 20, 4, 96, 1, 1688, 1, 4, 20, 20, 4, 96, 1, 368, 8, 4, 1, 1824, 4, 4, 4, 88, 1, 1824, 4, 20
Offset: 1

Views

Author

Gus Wiseman, Jul 24 2017

Keywords

Comments

Given a finite set S of positive integers greater than one, let G(S) be the simple labeled graph with vertex set S and edges between any two vertices that are not relatively prime. For example, G({6,14,15,35}) is a 4-cycle. A set S is said to be connected if G(S) is a connected graph.
a(n) depends only on prime signature of n (cf. A025487). - Antti Karttunen, Feb 17 2024

Examples

			The a(6)=4 sets are: {6}, {2,6}, {3,6}, {2,3,6}.
		

Crossrefs

Programs

  • Mathematica
    zsm[s_]:=With[{c=Select[Tuples[Range[Length[s]],2],And[Less@@#,GCD@@s[[#]]]>1&]},If[c==={},s,zsm[Union[Append[Delete[s,List/@c[[1]]],LCM@@s[[c[[1]]]]]]]]];
    Table[Length[Select[Subsets[Rest[Divisors[n]]],zsm[#]==={n}&]],{n,2,20}]
  • PARI
    isconnected(facs) = { my(siz=length(facs)); if(1==siz,1,my(m=matrix(siz,siz,i,j,(gcd(facs[i],facs[j])!=1))^siz); for(n=1,siz,if(0==vecmin(m[n,]),return(0))); (1)); };
    A286518aux(n, parts, from=1, ss=List([])) = { my(k = #parts, s=0, newss); if(lcm(Vec(ss))==n && isconnected(ss), s++); for(i=from, k, newss = List(ss); listput(newss, parts[i]); s += A286518aux(n, parts, i+1, newss)); (s) };
    A286518(n) = if(1==n, n, A286518aux(n, divisors(n))); \\ Antti Karttunen, Feb 17 2024

Formula

From Antti Karttunen, Feb 17 2024: (Start)
a(n) <= A069626(n).
It seems that a(n) >= A318670(n), for all n > 1.
(End)

Extensions

Term a(1)=1 prepended and more terms added by Antti Karttunen, Feb 17 2024

A317624 Number of integer partitions of n where all parts are > 1 and whose LCM is n.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 5, 1, 1, 1, 17, 1, 1, 1, 7, 1, 60, 1, 1, 1, 1, 1, 76, 1, 1, 1, 55, 1, 105, 1, 11, 10, 1, 1, 187, 1, 6, 1, 13, 1, 30, 1, 111, 1, 1, 1, 5043, 1, 1, 15, 1, 1, 230, 1, 17, 1, 242, 1, 4173, 1, 1, 12, 19, 1
Offset: 0

Views

Author

Gus Wiseman, Aug 01 2018

Keywords

Examples

			The a(20) = 5 partitions are (20), (10,4,4,2), (10,4,2,2,2), (5,5,4,4,2), (5,5,4,2,2,2).
The a(45) = 10 partitions:
  (45),
  (15,15,9,3,3), (15,9,9,9,3),
  (15,9,9,3,3,3,3), (15,9,5,5,5,3,3), (9,9,9,5,5,5,3),
  (15,9,3,3,3,3,3,3,3), (9,9,5,5,5,3,3,3,3), (9,5,5,5,5,5,5,3,3),
  (9,5,5,5,3,3,3,3,3,3,3).
From _David A. Corneth_, Sep 08 2018: (Start)
Let sum(t) denote the sum of elements of a tuple t. The tuples t with distinct divisors of 45 that have lcm(t) = 45 and sum(t) <= 45 are {(45) and (3, 9, 15), (3, 5, 9, 15), (3, 5, 9), (5, 9), (9, 15), (5, 9, 15)}. For each such tuple t, find the number of partitions of 45 - s(t) into distinct parts of t.
For the tuple (45), there is 1 partition of 45 - 45 = 0 into parts with 45. That is: {()}.
For the tuple (3, 9, 15), there are 4 partitions of 45 - (3 + 9 + 15) = 18 into parts with 3, 9 and 15. They are {(3, 15), (9, 9), (3, 3, 3, 9), (3, 3, 3, 3, 3, 3)}.
For the tuple (3, 5, 9), there are 4 partitions of 45 - (3 + 5 + 9) = 28 into parts with 3, 5 and 9; they are {(5, 5, 9, 9), (3, 3, 3, 5, 5, 9), (3, 5, 5, 5, 5, 5), (3, 3, 3, 3, 3, 3, 5, 5)}.
For the tuple (3, 5, 9, 15), there is 1 partition of 45 - (3 + 5 + 9 + 15) = 13 into parts with 3, 5, 9 and 15. That is (3, 5, 5).
The other tuples, (5, 9), (9, 15), and (5, 9, 15); they give no extra tuples. That's because there is no solution to the Diophantine equation for 5x + 9y = 45 - (5 + 9), corresponding to the tuple (5, 9) with nonnegative x, y.
That also excludes (9, 15); if there is a solution for that, there would also be a solution for (5, 9). This could whittle down the number of seeds even further. Similarly, (5, 9, 15) gives no solution.
Therefore a(45) = 1 + 4 + 4 + 1 = 10.
(End)
In general, there are A318670(n) (<= A069626(n)) such seed sets of divisors where to start extending the partition from. (See the second PARI program which uses subroutine toplevel_starting_sets.) - _Antti Karttunen_, Sep 08 2018
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],And[Min@@#>=2,LCM@@#==n]&]],{n,30}]
  • PARI
    strong_divisors_reversed(n) = vecsort(select(x -> (x>1), divisors(n)), , 4);
    partitions_into_lcm(orgn,n,parts,from=1,m=1) = if(!n,(m==orgn),my(k = #parts, s=0); for(i=from,k,if(parts[i]<=n, s += partitions_into_lcm(orgn,n-parts[i],parts,i,lcm(m,parts[i])))); (s));
    A317624(n) = if(n<=1,0,partitions_into_lcm(n,n,strong_divisors_reversed(n))); \\ Antti Karttunen, Sep 07 2018
    
  • PARI
    strong_divisors_reversed(n) = vecsort(select(x -> (x>1), divisors(n)), , 4);
    partitions_into(n,parts,from=1) = if(!n,1, if(#parts==from, (0==(n%parts[from])), my(s=0); for(i=from,#parts,if(parts[i]<=n, s += partitions_into(n-parts[i],parts,i))); (s)));
    toplevel_starting_sets(orgn,n,parts,from=1,ss=List([])) = { my(k = #parts, s=0, newss); if(lcm(Vec(ss))==orgn,s += partitions_into(n,ss)); for(i=from,k,if(parts[i]<=n, newss = List(ss); listput(newss,parts[i]); s += toplevel_starting_sets(orgn,n-parts[i],parts,i+1,newss))); (s) };
    A317624(n) = if(n<=1,0,toplevel_starting_sets(n,n,strong_divisors_reversed(n))); \\ Antti Karttunen, Sep 08-10 2018

A318670 Number of subsets of divisors of n whose least common multiple is n and the sum does not exceed n. For n > 1, 1 is excluded from the set of divisors.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 5, 1, 2, 2, 1, 1, 6, 1, 6, 2, 2, 1, 17, 1, 2, 1, 7, 1, 34, 1, 1, 2, 2, 2, 44, 1, 2, 2, 23, 1, 36, 1, 7, 7, 2, 1, 65, 1, 7, 2, 7, 1, 21, 2, 25, 2, 2, 1, 471, 1, 2, 7, 1, 2, 39, 1, 7, 2, 44, 1, 355, 1, 2, 7, 7, 2, 39, 1, 89, 1, 2, 1, 531, 2, 2, 2, 27, 1, 559, 2, 7, 2, 2, 2, 257, 1, 7, 7, 61, 1, 39, 1, 28, 46
Offset: 1

Views

Author

Keywords

Comments

These count the "starter sets" employed by a simple backtracking algorithm that computes A317624. See the PARI program dated Sep 08-10 2018 under that entry.

Examples

			For n = 45, there exists the following subsets of its divisors larger than one (3, 5, 9, 15, 45) that satisfy the condition that the least common multiple of the members is 45, and the sum does not exceed 45: (45), (3, 9, 15), (3, 5, 9, 15), (3, 5, 9), (5, 9), (9, 15) and (5, 9, 15), altogether seven subsets, thus a(45) = 7.
		

Crossrefs

Programs

  • PARI
    A318670(n) = if(1==n,1,my(ds=(divisors(n)[2..numdiv(n)]), subsets = select(v -> ((vecsum(v)<=n)&&(n==lcm(v))),powerset(ds))); length(subsets)); \\ A memory-hog implementation.
    powerset(v) = { my(siz=2^length(v),pv=vector(siz)); for(i=0,siz-1,pv[i+1] = choosebybits(v,i)); pv; };
    choosebybits(v,m) = { my(s=vector(hammingweight(m)),i=j=1); while(m>0,if(m%2,s[j] = v[i];j++); i++; m >>= 1); s; };  \\ Antti Karttunen, Sep 08 2018
    
  • PARI
    \\ A better program:
    strong_divisors_reversed(n) = vecsort(select(x -> (x>1), divisors(n)), , 4);
    A318670aux(orgn,n,parts,from=1,ss=List([])) = { my(k = #parts, s=0, newss); if(lcm(Vec(ss))==orgn,s++); for(i=from,k,if(parts[i]<=n, newss = List(ss); listput(newss,parts[i]); s += A318670aux(orgn,n-parts[i],parts,i+1,newss))); (s) };
    A318670(n) = if(1==n,n,A318670aux(n,n,strong_divisors_reversed(n))); \\ Antti Karttunen, Sep 08 2018

Formula

a(n) <= A069626(n).
For all n >= 1:
a(A000961(n)) = 1.
a(A006881(n)) = 2.
Showing 1-5 of 5 results.