|
|
A356163
|
|
a(n) = 1 if sum of prime factors of n (taken with multiplicity) is even, otherwise 0.
|
|
12
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1
|
|
LINKS
|
|
|
FORMULA
|
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
|
|
MAPLE
|
f:= proc(n) local t; 1-add(t[1]*t[2], t = ifactors(n)[2]) mod 2 end proc:
|
|
MATHEMATICA
|
{1}~Join~Array[Boole@ EvenQ[Total[Times @@@ FactorInteger[#]]] &, 119, 2] (* Michael De Vlieger, Nov 02 2022 *)
|
|
PROG
|
(PARI)
(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.
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|