login
A023862
a(n) = 1*t(n) + 2*t(n-1) + ... + k*t(n+1-k), where k=floor((n+1)/2) and t = A008578 ({1} U primes).
1
1, 2, 7, 11, 26, 40, 76, 104, 171, 219, 331, 397, 566, 672, 912, 1046, 1369, 1561, 1985, 2223, 2762, 3026, 3688, 4030, 4833, 5215, 6179, 6631, 7764, 8318, 9630, 10270, 11793, 12499, 14245, 15019, 17006, 17930, 20176, 21182, 23701, 24837, 27645, 28965, 32084, 33504
OFFSET
1,2
LINKS
MATHEMATICA
Join[{1}, Table[Sum[j*Prime[n-j], {j, 1, Floor[(n+1)/2]}], {n, 2, 50}]] (* G. C. Greubel, Jun 12 2019 *)
PROG
(PARI) a(n) = sum(j=1, floor((n+1)/2), j*prime(n-j));
vector(50, n, if(n==1, 1, a(n))) \\ G. C. Greubel, Jun 12 2019
(Magma) [1] cat [(&+[j*NthPrime(n-j): j in [1..Floor((n+1)/2)]]): n in [2..50]]; // G. C. Greubel, Jun 12 2019
(Sage) [1]+[sum(j*nth_prime(n-j) for j in (1..floor((n+1)/2))) for n in (2..50)] # G. C. Greubel, Jun 12 2019
CROSSREFS
Sequence in context: A103184 A093039 A201630 * A024479 A295138 A023864
KEYWORD
nonn
EXTENSIONS
Title simplified by Sean A. Irvine, Jun 12 2019
STATUS
approved