OFFSET
1,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
FORMULA
EXAMPLE
a(12): we have three alternative paths: {12, 8, 4, 2, 1}, {12, 6, 4, 2, 1} or {12, 6, 3, 2, 1}, therefore a(12) = (12+8+4+2+1) + (12+6+4+2+1) + (12+6+3+2+1) = 27+25+24 = 76
For n=15 we have five alternative paths from 15 to 1 (illustrated below): therefore a(15) = (15+10+5+4+2+1) + (15+10+8+4+2+1) + (15+12+8+4+2+1) + (15+12+6+4+2+1) + (15+12+6+3+2+1) = 37+40+42+40+39 = 198.
15
/ \
/ \
10 12
/ \ / \
/ \ / \
5 8 6
\__ | __/|
\_|_/ |
4 3
\ /
\ /
2
|
1.
PROG
(PARI)
up_to = 20000;
A333000list(up_to) = { my(u=vector(up_to), v=vector(up_to)); u[1] = v[1] = 1; for(n=2, up_to, u[n] = vecsum(apply(p -> u[n-n/p], factor(n)[, 1]~)); v[n] = (u[n]*n)+vecsum(apply(p -> v[n-n/p], factor(n)[, 1]~))); (v); };
v333000 = A333000list(up_to);
A333000(n) = v333000[n];
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 06 2020
STATUS
approved