A080545 Characteristic function of {1} union {odd primes}: 1 if n is 1 or an odd prime, else 0.
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
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.
Links
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
Comments