OFFSET
2,1
COMMENTS
It appears that k's are given by A214750. - Michel Marcus, Aug 16 2019
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
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
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
MAPLE
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
PROG
(PARI) a(n) = my(k=1); while(denominator((x=n*(n+k)/(n-k))) != 1, k++); x; \\ Michel Marcus, Aug 16 2019
(Python)
from sympy.abc import x, y
from sympy.solvers.diophantine.diophantine import diop_quadratic
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
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Jul 22 2005
EXTENSIONS
Corrected and extended by Emeric Deutsch, Jul 29 2005
STATUS
approved