login
A330682
a(n) = 1 if the 2-adic and 3-adic valuations of A025487(n) are equal, 0 otherwise.
5
1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 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, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0
OFFSET
1
FORMULA
a(n) = [A007814(A025487(n)) == A007949(A025487(n))], where [ ] is the Iverson bracket.
a(n) = A000035(A181815(n)) = A181815(n) mod 2.
a(A329897(n)) = 1, a(A329898(n)) = 0.
MATHEMATICA
s = {1}; Do[If[GreaterEqual @@ (f = FactorInteger[n])[[;; , 2]] && PrimePi[f[[-1, 1]]] == Length[f], AppendTo[s, If[Equal @@ IntegerExponent[n, {2, 3}], 1, 0]]], {n, 2, 50000}]; s (* Amiram Eldar, Jul 27 2023 *)
PROG
(PARI) A330682(n) = (A181815(n)%2);
(Python)
from itertools import count
from functools import lru_cache
from sympy import prime, integer_log, multiplicity
from oeis_sequences.OEISsequences import bisection
def A330682(n):
@lru_cache(maxsize=None)
def g(x, m, j): return sum(g(x//(prime(m)**i), m-1, i) for i in range(j, integer_log(x, prime(m))[0]+1)) if m-1 else max(0, x.bit_length()-j)
def f(x):
c, p = n-1+x, 1
for k in count(1):
p *= prime(k)
if p>x:
break
c -= g(x, k, 1)
return c
return int(multiplicity(3, m:=bisection(f, n, n))==(~m&m-1).bit_length()) # Chai Wah Wu, Mar 31 2026
CROSSREFS
Characteristic function of A329897.
Sequence in context: A304362 A368997 A373830 * A230135 A359836 A359835
KEYWORD
nonn
AUTHOR
Antti Karttunen, Dec 24 2019
STATUS
approved