cp's OEIS Frontend

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.

A345993 Let m = A344005(n) = smallest m such that n divides m*(m+1); a(n) = gcd(n,m+1).

This page as a plain text file.
%I A345993 #37 Sep 01 2025 14:15:12
%S A345993 1,2,3,4,5,3,7,8,9,5,11,4,13,7,3,16,17,9,19,5,7,11,23,3,25,13,27,4,29,
%T A345993 6,31,32,3,17,5,9,37,19,13,8,41,7,43,4,5,23,47,16,49,25,3,13,53,27,11,
%U A345993 8,19,29,59,4,61,31,7,64,13,6,67,17,3,5,71,9,73,37,25,4,11,13,79
%N A345993 Let m = A344005(n) = smallest m such that n divides m*(m+1); a(n) = gcd(n,m+1).
%C A345993 By definition, a(n) <= n and a(n)*A345992(n) = n.
%C A345993 a(n) is even iff n/2 is in A344001. This is true, but essentially trivial, and does not provide any insight into either sequence.
%C A345993 Empirical: For n >= 3, a(n) >= 3, and a(n) = 3 iff n in 3*{2^odd, primes == -1 mod 6}.
%H A345993 N. J. A. Sloane, <a href="/A345993/b345993.txt">Table of n, a(n) for n = 1..10000</a>
%p A345993 # load Findm from A344005
%p A345993 ans:=[];
%p A345993 for n from 1 to 40 do t1:=Findm(n)[1]+1; ans:=[op(ans), igcd(n,t1)]; od:
%p A345993 ans;
%o A345993 (PARI) f(n) = my(m=1); while ((m*(m+1)) % n, m++); m; \\ A344005
%o A345993 a(n) = gcd(n, f(n)+1); \\ _Michel Marcus_, Aug 06 2021
%o A345993 (Python)
%o A345993 from math import gcd, prod
%o A345993 from itertools import combinations
%o A345993 from sympy import factorint
%o A345993 from sympy.ntheory.modular import crt
%o A345993 def A345993(n):
%o A345993     if n == 1:
%o A345993         return 1
%o A345993     plist = tuple(p**q for p, q in factorint(n).items())
%o A345993     return n if len(plist) == 1 else gcd(n,1+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))))) # _Chai Wah Wu_, Jun 16 2022
%Y A345993 Cf. A011772, A344001, A344005, A345992, A345994, A345995.
%Y A345993 Cf. also A051119, A284600.
%K A345993 nonn,changed
%O A345993 1,2
%A A345993 _Robert Dougherty-Bliss_ and _N. J. A. Sloane_, Jul 15 2021