%I #13 Aug 26 2020 16:31:16
%S 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,
%T 0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,
%U 0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0
%N a(n) = 1 if n is either 1 or divisible only by primes congruent to 1 mod 3, 0 otherwise.
%H Antti Karttunen, <a href="/A319691/b319691.txt">Table of n, a(n) for n = 1..65537</a>
%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>
%F a(n) = A319690(n) mod 2.
%F Fully multiplicative with a(p) = 1 if p is a prime of the form 3k+1, otherwise a(p) = 0.
%t Table[If[AllTrue[FactorInteger[n][[All,1]],Mod[#,3]==1&],1,0],{n,120}] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Aug 26 2020 *)
%o (PARI) A319691(n) = factorback(apply(p -> ((p%3)%2), factor(n)[, 1]));
%Y Characteristic function of A004611.
%Y Cf. A319690.
%K nonn,mult
%O 1
%A _Antti Karttunen_, Oct 04 2018
|