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!)
A346596 Let m = A344005(n) = smallest m such that n divides m*(m+1); a(n) = max(gcd(n,m), gcd(n,m+1)). 2
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, 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, 11, 8, 19, 29, 59, 15, 61, 31, 9, 64, 13, 11, 67, 17, 23, 14, 71, 9, 73, 37, 25, 19 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
This is the maximum of A345992 and A345993.
LINKS
PROG
(PARI) f(n) = my(m=1); while ((m*(m+1)) % n, m++); m; \\ A344005
a(n) = my(m=f(n)); max(gcd(n, m), gcd(n, m+1)); \\ Michel Marcus, Aug 06 2021
(Python 3.8+)
from math import gcd, prod
from itertools import combinations
from sympy import factorint
from sympy.ntheory.modular import crt
def A346596(n):
if n == 1:
return 1
plist = tuple(p**q for p, q in factorint(n).items())
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
CROSSREFS
Cf. also A034699, A324388.
Sequence in context: A330691 A034699 A354933 * A324388 A309639 A327393
KEYWORD
nonn
AUTHOR
STATUS
approved

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 April 18 16:22 EDT 2024. Contains 371780 sequences. (Running on oeis4.)