OFFSET
1,6
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
FORMULA
EXAMPLE
36 has 9 divisors: 1, 2, 3, 4, 6, 9, 12, 18, 36. When A011772 is applied to them, one obtains values [1, 3, 2, 7, 3, 8, 8, 8, 8], thus there are four divisors that obtain the maximal value 8 obtained at 36 itself, therefore a(36) = 4.
MATHEMATICA
A011772[n_] := Module[{m = 1}, While[Not[IntegerQ[m(m+1)/(2n)]], m++]; m];
Array[a, 100] (* Jean-François Alcover, Jun 12 2021 *)
PROG
(PARI)
A011772(n) = { if(n==1, return(1)); my(f=factor(if(n%2, n, 2*n)), step=vecmax(vector(#f~, i, f[i, 1]^f[i, 2]))); forstep(m=step, 2*n, step, if(m*(m-1)/2%n==0, return(m-1)); if(m*(m+1)/2%n==0, return(m))); }; \\ From A011772
(Python)
from itertools import combinations
from functools import reduce
from operator import mul
from sympy import factorint, divisors
from sympy.ntheory.modular import crt
def A011772(n):
plist = [p**q for p, q in factorint(2*n).items()]
if len(plist) == 1:
return n-1 if plist[0] % 2 else 2*n-1
return min(min(crt([m, 2*n//m], [0, -1])[0], crt([2*n//m, m], [0, -1])[0]) for m in (reduce(mul, d) for l in range(1, len(plist)//2+1) for d in combinations(plist, l)))
def A344590(n):
m = A011772(n)
return sum(1 for d in divisors(n) if A011772(d) == m) # Chai Wah Wu, Jun 02 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 31 2021
STATUS
approved