The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A354920 a(n) = A182665(n) mod 2, where A182665(n) is the greatest x < n such that n divides x*(x-1). 5
0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1
LINKS
FORMULA
a(n) = A000035(A182665(n)).
a(n) = A000035(n) XOR A354918(n), where XOR is bitwise-XOR, A003987.
PROG
(PARI) A354920(n) = forstep(x=n-1, 0, -1, if(!((x*(x-1))%n), return(x%2)));
(Python 3.8+)
from itertools import combinations
from math import prod
from sympy import factorint
from sympy.ntheory.modular import crt
def A354920(n):
if n == 1:
return 0
plist = tuple(p**q for p, q in factorint(n).items())
return 1 if len(plist) == 1 else (n-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
Parity of A182665. Characteristic function of A354921.
Sequence in context: A268411 A069513 A092248 * A106743 A284944 A284674
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jun 12 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 16 00:16 EDT 2024. Contains 372549 sequences. (Running on oeis4.)