login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A024328
a(n) = Sum_{j=1..floor((n+1)/2)} A023531(j)*prime(n-j+1).
3
0, 0, 3, 5, 7, 11, 13, 17, 30, 36, 46, 50, 60, 70, 74, 84, 117, 131, 139, 157, 171, 177, 193, 207, 221, 237, 294, 310, 330, 348, 360, 390, 408, 424, 448, 470, 486, 506, 611, 625, 653, 673, 699, 739, 761, 781, 803, 835, 863, 891, 925, 953, 1078, 1104, 1136, 1180, 1214, 1244, 1270
OFFSET
1,3
LINKS
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
(PARI) A024328(n)=sum(j=1, (n+1)\2, A023531(j)*prime(n-j+1)) \\ M. F. Hasler, Apr 12 2018
(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
Cf. A023531 (characteristic function of {n(n+3)/2}).
Sequence in context: A355845 A025127 A024883 * A032529 A154866 A106284
KEYWORD
nonn
EXTENSIONS
Name edited by M. F. Hasler, Apr 12 2018
STATUS
approved