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.

A176628 a(n) = prime(n) - n*(-1)^prime(n).

Original entry on oeis.org

1, 5, 8, 11, 16, 19, 24, 27, 32, 39, 42, 49, 54, 57, 62, 69, 76, 79, 86, 91, 94, 101, 106, 113, 122, 127, 130, 135, 138, 143, 158, 163, 170, 173, 184, 187, 194, 201, 206, 213, 220, 223, 234, 237, 242, 245, 258, 271, 276, 279, 284, 291, 294, 305, 312, 319, 326
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 22 2010

Keywords

Comments

Unit together with n-th odd prime + n + 1.

Examples

			a(1) = prime(1) - 1*(-1)^prime(1) = 2-1 = 1.
		

Programs

  • Magma
    [1]cat[NthPrime(n) +n: n in [2..60]]; // G. C. Greubel, Jul 01 2021
    
  • Mathematica
    np[n_]:=Module[{npr=Prime[n]},npr-n (-1)^npr];Array[np,60] (* Harvey P. Dale, Oct 08 2011 *)
  • Sage
    [1]+[nth_prime(n) +n for n in (2..60)] # G. C. Greubel, Jul 01 2021

Formula

a(n+1) = A014688(n+1).

Extensions

Entries checked by R. J. Mathar, Apr 27 2010