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”).

a(n) = 1 if n has the same numbers of prime factors of forms 4*k+1 and 4*k+3 when counted with multiplicity, otherwise 0.
3

%I #14 Mar 11 2021 21:07:59

%S 1,1,0,1,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,

%T 1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,

%U 0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,1,1

%N a(n) = 1 if n has the same numbers of prime factors of forms 4*k+1 and 4*k+3 when counted with multiplicity, otherwise 0.

%H Antti Karttunen, <a href="/A342025/b342025.txt">Table of n, a(n) for n = 1..65537</a>

%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>

%t {1}~Join~Table[Boole[Count[#, 1] == Count[#, 3]] &@ Mod[Flatten[ConstantArray[#1, #2] & @@@ FactorInteger[n]], 4], {n, 2, 120}] (* _Michael De Vlieger_, Mar 11 2021 *)

%o (PARI) A342025(n) = {my(f = factor(n)); sum(k=1, #f~, ((f[k, 1] % 4)==1)*f[k, 2]) == sum(k=1, #f~, ((f[k, 1] % 4)==3)*f[k, 2]); }; \\ From isok function in A072202

%o (Python)

%o from sympy import factorint

%o def A342025(n):

%o f = factorint(n)

%o return int(sum(b for a, b in f.items() if a % 4 == 3) == sum(b for a, b in f.items() if a % 4 == 1)) # _Chai Wah Wu_, Mar 09 2021

%Y Characteristic function of A072202.

%K nonn

%O 1

%A _Antti Karttunen_, Mar 09 2021