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.

A161669 Sum_{j=k(n)..prime(n)} j where k is the n-th nonprime nonnegative integer.

Original entry on oeis.org

3, 6, 9, 13, 38, 55, 108, 124, 185, 330, 376, 550, 671, 736, 897, 1155, 1470, 1566, 1927, 2178, 2266, 2664, 2958, 3444, 4158, 4521, 4653, 5037, 5215, 5580, 7182, 7656, 8418, 8602, 9999, 10251, 11128, 12040, 12597, 13566, 14570, 14875, 16683, 16951, 17612
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jun 16 2009, Jun 27 2009

Keywords

Examples

			n  k(n)  prime(n)  Sum_{j=k(n)..prime(n)} j
=  ====  ========  ========================
1    0       2               0 + 1 + 2 =  3 = a(1)
2    1       3               1 + 2 + 3 =  6 = a(2)
3    4       5                   4 + 5 =  9 = a(3)
4    6       7                   6 + 7 = 13 = a(4)
5    8      11         8 + 9 + 10 + 11 = 38 = a(5)
		

Programs

  • PARI
    k=0;p=2;for(i=1,1e2,s=p*(p+1)/2-k*(k-1)/2;print1(s",");p=nextprime(p+1);while(isprime(k++),))

Extensions

Corrected and extended by Charles R Greathouse IV, Mar 25 2010
Name clarified and Example section edited by Jon E. Schoenfield, Feb 10 2019