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.

A096379 a(n) = prime(n) + prime(n+1) - prime(n+2).

Original entry on oeis.org

0, 1, 1, 5, 7, 11, 13, 13, 21, 23, 27, 35, 37, 37, 41, 51, 53, 57, 65, 65, 69, 73, 75, 85, 95, 97, 101, 103, 95, 109, 121, 129, 127, 137, 143, 145, 153, 157, 161, 171, 169, 179, 187, 191, 185, 187, 207, 221, 223, 223, 231, 229, 235, 245, 251, 261, 263, 267, 275, 271
Offset: 1

Views

Author

Cino Hilliard, Aug 04 2004

Keywords

Comments

Sequence is non-monotonic: see, e.g., a(29), a(33), and a(41). - Zak Seidov, Jan 21 2013
Ishikawa proved that a(n) > 0 for n > 1. - Jonathan Sondow, Feb 13 2014

Examples

			a(1) = prime(1) + prime(2) - prime(3) = 2 + 3 - 5 = 0.
a(25) = prime(25) + prime(26) - prime(27) = 97 + 101 - 103 = 95.
		

Crossrefs

Programs

  • Magma
    [NthPrime(n)+NthPrime(n+1)-NthPrime(n+2):n in [1..60]]; //  Marius A. Burtea, Aug 17 2019
  • Maple
    A096379 := proc(n)
        ithprime(n+1)+ithprime(n)-ithprime(n+2) ;
    end proc:
    seq(A096379(n),n=1..80) ; # R. J. Mathar, Sep 10 2016
  • Mathematica
    #[[1]] + #[[2]] - #[[3]] & /@ Partition[Prime[Range[62]], 3, 1] (* Zak Seidov, Apr 09 2013 *)
    ListConvolve[{-1,1,1},Prime[Range[100]]] (* Zak Seidov, Dec 03 2014 *)
  • PARI
    g(n)=for(x=1,n,print1(prime(x)+prime(x+1)-prime(x+2)","))
    
  • PARI
    first(n)=my(v=vector(n),p=2,q=3,k); forprime(r=5,, if(k++>n, break); v[k]=p+q-r; p=q; q=r); v \\ Charles R Greathouse IV, Oct 03 2017
    

Formula

a(n) = A001043(n) - A000040(n+2). - A.H.M. Smeets, Aug 17 2019
a(n) = A000040(n) - A001223(n+1). - Jon Maiga, Aug 17 2019

Extensions

Edited by Zak Seidov, Aug 27 2012
Definition reworded by N. J. A. Sloane, Aug 27 2012