cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A024328 a(n) = Sum_{j=1..floor((n+1)/2)} A023531(j)*prime(n-j+1).

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Cf. A023531 (characteristic function of {n(n+3)/2}).

Programs

  • 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
    
  • 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 *)
  • PARI
    A024328(n)=sum(j=1, (n+1)\2, A023531(j)*prime(n-j+1)) \\ M. F. Hasler, Apr 12 2018
    
  • 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

Formula

a(n) = Sum_{j=1..floor((n+1)/2)} A023531(j)*prime(n-j+1).

Extensions

Name edited by M. F. Hasler, Apr 12 2018