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.

A100810 a(n) = 0 if prime(n) + 2 = prime(n+1), otherwise 1.

Original entry on oeis.org

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

Views

Author

Giovanni Teofilatto, Jan 05 2005

Keywords

Examples

			a(2) = 0 because prime(2) + 2 = 5 = prime(3).
a(3) = 0 because prime(3) + 2 = 7 = prime(4).
		

Programs

  • Maple
    a:= n-> `if`(isprime(ithprime(n)+2), 0, 1):
    seq(a(n), n=1..105);  # Alois P. Heinz, Oct 02 2020
  • Mathematica
    Table[If[Prime[n] + 2 == Prime[n + 1], 0, 1], {n, 120}] (* Ray Chandler, Jan 09 2005 *)
    If[#[[2]]-#[[1]]==2,0,1]&/@Partition[Prime[Range[110]],2,1] (* Harvey P. Dale, Mar 05 2016 *)

Formula

a(n) = 1 - A100821(n) = 1 - A062301(n+1).

Extensions

Corrected and extended by Ray Chandler, Jan 09 2005