A344006 a(n) = m*(m+1)/n, where A344005(n) is the smallest number m such that n divides m*(m+1).
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
Keywords
Links
- Jon E. Schoenfield, Table of n, a(n) for n = 1..10000
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
Comments