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.

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

Original entry on oeis.org

6, 6, 12, 20, 12, 42, 24, 18, 15, 110, 20, 156, 35, 30, 48, 272, 36, 342, 30, 28, 66, 506, 40, 100, 78, 54, 70, 812, 42, 930, 96, 66, 102, 63, 45, 1332, 114, 78, 60, 1640, 56, 1806, 77, 90, 138, 2162, 80, 294, 75, 102, 117, 2756, 108, 66, 72, 114, 174, 3422, 84, 3660
Offset: 2

Views

Author

Amarnath Murthy, Jul 22 2005

Keywords

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

Crossrefs

Cf. A214750.

Programs

  • 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
  • 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

Extensions

Corrected and extended by Emeric Deutsch, Jul 29 2005