|
| |
|
|
A103977
|
|
Let d_1 ... d_k be the divisors of n. Then a(n) = min_{ e_1 = +-1, ... e_k = +-1 } | Sum_i e_i d_i |
|
|
3
| |
|
|
1, 1, 2, 1, 4, 0, 6, 1, 5, 2, 10, 0, 12, 4, 6, 1, 16, 1, 18, 0, 10, 8, 22, 0, 19, 10, 14, 0, 28, 0, 30, 1, 18, 14, 22, 1, 36, 16, 22, 0, 40, 0, 42, 4, 12, 20, 46, 0, 41, 7, 30, 6, 52, 0, 38, 0, 34, 26, 58, 0, 60, 28, 22, 1, 46, 0, 66, 10, 42, 0, 70, 1, 72, 34, 26, 12, 58, 0, 78, 0
(list; graph; refs; listen; history; internal format)
|
|
|
|
OFFSET
| 1,3
|
|
|
FORMULA
| If n=p (prime), then a(n)=p-1. If n=2^m, then a(n)=1. [Corrected by R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Nov 27 2007]
|
|
|
EXAMPLE
| a(6)=1+2+3-6=0
|
|
|
MAPLE
| A103977 := proc(n) local divs, a, acandid, filt, i, p, sigs ; divs := convert(numtheory[divisors](n), list) ; a := add(i, i=divs) ; for sigs from 0 to 2^nops(divs)-1 do filt := convert(sigs, base, 2) ; while nops(filt) < nops(divs) do filt := [op(filt), 0] ; od ; acandid := 0 ; for p from 0 to nops(divs)-1 do if op(p+1, filt) = 0 then acandid := acandid-op(p+1, divs) ; else acandid := acandid+op(p+1, divs) ; fi ; od: acandid := abs(acandid) ; if acandid < a then a := acandid ; fi ; od: RETURN(a) ; end: seq(A103977(n), n=1..80) ; - R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Nov 27 2007
|
|
|
CROSSREFS
| Cf. A125732, A125733, A005835, A023196.
Sequence in context: A087664 A158032 A120112 * A109883 A033880 A033879
Adjacent sequences: A103974 A103975 A103976 * A103978 A103979 A103980
|
|
|
KEYWORD
| nonn
|
|
|
AUTHOR
| Yasutoshi Kohmoto zbi74583(AT)boat.zero.ad.jp, Jan 01 2007
|
|
|
EXTENSIONS
| More terms from R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Nov 27 2007
|
| |
|
|