OFFSET
2,2
COMMENTS
Conjecture: a(n) > 0 for all n (cf. A062234).
Note that a(1) = 3/2 hence offset is 2.
There are many cases of two successive terms of the same value, the first case is a(8)=a(9)=7: p(8)=19, p(9)=23, p(10)=29, (3/2)*(1+19)-23 = (3/2)*(1+23)-29 = 7.
The first case of 3 equal successive terms is a(691..693)=2588 for corresponding 4 consecutive primes primes p(691..694)= 5189, 5197, 5209, 5227.
The first case of 4 equal successive terms is a(12702874..12702878)=15579672 for corresponding 5 consecutive primes primes p(12702874..12702878)= 231159373,231159389,231159413,231159449,231159503.
Also of interest are cases with a(n)>a(n-1), e.g., a(27..29): 53, 52, 44 (the general tendency is, of course, increasing a(n) with n).
LINKS
Zak Seidov, Table of n, a(n) for n = 2..1001
MAPLE
a:= n-> 3*(1+ithprime(n))/2-ithprime(n+1):
seq(a(n), n=2..63); # Alois P. Heinz, Feb 14 2022
MATHEMATICA
(3(#[[1]]+1)/2)-#[[2]]&/@Partition[Prime[Range[2, 70]], 2, 1] (* Harvey P. Dale, Jul 27 2016 *)
PROG
(PARI) a(n) = my(p=prime(n)); (3/2)*(1+p) - nextprime(p+1); \\ Michel Marcus, Feb 14 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Feb 18 2012
STATUS
approved