login
A354918
a(n) = A344005(n) mod 2, where A344005(n) is the smallest positive m such that n divides the oblong number m*(m+1).
6
1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0
OFFSET
1
FORMULA
a(n) = A000035(A344005(n)).
a(n) = A000035(n) XOR A354920(n), where XOR is bitwise-XOR, A003987.
PROG
(PARI) A354918(n) = for(m=1, oo, if((m*(m+1))%n==0, return(m%2)));
(Python 3.8+)
from itertools import combinations
from math import prod
from sympy import factorint
from sympy.ntheory.modular import crt
def A354918(n):
if n == 1:
return 1
plist = tuple(p**q for p, q in factorint(n).items())
return (n-1 if len(plist) == 1 else int(min(min(crt((m, n//m), (0, -1))[0], crt((n//m, m), (0, -1))[0]) for m in (prod(d) for l in range(1, len(plist)//2+1) for d in combinations(plist, l))))) & 1 # Chai Wah Wu, Jun 12 2022
CROSSREFS
Characteristic function of A354919. Parity of A344005.
Cf. A000035, A002378, A003987, A343999 (even bisection), A354920.
Sequence in context: A342025 A353518 A353687 * A354108 A181101 A321512
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jun 12 2022
STATUS
approved