login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Positions of odd terms in A344005.
5

%I #14 Jun 13 2022 03:02:18

%S 1,2,4,8,12,15,16,28,30,32,33,40,44,45,48,51,56,60,63,64,65,66,69,76,

%T 77,80,87,90,91,92,95,102,104,108,115,120,123,124,126,128,130,132,138,

%U 141,143,144,145,153,154,159,161,172,174,175,177,180,182,184,187,188,189,190,192,195,204,207,213,215,221,224

%N Positions of odd terms in A344005.

%C Numbers k such that the parity of A182665(k) differs from the parity of k itself.

%o (PARI)

%o A354918(n) = for(m=1, oo, if((m*(m+1))%n==0, return(m%2)));

%o isA354919(n) = A354918(n);

%o (Python 3.8+)

%o from itertools import combinations, islice, count

%o from math import prod

%o from sympy import factorint

%o from sympy.ntheory.modular import crt

%o def A354919_gen(startvalue=1): # generator of terms >= startvalue

%o if startvalue <= 1:

%o yield 1

%o for n in count(max(startvalue,2)):

%o plist = tuple(p**q for p, q in factorint(n).items())

%o if len(plist) == 1:

%o if (n-1) & 1: yield n

%o 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:

%o yield n

%o A354919_list = list(islice(A354919_gen(),40)) # _Chai Wah Wu_, Jun 12 2022

%Y Cf. A002378, A182665, A344005, A354918 (characteristic function).

%Y Cf. also A354921.

%K nonn

%O 1,2

%A _Antti Karttunen_, Jun 12 2022