login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A356163
a(n) = 1 if sum of prime factors of n (taken with multiplicity) is even, otherwise 0.
13
1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1
OFFSET
1
FORMULA
a(n) = A059841(A001414(n)).
a(n) >= A353557(n).
For x, y >= 1, a(x*y) >= a(x) * a(y).
a(x*y) = 1 - a(x) - a(y) + 2*a(x)*a(y). - Robert Israel, Nov 03 2022
a(n) = (1+A359154(n))/2). - Antti Karttunen, Dec 19 2022
a(n) = a(A000265(n)) = A065043(A000265(n)) = A353557(A000265(n)). - Antti Karttunen, Jan 15 2023
MAPLE
f:= proc(n) local t; 1-add(t[1]*t[2], t = ifactors(n)[2]) mod 2 end proc:
map(f, [$1..100]); # Robert Israel, Nov 03 2022
MATHEMATICA
{1}~Join~Array[Boole@ EvenQ[Total[Times @@@ FactorInteger[#]]] &, 119, 2] (* Michael De Vlieger, Nov 02 2022 *)
PROG
(PARI)
A001414(n) = ((n=factor(n))[, 1]~*n[, 2]); \\ From A001414.
A059841(n) = (1-(n%2));
(Python)
from functools import reduce
from operator import ixor, and_
from itertools import starmap
from sympy import factorint
def A356163(n): return (reduce(ixor, starmap(and_, factorint(n).items()), 0)&1)^1 # Chai Wah Wu, Dec 21 2022
CROSSREFS
Characteristic function of A036349, whose complement A335657 gives the positions of 0's.
Cf. A000265, A001414, A065043 [= a(A003961(n))], A353557, A359154, A359773 (Dirichlet inverse).
Sequence in context: A113430 A214529 A113681 * A295895 A179416 A360845
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 02 2022
STATUS
approved

  NODES
Community 1
Intern 1
os 4
text 2
web 1