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.

A099850 Partial sums of A004648.

Original entry on oeis.org

0, 1, 3, 6, 7, 8, 11, 14, 19, 28, 37, 38, 40, 41, 43, 48, 56, 63, 73, 84, 94, 107, 121, 138, 160, 183, 205, 228, 250, 273, 276, 279, 284, 287, 296, 303, 312, 323, 334, 347, 362, 375, 394, 411, 428, 443, 466, 497, 528, 557, 586, 617, 646, 681, 718, 757, 798, 837
Offset: 1

Views

Author

Mark Hudson (mrmarkhudson(AT)hotmail.com), Oct 27 2004

Keywords

Examples

			A004648 begins: 0, 1, 2, 3, 1, 1, 3, 3, 5, 9, 9, ... so the partial sums are 0, 1, 3, 6, 7, 8, 11, 14, 19, 28, 37, ...
		

Crossrefs

Cf. A004648.

Programs

  • Magma
    [(&+[(NthPrime(k) mod k): k in [1..n]]): n in [1..100]]; // G. C. Greubel, Apr 20 2023
    
  • Mathematica
    Table[Sum[Mod[Prime[j], j], {j,n}], {n,100}] (* G. C. Greubel, Apr 20 2023 *)
    Accumulate[Table[Mod[Prime[n],n],{n,100}]] (* Harvey P. Dale, Jun 14 2023 *)
  • PARI
    s=vector(100):s[1]=prime(1)%1:for(n=2,100,s[n]=s[n-1]+prime(n)%n)
    
  • SageMath
    def A004648(n): return (nth_prime(n)%n)
    def A099850(n): return sum(A004648(k) for k in range(1,n+1))
    [A099850(n) for n in range(1,101)] # G. C. Greubel, Apr 20 2023

Formula

a(n) = Sum_{k=1..n} A004648(k).