This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A354921 #16 Jun 13 2022 19:32:29 %S A354921 2,3,4,5,7,8,9,11,12,13,16,17,19,21,23,25,27,28,29,30,31,32,35,37,39, %T A354921 40,41,43,44,47,48,49,53,55,56,57,59,60,61,64,66,67,71,73,75,76,79,80, %U A354921 81,83,85,89,90,92,93,97,99,101,102,103,104,105,107,108,109,111,113,117,119,120,121,124,125,126,127,128 %N A354921 Positions of odd terms in A182665. %C A354921 Numbers k such that the parity of A344005(k) differs from the parity of k itself. %o A354921 (PARI) %o A354921 A354920(n) = forstep(x=n-1,0,-1,if(!((x*(x-1))%n),return(x%2))); %o A354921 isA354921(n) = A354920(n); %o A354921 (Python 3.8+) %o A354921 from itertools import combinations, islice, count %o A354921 from math import prod %o A354921 from sympy import factorint %o A354921 from sympy.ntheory.modular import crt %o A354921 def A354921_gen(startvalue=2): # generator of terms >= startvalue %o A354921 for n in count(max(startvalue,2)): %o A354921 plist = tuple(p**q for p, q in factorint(n).items()) %o A354921 if len(plist) == 1 or (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: %o A354921 yield n %o A354921 A354921_list = list(islice(A354921_gen(),40)) # _Chai Wah Wu_, Jun 12 2022 %Y A354921 Cf. A182665, A344005, A354920 (characteristic function), A354922 (complement). %Y A354921 Cf. also A354919. %K A354921 nonn %O A354921 1,1 %A A354921 _Antti Karttunen_, Jun 12 2022