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.

A192327 a(n) = prime(n) mod 2*n.

Original entry on oeis.org

0, 3, 5, 7, 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, 3, 3, 5, 3, 9, 7, 9, 11, 11, 13, 15, 13, 19, 17, 17, 15, 23, 31, 31, 29, 29, 31, 29, 35, 37, 39, 41, 39, 41, 41, 39, 45, 55, 55, 53, 53, 63, 65, 71, 69, 69, 71, 75, 77, 79, 79
Offset: 1

Views

Author

Pasi Airikka, Jun 28 2011

Keywords

Examples

			a(1) = prime(1) mod even(1) = 2 mod 2 = 0.
a(5) = prime(5) mod even(5) = 11 mod 10 = 1.
		

Crossrefs

Cf. A004648.

Programs

  • MATLAB
    % n = number of computed terms of sequence
    for i=1:n,
        a(i) = mod(prime(i),even(i)) ;
    end
    
  • Magma
    A192327:=func< n | NthPrime(n) mod 2*n >; [ A192327(n): n in [1..80] ]; // Klaus Brockhaus, Jul 10 2011
  • Maple
    A192327 := proc(n) modp(ithprime(n),2*n) ; end proc:
    seq(A192327(n),n=1..80) ; # R. J. Mathar, Jul 11 2011
  • Mathematica
    Table[Mod[Prime[n], 2n], {n, 50}] (* Alonso del Arte, Jun 29 2011 *)
  • PARI
    a(n)=prime(n)%(2*n) \\ Charles R Greathouse IV, Jun 29 2011
    

Formula

a(n) = A000040(n) mod (2*n).