OFFSET
1,1
COMMENTS
Is this sequence infinite?
The variant of this sequence starting with 1 has only one term.
See A318359 for a similar sequence.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..250 (n = 1..100 from Rémy Sigrist)
EXAMPLE
For n = 3:
- (2^2 + 6^2 + 1^2) == 5 mod (2 + 6 + 1),
- (2^2 + 6^2 + 3^2) == 5 mod (2 + 6 + 3),
- (2^2 + 6^2 + 4^2) == 8 mod (2 + 6 + 4),
- (2^2 + 6^2 + 5^2) == 0 mod (2 + 6 + 5),
- hence a(3) = 5.
PROG
(PARI) s=0; s2=0; p=0; v=2; for (n=1, 50, print1 (v ", "); s+=v; s2+=v^2; p+=2^v; for (w=1, oo, if (!bittest(p, w) && (s2+w^2)%(s+w)==0, v=w; break)))
(Python)
import bisect
from sympy.solvers.diophantine import diop_quadratic
from sympy.abc import x, y
for _ in range(100):
r = sorted(next(zip(*diop_quadratic(x**2+q-p*y-x*y))))
for a in r[bisect.bisect_right(r, 0):]:
if a not in A318358_set:
A318358_list.append(a)
A318358_set.add(a)
break
p += a
q += a**2 # Chai Wah Wu, Aug 28 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Aug 24 2018
STATUS
approved