OFFSET
1,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
EXAMPLE
a(12): we have three alternative paths: {12, 8, 4, 2, 1}, {12, 6, 4, 2, 1} or {12, 6, 3, 2, 1}, with path sums 27, 25, 24, whose average is 76/3 = 25.333..., therefore a(12) = 25.
For n=15 we have five alternative paths from 15 to 1 (illustrated below) with path sums 37, 40, 42, 40, 39, whose average is 198/5 = 39.6, therefore a(15) = 39.
15
/ \
/ \
10 12
/ \ / \
/ \ / \
5 8 6
\_ | __/|
\__|_/ |
4 3
\ /
\ /
2
|
1.
MATHEMATICA
Map[Floor@ Mean[Total /@ #] &, #] &@ Nest[Function[{a, n}, Append[a, Join @@ Table[Flatten@ Prepend[#, n] & /@ a[[n - n/p]], {p, FactorInteger[n][[All, 1]]}]]] @@ {#, Length@ # + 1} &, {{{1}}}, 74] (* Michael De Vlieger, Apr 15 2020 *)
PROG
(PARI)
up_to = 20000;
A333001list(up_to) = { my(u=vector(up_to), v=vector(up_to)); u[1] = v[1] = 1; for(n=2, up_to, my(ps=factor(n)[, 1]~); u[n] = vecsum(apply(p -> u[n-n/p], ps)); v[n] = (u[n]*n)+vecsum(apply(p -> v[n-n/p], ps))); vector(up_to, n, floor(v[n]/u[n])); };
v333001 = A333001list(up_to);
A333001(n) = v333001[n];
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 06 2020
STATUS
approved