login
A359549
a(n) = 1 if n is either an odd squarefree number squared or twice such a number, otherwise 0.
6
1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
OFFSET
1
FORMULA
Multiplicative with a(2^e) = 1 if e=1, a(2^e) = 0 if e > 1, and for odd primes p, a(p^e) = 1 if e=2, a(p^e) = 0 if e=1 or e>2.
a(n) = abs(A359548(n)) = A359548(n) mod 2.
a(n) = A046692(n) mod 2 = A323910(n) mod 2 = A327276(n) mod 2 = A327278(n) mod 2.
MATHEMATICA
a[n_] := If[(e = IntegerExponent[n, 2]) < 2 && SquareFreeQ[Sqrt[n/2^e]], 1, 0] ; Array[a, 100] (* Amiram Eldar, Jan 07 2023 *)
PROG
(PARI) A359549(n) = { my(f=factor(n)); prod(k=1, #f~, if(2==f[k, 1], (1==f[k, 2]), (2==f[k, 2]))); };
(Python)
from sympy import factorint
def A359549(n): return int((m:=(~n & n-1).bit_length())<2 and all(e==2 for e in factorint(n>>m).values())) # Chai Wah Wu, Jan 11 2023
CROSSREFS
Characteristic function of A359580.
Absolute values of A359548, and their parity.
Also parity of A046692, A323910, A327276, A327278.
Cf. A227291, A359818 (Dirichlet inverse).
Sequence in context: A167700 A010057 A359548 * A359773 A359774 A204220
KEYWORD
nonn,mult
AUTHOR
Antti Karttunen, Jan 06 2023
STATUS
approved