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.

A167020 a(n) = 1 iff 6n-1 is prime.

Original entry on oeis.org

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

Views

Author

Washington Bomfim, Oct 27 2009

Keywords

Examples

			a(5) = 1 because 6*5-1 is prime, a(6) = 0 since 6*6-1 is composite.
		

Crossrefs

Programs

  • Magma
    [IsPrime(6*n-1) select 1 else 0: n in[1..100]]; // Vincenzo Librandi, Jan 19 2019
  • Mathematica
    Table[If[PrimeQ[6 n - 1], 1, 0], {n, 100}] (* Vincenzo Librandi, Jan 19 2019 *)
  • PARI
    a(n) = isprime(6*n-1); \\ Michel Marcus, Jan 19 2019