OFFSET
1,2
COMMENTS
Numbers k such that the parity of A182665(k) differs from the parity of k itself.
PROG
(PARI)
A354918(n) = for(m=1, oo, if((m*(m+1))%n==0, return(m%2)));
isA354919(n) = A354918(n);
(Python 3.8+)
from itertools import combinations, islice, count
from math import prod
from sympy import factorint
from sympy.ntheory.modular import crt
def A354919_gen(startvalue=1): # generator of terms >= startvalue
if startvalue <= 1:
yield 1
for n in count(max(startvalue, 2)):
plist = tuple(p**q for p, q in factorint(n).items())
if len(plist) == 1:
if (n-1) & 1: yield n
elif 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:
yield n
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jun 12 2022
STATUS
approved