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!)
A354989 a(n) = 1 if A345993(n) < A345992(n), otherwise 0. 5

%I #16 Jun 17 2022 14:52:52

%S 0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,

%T 1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,

%U 1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,1,0,0,1,1,0,0,1,0,0,1,0,1,0,0,0,1,0,0,0,1,0,0,0,0,1,0,1,1,0,0,1,1,0

%N a(n) = 1 if A345993(n) < A345992(n), otherwise 0.

%H Antti Karttunen, <a href="/A354989/b354989.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) = [A354988(n) < 0], where [ ] is the Iverson bracket.

%t a[n_] := Module[{m = 1}, While[! Divisible[m*(m + 1), n], m++]; If[GCD[n, m + 1] < GCD[n, m], 1, 0]]; Array[a, 100] (* _Amiram Eldar_, Jun 16 2022 *)

%o (PARI) A354989(n) = for(m=1, oo, if((m*(m+1))%n==0, return(gcd(n, 1+m)<gcd(n, m))));

%o (Python 3.8+)

%o from math import gcd, prod

%o from itertools import combinations

%o from sympy import factorint

%o from sympy.ntheory.modular import crt

%o def A354989(n):

%o if n == 1:

%o return 0

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

%o return 0 if len(plist) == 1 else int(gcd(n,s:=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))))) > gcd(n,s+1)) # _Chai Wah Wu_, Jun 16 2022

%Y Characteristic function of A345995.

%Y Cf. A345992, A345993, A354988.

%K nonn

%O 1

%A _Antti Karttunen_, Jun 16 2022

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 July 25 15:41 EDT 2024. Contains 374612 sequences. (Running on oeis4.)