login
A295316
a(n) = 1 if there are no even exponents in the prime factorization of n, 0 otherwise.
14
1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1
OFFSET
1
COMMENTS
Characteristic function for A268335.
FORMULA
Multiplicative with a(p^e) = A000035(e).
a(1) = 1, for n > 1, a(n) = A000035(A067029(n)) * a(A028234(n)).
a(n) = 1 iff A162641(n) = 0.
For n > 1, a(n) = A267115(n) mod 2.
a(n) = A355825(A268385(n)).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = A065463. - Amiram Eldar, Jul 23 2022
MATHEMATICA
Array[Boole[AllTrue[FactorInteger[#][[All, -1]], OddQ]] &, 120] (* Michael De Vlieger, Nov 23 2017 *)
PROG
(PARI)
vecproduct(v) = { my(m=1); for(i=1, #v, m *= v[i]); m; };
A295316(n) = vecproduct(apply(e -> (e%2), factorint(n)[, 2]));
(Scheme, with memoization-macro definec)
(definec (A295316 n) (if (= 1 n) n (if (even? (A067029 n)) 0 (A295316 (A028234 n)))))
(Python)
from sympy import factorint
def A295316(n): return int(all(map(lambda m:m&1, factorint(n).values()))) # Chai Wah Wu, Jan 04 2023
CROSSREFS
Cf. A000035, A065463, A072587 (positions of zeros), A268335 (of ones), A162641, A267115, A268385, A355825, A355936 (Dirichlet inverse).
Cf. also A033634, A293449.
Sequence in context: A255887 A359473 A181183 * A014677 A307425 A210826
KEYWORD
nonn,mult
AUTHOR
Antti Karttunen, Nov 23 2017
STATUS
approved