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

A225561 Largest number m such that 1, 2, ..., m can be represented as the sum of distinct divisors of n.

Original entry on oeis.org

1, 3, 1, 7, 1, 12, 1, 15, 1, 3, 1, 28, 1, 3, 1, 31, 1, 39, 1, 42, 1, 3, 1, 60, 1, 3, 1, 56, 1, 72, 1, 63, 1, 3, 1, 91, 1, 3, 1, 90, 1, 96, 1, 7, 1, 3, 1, 124, 1, 3, 1, 7, 1, 120, 1, 120, 1, 3, 1, 168, 1, 3, 1, 127, 1, 144, 1, 7, 1, 3, 1, 195, 1, 3, 1, 7, 1, 168, 1, 186, 1, 3
Offset: 1

Views

Author

Keywords

Comments

n is called a practical number (A005153) if a(n) >= n.

Crossrefs

Programs

  • Haskell
    see Haskell link, 3.2.2
    a225561 n = length $ takeWhile (not . null) $
                map (ps [] $ a027750_row n) [1..] where
       ps qs _      0  = [qs]
       ps   []       = []
       ps qs (k:ks) m  =
          if m == 0 then [] else ps (k:qs) ks (m - k) ++ ps qs ks m
    -- Reinhard Zumkeller, May 11 2013
    
  • Mathematica
    a[n_] := First[Complement[Range[DivisorSigma[1, n] + 1], Total /@ Subsets[Divisors[n]]]] - 1; Array[a, 100] (* Jean-François Alcover, Sep 27 2018 *)
    f[p_, e_] := (p^(e + 1) - 1)/(p - 1); g[n_] := If[(ind = Position[(fct = FactorInteger[n])[[;; , 1]]/(1 + FoldList[Times, 1, f @@@ Most@fct]), ?(# > 1 &)]) == {}, n, Times @@ (Power @@@ fct[[1 ;; ind[[1, 1]] - 1]])]; a[n] := DivisorSigma[1, g[n]]; Array[a, 100] (* Amiram Eldar, Sep 27 2019 *)
  • PARI
    a(n)=my(d=divisors(n),t,v=vector(2^#d-1,i,t=vecextract(d,i); sum(j=1,#t,t[j]))); v=vecsort(v,,8); for(i=1,#v,if(v[i]!=i,return(i-1)));v[#v]
    
  • Python
    from sympy import divisors
    def A225561(n):
        c = {0}
        for d in divisors(n,generator=True):
            c |=  {a+d for a in c}
        k = 1
        while k in c:
            k += 1
        return k-1 # Chai Wah Wu, Jul 05 2023

Formula

a(n) = 1 if and only if n is odd. a(n) = 3 if and only if n in {2,10} mod 12. Otherwise a(n) >= 7.
a(n) = A030057(n)-1.
a(n) = A000203(A327832(n)). - Amiram Eldar, Sep 27 2019

A327832 The practical component of n: the largest divisor of n which is a practical number (A005153).

Original entry on oeis.org

1, 2, 1, 4, 1, 6, 1, 8, 1, 2, 1, 12, 1, 2, 1, 16, 1, 18, 1, 20, 1, 2, 1, 24, 1, 2, 1, 28, 1, 30, 1, 32, 1, 2, 1, 36, 1, 2, 1, 40, 1, 42, 1, 4, 1, 2, 1, 48, 1, 2, 1, 4, 1, 54, 1, 56, 1, 2, 1, 60, 1, 2, 1, 64, 1, 66, 1, 4, 1, 2, 1, 72, 1, 2, 1, 4, 1, 78, 1, 80, 1
Offset: 1

Views

Author

Amiram Eldar, Sep 27 2019

Keywords

Comments

From Andreas Weingartner, Jun 30 2021: (Start)
Let r_m be the natural density of the set of integers n with a(n) = m. Then r_m is positive if and only if m is practical. In that case, r_m = (1/m)*P_m, where P_m is the product of (1-1/p) over primes p <= sigma(m) + 1 (see Cor. 1 of Weingartner 2015). The first few values of (m, r_m) are (1, 1/2), (2, 1/6), (4, 2/35), (6, 32/1001), (8, 24/1001), (12, 36864/2800733), ...
As y grows, the natural density of integers n, which satisfy a(n) > y, is asymptotic to c*exp(-gamma)/log(y), where c = 1.33607... is the constant factor in the asymptotic for the count of practical numbers (A005153) and gamma = 0.577215... is Euler's constant (see Eq. (3) of Weingartner (2015)). For example, about 1% of integers n satisfy a(n) > exp(75), because c*exp(-gamma)/75 = 0.010... (End)

Examples

			a(22) = 2 since the divisors of 22 are {1, 2, 11, 22}, of them {1, 2} are practical, and 2 being the largest.
		

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := (p^(e + 1) - 1)/(p - 1); a[n_] := If[(ind = Position[(fct = FactorInteger[n])[[;; , 1]]/(1 + FoldList[Times, 1, f @@@ Most@fct]), _?(# > 1 &)]) == {}, n, Times @@ (Power @@@ fct[[1 ;; ind[[1, 1]] - 1]])]; Array[a, 100]
  • PARI
    \\ using is_A005153
    a(n) = fordiv(n, d, if(is_A005153(n/d), return(n/d))); \\ Michel Marcus, Jul 03 2021

Formula

If n = Product_{i=1..r} p_i^e_i, then define n_0 = 1, n_j = Product_{i=1..j} p_i^e_i. a(n) = n_j where j is the first index for which p_{j+1} > sigma(n_j) + 1, or j = r if no such index exists.
A number n is practical if and only if a(n) = n.
a(n) = 1 if and only if n is odd.
A000203(a(n)) = A225561(n).
Showing 1-2 of 2 results.