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)).

Original entry on oeis.org

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
Offset: 1

Views

Author

Keywords

Comments

This is the maximum of A345992 and A345993.

Crossrefs

Programs

  • 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