login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

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

%I #22 Jun 13 2022 02:27:45

%S 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,

%T 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,

%U 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

%N a(n) = A344005(n) mod 2, where A344005(n) is the smallest positive m such that n divides the oblong number m*(m+1).

%H Antti Karttunen, <a href="/A354918/b354918.txt">Table of n, a(n) for n = 1..100000</a>

%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>

%F a(n) = A000035(A344005(n)).

%F a(n) = A000035(n) XOR A354920(n), where XOR is bitwise-XOR, A003987.

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

%o (Python 3.8+)

%o from itertools import combinations

%o from math import prod

%o from sympy import factorint

%o from sympy.ntheory.modular import crt

%o def A354918(n):

%o if n == 1:

%o return 1

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

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

%Y Characteristic function of A354919. Parity of A344005.

%Y Cf. A000035, A002378, A003987, A343999 (even bisection), A354920.

%K nonn

%O 1

%A _Antti Karttunen_, Jun 12 2022