OFFSET
1
LINKS
FORMULA
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
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)
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
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 02 2022
STATUS
approved