|
|
A117552
|
|
Largest partial sum of the increasingly ordered divisors of n, not exceeding n.
|
|
3
|
|
|
1, 1, 1, 3, 1, 6, 1, 7, 4, 8, 1, 10, 1, 10, 9, 15, 1, 12, 1, 12, 11, 14, 1, 24, 6, 16, 13, 28, 1, 27, 1, 31, 15, 20, 13, 25, 1, 22, 17, 30, 1, 33, 1, 40, 33, 26, 1, 36, 8, 43, 21, 46, 1, 39, 17, 36, 23, 32, 1, 58, 1, 34, 41, 63, 19, 45, 1, 58, 27, 39, 1, 63, 1, 40, 49, 64, 19, 51, 1, 66
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,4
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(12)=10 because the increasingly ordered divisors of 12 are 1,2,3,4,6 and 12, with partial sums 1,3,6,10,16 and 28; the largest partial sum not exceeding 12 is 10.
|
|
MAPLE
|
with(numtheory): a:=proc(n) local div, j: if n=1 then 1 else div:=divisors(n): for j from 1 by 1 while sum(div[i], i=1..j)<=n do sum(div[k], k=1..j) od: fi: end: seq(a(n), n=1..90); # Emeric Deutsch, Apr 01 2006
|
|
MATHEMATICA
|
Table[Last@ TakeWhile[Accumulate@ Divisors@ n, # <= n &], {n, 80}] (* Michael De Vlieger, Oct 30 2017 *)
|
|
PROG
|
(PARI) A117552(n) = { my(divs=divisors(n), s=0); for(i=1, #divs, if((s+divs[i])>n, return(s), s+=divs[i])); s; }; \\ Antti Karttunen, Oct 30 2017
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|