OFFSET
1,7
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = prime(n) - 2*n for n != 2, 3, 4; a(n) = 1 otherwise. - Jianing Song, Jan 15 2023
MATHEMATICA
Table[Abs[2 n - Prime[n]], {n, 1, 100}] (* Vincenzo Librandi, Aug 26 2014 *)
PROG
(PARI) a(n)=abs(2*n-prime(n)) \\ Charles R Greathouse IV, Aug 25 2014
(Magma) [Abs(2*n-NthPrime(n)): n in [1..70]]; // Vincenzo Librandi, Aug 26 2014
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Odimar Fabeny, Jul 14 2010
EXTENSIONS
More terms from N. J. A. Sloane, Jul 14 2010
STATUS
approved