login
A179437
a(n) = |2n - prime(n)|.
3
0, 1, 1, 1, 1, 1, 3, 3, 5, 9, 9, 13, 15, 15, 17, 21, 25, 25, 29, 31, 31, 35, 37, 41, 47, 49, 49, 51, 51, 53, 65, 67, 71, 71, 79, 79, 83, 87, 89, 93, 97, 97, 105, 105, 107, 107, 117, 127, 129, 129, 131, 135, 135, 143, 147, 151, 155, 155, 159, 161, 161, 169, 181, 183, 183, 185, 197
OFFSET
1,7
LINKS
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
A variant of A173072. Cf. A000040.
Sequence in context: A125960 A141584 A287195 * A136791 A213933 A091916
KEYWORD
nonn,easy
AUTHOR
Odimar Fabeny, Jul 14 2010
EXTENSIONS
More terms from N. J. A. Sloane, Jul 14 2010
STATUS
approved