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.

A024925 Sum of remainders of n mod prime(k), for k = 1,2,3,...,n.

Original entry on oeis.org

1, 2, 4, 9, 13, 19, 25, 38, 52, 64, 74, 92, 104, 122, 143, 172, 188, 218, 236, 268, 299, 329, 351, 393, 437, 473, 523, 569, 597, 646, 676, 737, 788, 836, 893, 959, 995, 1049, 1110, 1182, 1222, 1293, 1335, 1409, 1490, 1556, 1602, 1692, 1782, 1874, 1955, 2043, 2095, 2197, 2290
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [&+[n mod NthPrime(k): k in [1..n]]:n in [1..55]]; // Marius A. Burtea, Jul 16 2019
    
  • PARI
    a(n) = sum(k=1, n, n % prime(k)); \\ Michel Marcus, Jul 18 2019
    
  • PARI
    a(n) = my(s=0); forprime(p=2, prime(n), s += n%p); s; \\ Michel Marcus, Jul 18 2019

Formula

G.f.: x * (1 + x)/(1 - x)^3 - (1/(1 - x)) * Sum_{k>=1} prime(k) * x^prime(k)/(1 - x^prime(k)). - Ilya Gutkovskiy, Jul 16 2019