login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 10
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 (list; graph; refs; listen; history; internal format)
OFFSET

1,3

COMMENTS

If n is a perfect number then a(n) = 0. But if a(n) = 0, n need not be perfect, e.g. a(24) = 0, but 24 is not a perfect number. Also 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.

LINKS

Nathaniel Johnston, Table of n, a(n) for n = 1..10000

EXAMPLE

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.

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(m<d[j+1])then return m:fi:od:end: # Nathaniel Johnston, Apr 15 2011

MATHEMATICA

subtract = If[ #1 < #2, Throw[ #1], #1 - #2]&; f[n_] := Catch @ Fold[subtract, n, Divisors @ n] (from Bobby R. Treat, (DrBob(AT)bigfoot.com), Jul 14 2005)

Table[ f[n], {n, 80}] (from Robert G. Wilson v (rgwv(AT)rgwv.com), Jul 14 2005)

CROSSREFS

Cf. A064510, A109884, A109886.

Sequence in context: A158032 A120112 A103977 * A033880 A033879 A033883

Adjacent sequences:  A109880 A109881 A109882 * A109884 A109885 A109886

KEYWORD

easy,nonn

AUTHOR

Amarnath Murthy (amarnath_murthy(AT)yahoo.com), Jul 11 2005

EXTENSIONS

More terms from Jason Earls (zevi_35711(AT)yahoo.com) and Robert G. Wilson v (rgwv(AT)rgwv.com), Jul 12 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 14 07:46 EST 2012. Contains 205597 sequences.