OFFSET
0,3
COMMENTS
All terms except a(0) = 0 are odd.
Each prime number sets a new record.
LINKS
EXAMPLE
The first terms, alongside their primorial base expansion, are:
n a(n) pr(a(n))
-- --------- ------------------
0 0 0
1 1 1
2 5 2_1
3 21 3_1_1
4 17 2_2_1
5 159 5_1_1_1
6 23 3_2_1
7 1509 7_1_1_1_1
8 29 4_2_1
9 111 3_3_1_1
10 161 5_1_2_1
11 25659 11_1_1_1_1_1
12 83 2_3_2_1
13 392949 13_1_1_1_1_1_1
PROG
(PARI) a(n) = { if (n==0, 0, my (v=0, f=1); forprime (r=2, oo, forstep (d=r-1, 1, -1, if (n%d==0, v+=f*d; n/=d; break; ); ); if (n==1, return (v), f*=r))) }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jun 16 2022
STATUS
approved