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.

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

This page as a plain text file.
%I A346596 #16 Jun 17 2022 10:56:28
%S A346596 1,2,3,4,5,3,7,8,9,5,11,4,13,7,5,16,17,9,19,5,7,11,23,8,25,13,27,7,29,
%T A346596 6,31,32,11,17,7,9,37,19,13,8,41,7,43,11,9,23,47,16,49,25,17,13,53,27,
%U A346596 11,8,19,29,59,15,61,31,9,64,13,11,67,17,23,14,71,9,73,37,25,19
%N A346596 Let m = A344005(n) = smallest m such that n divides m*(m+1); a(n) = max(gcd(n,m), gcd(n,m+1)).
%C A346596 This is the maximum of A345992 and A345993.
%H A346596 N. J. A. Sloane, <a href="/A346596/b346596.txt">Table of n, a(n) for n = 1..10000</a>
%o A346596 (PARI) f(n) = my(m=1); while ((m*(m+1)) % n, m++); m; \\ A344005
%o A346596 a(n) = my(m=f(n)); max(gcd(n,m), gcd(n,m+1)); \\ _Michel Marcus_, Aug 06 2021
%o A346596 (Python 3.8+)
%o A346596 from math import gcd, prod
%o A346596 from itertools import combinations
%o A346596 from sympy import factorint
%o A346596 from sympy.ntheory.modular import crt
%o A346596 def A346596(n):
%o A346596     if n == 1:
%o A346596         return 1
%o A346596     plist = tuple(p**q for p, q in factorint(n).items())
%o A346596     return n if len(plist) == 1 else max(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 17 2022
%Y A346596 Cf. A344005, A345992, A345993, A345994, A345995.
%Y A346596 Cf. also A034699, A324388.
%K A346596 nonn
%O A346596 1,2
%A A346596 _Robert Dougherty-Bliss_ and _N. J. A. Sloane_, Jul 15 2021