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.

A344758 Smallest divisor d of n for which A011772(d) = A011772(n), where A011772(n) is the smallest number m such that m(m+1)/2 is divisible by n.

This page as a plain text file.
%I A344758 #10 Jun 04 2021 04:42:31
%S A344758 1,2,3,4,5,2,7,8,9,5,11,12,13,14,15,16,17,9,19,20,7,22,23,8,25,13,27,
%T A344758 4,29,30,31,32,33,17,35,9,37,38,13,8,41,42,43,44,45,46,47,48,49,25,51,
%U A344758 52,53,54,11,56,19,29,59,20,61,62,63,64,65,22,67,17,69,70,71,72,73,37,25,76,77,13,79,80,81,41,83
%N A344758 Smallest divisor d of n for which A011772(d) = A011772(n), where A011772(n) is the smallest number m such that m(m+1)/2 is divisible by n.
%H A344758 Antti Karttunen, <a href="/A344758/b344758.txt">Table of n, a(n) for n = 1..20000</a>
%F A344758 a(n) = n / A344759(n).
%e A344758 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, of which divisor 9 is the smallest, and therefore a(36) = 9.
%o A344758 (PARI)
%o A344758 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
%o A344758 A344758(n) = { my(x=A011772(n)); fordiv(n,d,if(A011772(d)==x, return(d))); };
%o A344758 (Python 3.8+)
%o A344758 from itertools import combinations
%o A344758 from math import prod
%o A344758 from sympy import factorint, divisors
%o A344758 from sympy.ntheory.modular import crt
%o A344758 def A011772(n):
%o A344758     plist = [p**q for p, q in factorint(2*n).items()]
%o A344758     if len(plist) == 1:
%o A344758         return n-1 if plist[0] % 2 else 2*n-1
%o A344758     return min(min(crt([m,2*n//m],[0,-1])[0],crt([2*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)))
%o A344758 def A344758(n):
%o A344758     m = A011772(n)
%o A344758     for d in divisors(n):
%o A344758         if A011772(d) == m:
%o A344758             return d # _Chai Wah Wu_, Jun 03 2021
%Y A344758 Cf. A011772, A344590, A344759.
%K A344758 nonn
%O A344758 1,2
%A A344758 _Antti Karttunen_, May 31 2021