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.

Showing 1-2 of 2 results.

A108754 Difference between partial sum of the first n primes and n^2.

Original entry on oeis.org

1, 1, 1, 1, 3, 5, 9, 13, 19, 29, 39, 53, 69, 85, 103, 125, 151, 177, 207, 239, 271, 307, 345, 387, 435, 485, 535, 587, 639, 693, 759, 827, 899, 971, 1051, 1131, 1215, 1303, 1393, 1487, 1585, 1683, 1789, 1895, 2003, 2111, 2229, 2357, 2487, 2617, 2749, 2885, 3021
Offset: 1

Views

Author

Alexandre Wajnberg, Jun 23 2005

Keywords

Comments

Also difference between partial sum of the first n primes and the sum of the first n odd numbers. - Cino Hilliard, Dec 02 2007

Examples

			a(5) = A007504(5) - A000290(5) = 28 - (5^2) = 3.
		

Crossrefs

Partial sums of A131733.

Programs

  • Mathematica
    Table[ Sum[ Prime[i], {i, n}] - n^2, {n, 53}] (* Robert G. Wilson v, Jun 25 2005 *)
    Module[{nn=60,prs},prs=Accumulate[Prime[Range[nn]]];#[[1]]-#[[2]]&/@Thread[ {prs,Range[ nn]^2}]] (* Harvey P. Dale, Aug 14 2024 *)
  • PARI
    g(n) = for(x=1,n,y=sum(j=1,x,2*j-1);z=sum(j=1,x,prime(j));print1(z-y",")) \\ Cino Hilliard, Dec 02 2007

Formula

a(n) = A007504(n) - A000290(n).

Extensions

Edited and extended by Robert G. Wilson v, Jun 25 2005

A192326 Remainders of primes divided by odd numbers.

Original entry on oeis.org

0, 0, 0, 0, 2, 2, 4, 4, 6, 10, 10, 14, 16, 16, 18, 22, 26, 26, 30, 32, 32, 36, 38, 42, 48, 50, 50, 52, 52, 54, 5, 5, 7, 5, 11, 9, 11, 13, 13, 15, 17, 15, 21, 19, 19, 17, 25, 33, 33, 31, 31, 33, 31, 37, 39, 41, 43, 41, 43, 43, 41, 47, 57, 57, 55, 55, 65, 67, 73, 71, 71, 73, 77, 79, 81, 81, 83
Offset: 1

Views

Author

Pasi Airikka, Jun 28 2011

Keywords

Examples

			a(1) = prime(1) mod odd(1) = 2 mod 1 = 0; a(5) = prime(5) mod odd(5) = 11 mod 9 = 2.
		

Crossrefs

Cf. A131733.

Programs

  • MATLAB
    % n = number of computed terms of sequence
    for i=1:n,
        a(n) = mod(prime(i),odd(i)) ;
    end
    
  • Maple
    A192326 := proc(n) modp(ithprime(n),2*n-1) ; end proc:
    seq(A192326(n),n=1..80) ; # R. J. Mathar, Jul 13 2011
  • PARI
    a(n)=prime(n)%(2*n-1) \\ Charles R Greathouse IV, Jun 29 2011

Formula

a(n) = prime(n) mod (2n-1).
Showing 1-2 of 2 results.