OFFSET
1,4
COMMENTS
a(n) = 1 if n is prime.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Paolo P. Lava)
FORMULA
EXAMPLE
The aliquot parts of 8 are 1, 2, 4 and their sum is 7.
Now, let us calculate the aliquot parts of 1, 2 and 4:
1 => 0; 2 => 1; 4 => 1, 2. Their sum is 0 + 1 + 1 + 2 = 4.
Let us calculate the aliquot parts of 1, 1, 2:
1 => 0; 1 = > 0; 2 => 1. Their sum is 1.
We have left 1: 1 => 0.
Finally, 7 + 4 + 1 = 12. Therefore a(8) = 12.
MAPLE
with(numtheory): P:=proc(q) local a, b, c, k, n, t, v;
for n from 1 to q do b:=0; a:=sort([op(divisors(n))]); t:=nops(a)-1;
while add(a[k], k=1..t)>0 do b:=b+add(a[k], k=1..t); v:=[];
for k from 2 to t do c:=sort([op(divisors(a[k]))]); v:=[op(v), op(c[1..nops(c)-1])]; od;
a:=v; t:=nops(a); od; print(b); od; end: P(10^3);
MATHEMATICA
f[s_] := Flatten[Most[Divisors[#]] & /@ s]; a[n_] := Total@Flatten[FixedPointList[ f, {n}]] - n; Array[a, 100] (* Amiram Eldar, Apr 06 2019 *)
PROG
(PARI) ali(n) = setminus(divisors(n), Set(n));
a(n) = my(list = List(), v = [n]); while (#v, my(w = []); for (i=1, #v, my(s=ali(v[i])); for (j=1, #s, w = concat(w, s[j]); listput(list, s[j])); ); v = w; ); vecsum(Vec(list)); \\ Michel Marcus, Jul 15 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Paolo P. Lava, Feb 19 2015
STATUS
approved