OFFSET
1,4
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
LINKS
Michel Marcus, Table of n, a(n) for n = 1..5000 (terms 1..1000 from Zak Seidov)
Heihachiro Ishikawa, Über die Verteilung der Primzahlen, Sci. Rep. Tokyo Bunrika Daigaku, Sect. A 2 (1934), 27-40.
FORMULA
EXAMPLE
a(1) = prime(1) + prime(2) - prime(3) = 2 + 3 - 5 = 0.
a(25) = prime(25) + prime(26) - prime(27) = 97 + 101 - 103 = 95.
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 *)
PROG
(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
(Magma) [NthPrime(n)+NthPrime(n+1)-NthPrime(n+2):n in [1..60]]; // Marius A. Burtea, Aug 17 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Cino Hilliard, Aug 04 2004
EXTENSIONS
Edited by Zak Seidov, Aug 27 2012
Definition reworded by N. J. A. Sloane, Aug 27 2012
STATUS
approved