|
|
A318358
|
|
a(1) = 2; for n > 1, a(n) is the least positive number not yet in the sequence such that Sum_{k=1..n} a(k) divides Sum_{k=1..n} a(k)^2.
|
|
2
|
|
|
2, 6, 5, 13, 9, 20, 30, 19, 52, 78, 18, 7, 43, 151, 79, 126, 88, 373, 183, 84, 177, 521, 263, 2347, 1305, 392, 294, 1207, 3946, 1973, 2099, 185, 999, 518, 1970, 9791, 4577, 6111, 4811, 21372, 10154, 3210, 9874, 89482, 49678, 9918, 8344, 46684, 65588, 50136
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
|
|
|
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):]:
break
p += a
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|