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.

A064510 Numbers m such that the sum of the first k divisors of m is equal to m for some k.

Original entry on oeis.org

1, 6, 24, 28, 496, 2016, 8128, 8190, 42336, 45864, 392448, 714240, 1571328, 33550336, 61900800, 91963648, 211891200, 1931236608, 2013143040, 4428914688, 8589869056, 10200236032, 137438691328, 214204956672
Offset: 1

Views

Author

Jonathan Ayres (jonathan.ayres(AT)btinternet.com), Oct 06 2001

Keywords

Comments

Obviously all perfect numbers are included in this sequence.
a(25) > 5*10^11. Other than perfect numbers, 104828758917120, 916858574438400, 967609154764800, 93076753068441600, 215131015678525440 and 1371332329173024768 are also terms. - Donovan Johnson, Dec 26 2012
a(25) > 10^12. - Giovanni Resta, Apr 15 2017

Examples

			Divisors of 24 are 1, 2, 3, 4, 6, 8, 12 and 24. 1+2+3+4+6+8 = 24.
		

Crossrefs

Programs

  • Mathematica
    subtract = If[ #1 < #2, Throw[ #1], #1 - #2]&; f[n_] := Catch @ Fold[subtract, n, Divisors @ n]; lst = {}; Do[ If[ f[n] == 0, AppendTo[lst, n]], {n, 10^8}]; lst (* Bobby R. Treat and Robert G. Wilson v, Jul 14 2005 *)
    Select[Range[2000000],MemberQ[Accumulate[Divisors[#]],#]&] (* Harvey P. Dale, Mar 22 2012 *)
  • PARI
    isok(n) = {my(d = divisors(n)); my(k = 1); while ((k <= #d) && ((sd = sum(j=1, k, d[j])) != n), k++;); (sd == n);} \\ Michel Marcus, Jan 16 2014

Extensions

More terms from Don Reble, Dec 17 2001
a(19)-a(23) from Donovan Johnson, Aug 31 2008
a(24) from Donovan Johnson, Aug 11 2011

A109883 Start subtracting from n its divisors beginning from 1 until one reaches a number smaller than the last divisor subtracted or reaches the last nontrivial divisor < n. Define this to be the perfect deficiency of n. Then a(n) = perfect deficiency of n.

Original entry on oeis.org

0, 1, 2, 1, 4, 0, 6, 1, 5, 2, 10, 2, 12, 4, 6, 1, 16, 6, 18, 8, 10, 8, 22, 0, 19, 10, 14, 0, 28, 3, 30, 1, 18, 14, 22, 11, 36, 16, 22, 10, 40, 9, 42, 4, 12, 20, 46, 12, 41, 7, 30, 6, 52, 15, 38, 20, 34, 26, 58, 2, 60, 28, 22, 1, 46, 21, 66, 10, 42, 31, 70, 9, 72, 34, 26, 12, 58, 27, 78
Offset: 1

Views

Author

Amarnath Murthy, Jul 11 2005

Keywords

Comments

If n is a perfect number then a(n) = 0. But if a(n) = 0, n needs not be perfect, e.g., a(24) = 0, but 24 is not a perfect number. See A064510.

Examples

			a(14) = 4: 14-1 = 13, 13-2 = 11, 11-7 = 4.
a(6) = 0: 6-1 = 5, 5-2 = 3, 3-3 = 0. 6 is a perfect number.
a(35) = 22: 35-1 = 34, 34-5 = 29, 29-7 = 22.
		

Crossrefs

Programs

  • Maple
    A109883:=proc(n)local d,j,k,m:if(n=1)then return 0:fi:j:=1:m:=n:d:=divisors(n);k:=nops(d):for j from 1 to k do m:=m-d[j]:if(mNathaniel Johnston, Apr 15 2011
  • Mathematica
    subtract = If[ #1 < #2, Throw[ #1], #1 - #2]&;
    a[n_] := Catch @ Fold[subtract, n, Divisors @ n]
    Table[ a[n], {n, 80}] (* Bobby R. Treat (DrBob(AT)bigfoot.com), Jul 14 2005 *)
  • PARI
    a(n) = {my(r = n); fordiv(n, d, if (r < d, return (r)); r -= d;); 0;} \\ Michel Marcus, Dec 28 2018
    
  • Python
    from sympy import divisors
    def A109883(n):
        if n == 1: return 0
        s = n
        for d in divisors(n)[:-1]:
            if s < d: break
            s -= d
        return s
    print([A109883(n) for n in range(1, 80)]) # Michael S. Branicky, Mar 31 2024

Formula

a(1) = 0, a(2^n) = 1.
a(p) = p-1, a(p^n) = (p^(n+1) - 2*p^n + 1)/(p-1), if p is a prime.
a(n) = n - A117552(n). - Ridouane Oudra, Jan 25 2024

Extensions

More terms from Jason Earls and Robert G. Wilson v, Jul 12 2005

A109886 Index of first occurrence of n in A109883, or -1 if n does not occur in A109883.

Original entry on oeis.org

1, 2, 3, 30, 5, 9, 7, 50, 20, 42, 11, 36, 13, 6510, 27, 54, 17, 70620, 19, 25, 46, 66, 23, 168630, 124, 98, 58, 78, 29
Offset: 0

Views

Author

Amarnath Murthy, Jul 11 2005

Keywords

Comments

Sequence continues: a(29)=??, a(30)=??, 31, 70, 112, 100, 57, 200, 37, 484, 55, 102, 41, 49, 43, a(44)=??, 94, 114, 47, 225, 1264, 252, 104, 294, 53, 780, 87, 71940, 118, 138, 59, 4290, 61, 1470, 85, 306, 134, a(66)=??, 67, 6300, 142, 288, 71, 324, 73, a(74)=??, 712, 174, 158, 2940, 79, a(80)=??, 166, 186, 83, 1344210, 405, 242, 115, 1590, 89, a(90)=??, 141, 196, 406, 540, 119, 2310, 97, 390, 202, 222, ..., . - Jason Earls and Robert G. Wilson v, Jul 12 2005
Smallest number N with perfect deficiency n, that is, the first number such that A109883(N)=n. - Walter Kehowski, Sep 13 2005
a(29) > 10^9 if it exists. - Michel Marcus, Mar 30 2024

Examples

			a(7) = 50: divisors of 50 are 1,2,5,10,25,50; 50 - (1 + 2 + 5 + 10 + 25) = 7 and 50 is the smallest such number.
		

Crossrefs

Programs

  • Maple
    with(numtheory); pdef := proc(n) local k, d, divd; d:=n; divd:=sort([op(divisors(n))]); for k in divd while d>=k do d:=d-k; od; end: PDL:=[]; for z from 1 to 1 do for pd from 0 to 60 do for n from 1 to 200000 do missed:=true; if pdef(n)=pd then PDL:=[op(PDL),n]; missed:=false; break fi od; if missed then PDL:=[op(PDL),-1] fi od od; PDL; # Walter Kehowski, Sep 13 2005
  • Mathematica
    subtract = If[ #1 < #2, Throw[ #1], #1 - #2]&; f[n_] := Catch @ Fold[subtract, n, Divisors @ n] (* Bobby R. Treat, (DrBob(AT)bigfoot.com), Jul 14 2005 *)
    t = Table[0, {60}]; Do[ a = f[n]; If[a < 60 && t[[a + 1]] == 0, t[[a + 1]] = n], {n, 10^8}] (* Robert G. Wilson v, Jul 14 2005 *)

Extensions

Corrected and extended by Jason Earls, Jul 12 2005
More terms from Walter Kehowski, Sep 13 2005
Showing 1-3 of 3 results.