OFFSET
1,2
COMMENTS
Differs from A219730 at a(12).
LINKS
James C. McMahon, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = a(n-1) + A117818(n) for n > 1. - Michael De Vlieger, Jun 23 2024
EXAMPLE
From Michael De Vlieger, Jun 23 2024: (Start)
Let lpf = A020639(n).
a(2) = 3 since 2 is prime, therefore a(1) + 2 = 3.
a(3) = 6 since 3 is prime, therefore a(2) + 3 = 6.
a(4) = 8 since 4 is not prime, therefore a(3) + 4/lpf(4) = 6 + 2 = 8.
a(5) = 13 since 5 is prime, therefore a(4) + 5 = 13.
a(6) = 16 since 6 is not prime, hence a(5) + 6/lpf(6) = 13 + 3 = 16, etc. (End)
MATHEMATICA
a[1]=1; a[n_]:=If[PrimeQ[n], a[n-1]+n, a[n-1]+Divisors[n][[-2]]]; Table[a[n], {n, 56}]
PROG
(PARI) alist(N) = my(r, d); vector(N, n, r+=if(2<#d=divisors(n), d[#d-1], d[#d])); \\ Ruud H.G. van Tol, Jul 11 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
James C. McMahon, Jun 17 2024
STATUS
approved