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.

A214749 Least m > 0 such that n - m divides n^2 + m.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 2, 3, 5, 5, 6, 6, 4, 3, 8, 8, 9, 9, 5, 7, 11, 11, 4, 12, 8, 6, 14, 14, 15, 15, 8, 11, 17, 5, 18, 18, 12, 9, 20, 20, 21, 21, 8, 15, 23, 23, 6, 14, 16, 12, 26, 26, 9, 11, 14, 19, 29, 29, 30, 30, 20, 7, 12, 10, 33, 33, 17, 23, 35, 35, 36, 36, 24, 15, 32, 11
Offset: 2

Views

Author

Clark Kimberling, Jul 29 2012

Keywords

Comments

Consider any odd n and choose m = (n-1)/2, then (n^2+m)/(n-m) = 2*n-1. So n-m | n^2+m. Therefore a(n) <= (n-1)/2. For the even n-1 also choose m = (n-1)/2, then ((n-1)^2+m)/(n-1-m) = 2*n-1. Therefore a(n-1) <= (n-1)/2. It appears that a(n) = a(n-1) = (n-1)/2 if n is an odd prime, and that m cannot have a smaller value. Examples: a(7) = a(6) = (7-1)/2 = 3 and a(29) = a(28) = 14. For most odd composites n, the smallest value of m is smaller than (n-1)/2, but for certain odd composites n, m cannot be smaller than (n-1)/2, just like what seems to be the rule for the primes. Examples: n = 25, 85, 121, 133, 145, 187, ... - Bob Andriesse, Aug 25 2023
From Bob Andriesse, Oct 03 2023: (Start)
This sequence is based on the divisibility of n^2+m by n-m and is one of infinitely many possible sequences representing the smallest m>0 such that n-m | n^k + m^(k-1) for k>1. We can call these sequences the generalized forms of A214749 and their index k. For A214749 k=2. Let’s call their terms a_k(n) and let r = (n^k + m^(k-1)) / (n-m). For even n choose m = n/2, then r = 2*n^(k-1) + (n/2)^(k-2). So for even n, r is an integer for all k>1. Therefore, for even n, every term a_k(n) = m of any of the generalized sequences is always smaller than or equal to n/2.
For odd n we choose m = (n-1)/2. Then r = 2 * [n^k + ((n-1)/2)^(k-1)] / n+1. Because n is odd, we can write n = 2*z-1 and r = [(2*z-1)^k + (z-1)^(k-1)] / z. After expansion of the numerator the only terms that do not contain at least one factor z are (-1)^(k) and (-1)^(k-1) and these add up to zero. So r is an integer and the divisibility condition is met. Therefore, for odd n, every term a_k(n) = m of any of the generalized sequences is always smaller than or equal to (n-1)/2. Example: (13^5 + 6^4) / (13-6) = 53227.
Proof that a_k(n) = m = (n-1)/2 when n is an odd prime: If n-m = z then m = n-z and n-m | n^k+m^(k-1) is equivalent to z | n^k + (n-z)^(k-1) or z | n^k+n^(k-1). So n-m | n^(k-1)*(n+1). Since n is an odd prime, n-m must divide n+1. But then n-m can never be bigger than (n+1)/2. So n-m <= (n+1)/2 or m >= (n-1)/2. We already know that m <= (n-1)/2. Therefore a_k(n) = m = (n-1)/2 when n is an odd prime. Examples: a(11) = 5 and a(1111111111111111111)= 555555555555555555. (End)
a(n) is also the smallest m>0 such that n-m divides m*(n+1), n*(m+1), n*(n+1), m*(m+1) and m^2+n. Example: 13-6 divides 6*(13+1), 13*(6+1), 13*(13+1), 6*(6+1) and 6^2+13. - Bob Andriesse, Jan 04 2024

Examples

			Write x#y if x|y is false; then 6#50, 5#51, 4|52, so a(7) = 3.
		

Crossrefs

Cf. A214750.

Programs

  • Mathematica
    Table[m = 1; While[! Divisible[n^2+m,n-m], m++]; m, {n, 2, 100}]
  • PARI
    a(n) = my(m=1); while((n^2+m) % (n-m), m++); m; \\ Michel Marcus, Sep 04 2023
    
  • Python
    from sympy.abc import x, y
    from sympy.solvers.diophantine.diophantine import diop_quadratic
    def A214749(n): return min(int(x) for x,y in diop_quadratic(n*(n-y)+x*(y+1)) if x>0) # Chai Wah Wu, Oct 06 2023