A065043 Characteristic function of the numbers with an even number of prime factors (counted with multiplicity): a(n) = 1 if n = A028260(k) for some k then 1 else 0.
1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0
Offset: 1
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537 (first 1000 terms from Harry J. Smith)
- Index entries for characteristic functions
- Index entries for sequences computed from exponents in factorization of n
Crossrefs
Characteristic function of A028260 (positions of 1's). Cf. also A026424 (positions of 0's) and A320655.
One less than A007421.
Programs
-
Maple
A065043 := proc(n) if type(numtheory[bigomega](n),'even') then 1; else 0; end if; end proc: # R. J. Mathar, Jun 26 2013
-
Mathematica
Table[(LiouvilleLambda[n]+1)/2,{n,1,20}] (* Enrique Pérez Herrero, Jul 07 2012 *)
-
PARI
{ for (n=1, 1000, a=1 - bigomega(n)%2; write("b065043.txt", n, " ", a) ) } \\ Harry J. Smith, Oct 04 2009
-
PARI
A065043(n) = (1 - (bigomega(n)%2)); \\ Antti Karttunen, Apr 19 2022
-
Python
from operator import ixor from functools import reduce from sympy import factorint def A065043(n): return (reduce(ixor, factorint(n).values(),0)&1)^1 # Chai Wah Wu, Jan 01 2023
Formula
a(n) = 1 - A001222(n) mod 2.
a(n) = A007421(n) - 1.
a(n) = 1 - A066829(n).
Dirichlet g.f.: (zeta(s)^2 + zeta(2*s))/(2*zeta(s)). - Enrique Pérez Herrero, Jul 06 2012
a(n) = (A008836(n) + 1)/2. - Enrique Pérez Herrero, Jul 07 2012
a(n) = A001222(2n) mod 2. - Wesley Ivan Hurt, Jun 22 2013
G.f.: Sum_{n>=1} a(n)*x^n/(1 - x^n) = Sum_{n>=1} x^(n^2)/(1 - x^n). - Ilya Gutkovskiy, Apr 25 2017
From Antti Karttunen, Dec 01 2022: (Start)
For x, y >= 1, a(x*y) = 1 - abs(a(x)-a(y)).
a(n) >= A356170(n).
(End)
Extensions
Corrected by Charles R Greathouse IV, Sep 02 2009