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.

A344006 a(n) = m*(m+1)/n, where A344005(n) is the smallest number m such that n divides m*(m+1).

Original entry on oeis.org

2, 1, 2, 3, 4, 1, 6, 7, 8, 2, 10, 1, 12, 3, 2, 15, 16, 4, 18, 1, 2, 5, 22, 3, 24, 6, 26, 2, 28, 1, 30, 31, 4, 8, 6, 2, 36, 9, 4, 6, 40, 1, 42, 3, 2, 11, 46, 5, 48, 12, 6, 3, 52, 13, 2, 1, 6, 14, 58, 4, 60, 15, 12, 63, 10, 2, 66, 4, 8, 3, 70, 1, 72, 18, 8, 5, 6, 2, 78, 3, 80, 20, 82, 5
Offset: 1

Views

Author

N. J. A. Sloane, Jun 04 2021

Keywords

Comments

a(n) = n-1 if n is a prime power. - Chai Wah Wu, Jun 04 2021

Crossrefs

Programs

  • PARI
    a(n) = for(m=1, oo, if((m*(m+1))%n==0, return(m*(m+1)/n))) \\ Felix Fröhlich, Jun 04 2021
    (Python 3.8+)
    from itertools import combinations
    from math import prod
    from sympy import factorint
    from sympy.ntheory.modular import crt
    def A344006(n):
        if n == 1:
            return 2
        plist = [p**q for p, q in factorint(n).items()]
        if len(plist) == 1:
            return n-1
        else:
            m = 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))))
            return m*(m+1)//n # Chai Wah Wu, Jun 04 2021