OFFSET
2,3
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
LINKS
Clark Kimberling, Table of n, a(n) for n = 2..1000
EXAMPLE
Write x#y if x|y is false; then 6#50, 5#51, 4|52, so a(7) = 3.
MATHEMATICA
Table[m = 1; While[! Divisible[n^2+m, n-m], m++]; m, {n, 2, 100}]
PROG
(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
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jul 29 2012
STATUS
approved