|
|
A359549
|
|
a(n) = 1 if n is either an odd squarefree number squared or twice such a number, otherwise 0.
|
|
5
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1
|
|
LINKS
|
|
|
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.
|
|
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, also their parity.
|
|
KEYWORD
|
nonn,mult
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|