login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Let m = A344005(n) = smallest m such that n divides m*(m+1); a(n) = gcd(n,m).
26

%I #59 Jul 09 2022 22:16:49

%S 1,1,1,1,1,2,1,1,1,2,1,3,1,2,5,1,1,2,1,4,3,2,1,8,1,2,1,7,1,5,1,1,11,2,

%T 7,4,1,2,3,5,1,6,1,11,9,2,1,3,1,2,17,4,1,2,5,7,3,2,1,15,1,2,9,1,5,11,

%U 1,4,23,14,1,8,1,2,3,19,7,6,1,5,1,2,1,4,17,2,29,8,1,9,13,23,3,2,19,32,1,2,11,4,1,17

%N Let m = A344005(n) = smallest m such that n divides m*(m+1); a(n) = gcd(n,m).

%C By definition, a(n)*A345993(n) = n.

%C a(n) is even iff n/2 is in A344000. This is true, but essentially trivial, and does not provide any insight into either sequence.

%C Empirical: For n >= 3, a(n) <= n/3, and a(n) = n/3 iff n is in 3*{2^odd, primes == -1 mod 6}.

%C If n = 2*p^k where p is an odd prime then m = A344005(n) = p^k - 1 and a(n) = 2. Conversely, it appears that if a(n) = 2 then n is twice an odd prime power. (Corrected by _Antti Karttunen_, Jun 14 2022)

%C a(n) = 1 if n is a prime power. - _Chai Wah Wu_, Jun 01 2022

%C From _Antti Karttunen_, Jun 14 2022: (Start)

%C Conversely, if a(n) = 1 [i.e., A345993(n) = n] then n is a power of prime. (This follows from _N. J. A. Sloane_'s Jul 11 2021 theorem given in A344005).

%C Apparently, a(n) = 3 iff n = A354984(k) = 3*A137827(k), for some k >= 1.

%C (End)

%H N. J. A. Sloane, <a href="/A345992/b345992.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = gcd(n, A182665(n)) = gcd(A182665(n), A344005(n)). - _Antti Karttunen_, Jun 13 2022

%p # load Findm from A344005

%p ans:=[];

%p for n from 1 to 40 do t1:=Findm(n)[1]; ans:=[op(ans), igcd(n,t1)]; od:

%p ans;

%t smd[n_]:=Module[{m=1},While[Mod[m(m+1),n]!=0,m++];GCD[n,m]]; Array[smd,110] (* _Harvey P. Dale_, Jan 07 2022 *)

%o (PARI) f(n) = my(m=1); while ((m*(m+1)) % n, m++); m; \\ A344005

%o a(n) = gcd(n,f(n)); \\ _Michel Marcus_, Aug 06 2021

%o (Python 3.8+)

%o from math import gcd, prod

%o from itertools import combinations

%o from sympy import factorint

%o from sympy.ntheory.modular import crt

%o def A345992(n):

%o if n == 1:

%o return 1

%o plist = tuple(p**q for p, q in factorint(n).items())

%o return 1 if len(plist) == 1 else gcd(n,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))))) # _Chai Wah Wu_, Jun 01 2022

%Y Cf. A011772, A137827, A182665, A344000, A344005, A345993, A345994, A345995, A354930, A354931 (the least occurrence of each n=1..), A354984.

%Y Cf. also A007528, A051119, A284600.

%K nonn

%O 1,6

%A _Robert Dougherty-Bliss_ and _N. J. A. Sloane_, Jul 15 2021