login
a(n) is the least nonnegative integer of the form n*(n+k)/(n-k) with k>0.
2

%I #31 Oct 07 2023 21:40:32

%S 6,6,12,20,12,42,24,18,15,110,20,156,35,30,48,272,36,342,30,28,66,506,

%T 40,100,78,54,70,812,42,930,96,66,102,63,45,1332,114,78,60,1640,56,

%U 1806,77,90,138,2162,80,294,75,102,117,2756,108,66,72,114,174,3422,84,3660

%N a(n) is the least nonnegative integer of the form n*(n+k)/(n-k) with k>0.

%C It appears that k's are given by A214750. - _Michel Marcus_, Aug 16 2019

%C If n-k = s, then n = s+k and n-k | n*(n+k) is equivalent to s | (s^2 + 3*s*k + 2*k^2). So n-k | n*(n+k) is equivalent to n-k | 2*k^2. If n-m = s, then n = s+m and n-m | n^2+m^2 is equivalent to s | (s^2 + 2*s*m + 2*m^2). So n-m | n^2+m^2 is equivalent to n-m | 2*m^2. Therefore n-k | n*(n+k) is equivalent to n-m | n^2+m^2 and the m's from A214750 and the k's from this sequence are the same. - _Bob Andriesse_, Dec 26 2022

%C The value of k is a simple function of n and a(n). Since the harmonic mean H of n and n*(n+k)/(n-k) equals n+k, k = H(n, a(n)) - n. Examples: For n = 7, a(n) = 42 and H(7, 42) = 12, so k = 12 - 7 = 5 = A214750(7). For n = 10, a(n) = 15 and H(10, 15) = 12, so k = 12 - 10 = 2 = A214750(10). - _Bob Andriesse_, Jan 03 2023

%C If n is an odd prime, then k = A214750(n) = n-2 and a(n) = n*(n+k)/(n-k) = n*(n-1). Examples: a(5) = 5*4 = 20 and a(1111111111111111111) = 1234567901234567899876543209876543210. - _Bob Andriesse_, Jul 16 2023

%p a:=proc(n) local p: p:=proc(k) if type(n*(n+k)/(n-k),integer)=true then n*(n+k)/(n-k) else fi end; [seq(p(j),j=1..n-1)][1]: end: seq(a(n),n=2..75); # _Emeric Deutsch_, Jul 29 2005

%o (PARI) a(n) = my(k=1); while(denominator((x=n*(n+k)/(n-k))) != 1, k++); x; \\ _Michel Marcus_, Aug 16 2019

%o (Python)

%o from sympy.abc import x, y

%o from sympy.solvers.diophantine.diophantine import diop_quadratic

%o def A110357(n): return min(int(x) for x,y in diop_quadratic(n*(n+y)-x*(n-y)) if x>0 and y>0) # _Chai Wah Wu_, Oct 06 2023

%Y Cf. A214750.

%K nonn

%O 2,1

%A _Amarnath Murthy_, Jul 22 2005

%E Corrected and extended by _Emeric Deutsch_, Jul 29 2005