OFFSET
1,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..5000
FORMULA
a(n) = Sum_{j=1..floor((n+1)/2)} A023531(j)*prime(n-j+1).
MATHEMATICA
Table[t=0; m=3; p=BitShiftRight[n]; n--; While[n>p, t += Prime[n]; n -= m++]; t, {n, 120}] (* G. C. Greubel, Feb 17 2022 *)
PROG
(Magma)
b:= func< n, j | IsIntegral((Sqrt(8*j+9) -3)/2) select NthPrime(n-j+1) else 0 >;
A024328:= func< n | (&+[b(n, j): j in [1..Floor((n+1)/2)]]) >;
[A024328(n) : n in [1..120]]; // G. C. Greubel, Feb 17 2022
(Sage)
def b(n, j): return nth_prime(n-j+1) if ((sqrt(8*j+9) -3)/2).is_integer() else 0
@CachedFunction
def A024327(n): return sum( b(n, j) for j in (1..floor((n+1)/2)) )
[A024327(n) for n in (1..120)] # G. C. Greubel, Feb 17 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Name edited by M. F. Hasler, Apr 12 2018
STATUS
approved