OFFSET
1,1
COMMENTS
As can be seen from A214749, for most composites k that are not a prime minus one, the smallest value of m that satisfies k-m | k^2+m is smaller than k/2. This sequence lists the exceptions.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
PROG
(Python)
from sympy import isprime
a=[]
for n in range(2, 1000):
for m in range(1, n//2+1):
if (n**2+m)%(n-m)==0:
if m==n/2 and not isprime(n+1):
a.append(n)
break
print(a)
(Python)
from itertools import count, islice
from sympy import isprime
from sympy.abc import x, y
from sympy.solvers.diophantine.diophantine import diop_quadratic
def A365248_gen(startvalue=2): # generator of terms >= startvalue
return filter(lambda n:not isprime(n+1) and min(int(x) for x, y in diop_quadratic(n*(n-y)+x*(y+1)) if x>0)==n>>1, count(max(startvalue+startvalue&1, 2), 2))
(PARI) f(n) = my(m=1); while((n^2+m) % (n-m), m++); m; \\ A214749
lista(nn) = my(list=List()); forcomposite(c=1, nn, if ((f(c) == c/2) && !isprime(c+1), listput(list, c))); Vec(list); \\ Michel Marcus, Sep 08 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Bob Andriesse, Aug 28 2023
STATUS
approved