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.

A080545 Characteristic function of {1} union {odd primes}: 1 if n is 1 or an odd prime, else 0.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Mar 21 2003

Keywords

Examples

			a(2) = 0 because 2 is prime but even.
a(3) = 1 because 3 is prime and odd. Likewise for a(5) and a(7).
a(4) = 0 because 4 is neither prime nor odd. Likewise for a(6) and a(8).
a(9) = 0 because 9 is odd but composite.
		

Crossrefs

Differs from A080339 only at a(2).

Programs

  • Mathematica
    Table[Boole[PrimeOmega[n] < 2 && OddQ[n]], {n, 100}] (* Alonso del Arte, Nov 19 2013 *)

Formula

a(n) = (delta(Omega(n), 0) + delta(Omega(n), 1)) * d_0(n), where delta is the Kronecker delta function, Omega is the number of prime factors function (counted with multiplicity), and d_0(n) is the least significant digit of n in binary. - Alonso del Arte, Nov 19 2013

Extensions

Added missing a(2) - Walter Roscello, Nov 19 2013