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.

A072608 Parity of remainder Mod(prime(n),n) = A004648(n).

Original entry on oeis.org

0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0
Offset: 1

Views

Author

Labos Elemer, Jun 24 2002

Keywords

Examples

			n=25:p(25)=97,Mod[97,25]=22, a(25)=Mod[22,2]=0. With increasing n, a(n) alternates:...010101..,followed after by a range consisting only of 1-s. This secondary alternation also goes on.
		

Crossrefs

Cf. A004648.

Programs

  • Haskell
    a072608 n = a000040 n `mod` n `mod` 2 -- Reinhard Zumkeller, Dec 16 2013
    
  • Mathematica
    mm[x_] := Mod[Mod[Prime[x], x], 2] Table[mm[w], {w, 1, 256}]
    Table[Mod[Mod[Prime[n],n],2],{n,110}] (* Harvey P. Dale, Apr 22 2016 *)
  • PARI
    a(n)=prime(n)%n%2 \\ Charles R Greathouse IV, Feb 09 2017

Formula

a(n) = Mod(Mod(prime(n), n), 2) = Mod(A004648(n), 2).