A092248 Parity of number of distinct primes dividing n (function omega(n)) parity of A001221.
0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1
Offset: 1
Examples
For n = 1, 0 primes divide 1 so a(1)=0. For n = 2, there is 1 distinct prime dividing 2 (itself) so a(2)=1. For n = 4 = 2^2, there is 1 distinct prime dividing 4 so a(4)=1. For n = 5, there is 1 distinct prime dividing 5 (itself) so a(5)=1. For n = 6 = 2*3, there are 2 distinct primes dividing 6 so a(6)=0.
Links
Programs
-
Mathematica
Table[Boole[OddQ[PrimeNu[n]]], {n, 1, 100}] (* Geoffrey Critzer, Feb 16 2015 *)
-
PARI
for (i=1,200,if(Mod(omega(i),2)==0,print1(0,","),print1(1,",")))
-
Python
from sympy import primefactors def a(n): return 0 if n==1 else 1*(len(primefactors(n))%2==1) # Indranil Ghosh, Jun 01 2017
Formula
If omega(n) is even then a(n) = 0 else a(n) = 1. By convention, a(1) = 0. (Also because A001221(1) = 0 is an even number too).
Extensions
Offset corrected by Reinhard Zumkeller, Oct 03 2008
Comments