login
A375464
a(n) is the number of nonnegative numbers k < n such that the equation (n-k)*x - k = y^2 is solvable.
1
1, 2, 3, 3, 4, 5, 4, 6, 6, 5, 9, 8, 5, 10, 10, 8, 10, 8, 10, 15, 13, 6, 12, 17, 7, 16, 15, 11, 17, 15, 14, 17, 14, 13, 27, 22, 6, 19, 22, 20, 23, 17, 13, 27, 21, 15, 23, 24, 16, 23, 30, 21, 21, 27, 26, 37, 17, 7, 37, 29, 22, 29, 32, 24, 34, 34, 15, 39, 34, 19, 35
OFFSET
1,2
COMMENTS
a(n) is the number of positive numbers j <= n such that -n is a quadratic residue mod j. - Robert Israel, Oct 16 2024
LINKS
EXAMPLE
a(1) = 1 because (1-0)*x - 0 = y^2 is solvable where x: 0, 1, 4, 9, .. A000290;
a(2) = 2 because (2-0)*x - 0 = y^2 is solvable where x: 0, 2, 8, 18, .. A001105,
(2-1)*x - 1 = y^2 is solvable where x: 1, 2, 5, 10, .. A002522;
a(3) = 3 because (3-0)*x - 0 = y^2 is solvable where x: 0, 3, 12, 27, .. A033428,
(3-1)*x - 1 = y^2 is solvable where x: 1, 5, 13, 25, .. A001844,
(3-2)*x - 2 = y^2 is solvable where x: 2, 3, 6, 11, .. A059100;
a(4) = 3 because (4-0)*x - 0 = y^2 is solvable where x: 0, 1, 4, 9, .. A000290,
(4-1)*x - 1 = y^2 is unsolvable,
(4-2)*x - 2 = y^2 is solvable where x: 1, 3, 9, 19, .. A058331;
(4-3)*x - 3 = y^2 is solvable where x: 2, 3, 6, 11, .. A117950.
MAPLE
f:= proc(n) local j; add(numtheory:-quadres(-n, j)+1, j=1..n)/2 end proc:
map(f, [$1..100]); # Robert Israel, Oct 16 2024
PROG
(PARI) is(k, n) = for (i=0, n-1, if (issquare((n-i)*k - i), return(1)));
a(n) = sum(k=0, n-1, is(k, n)); \\ Michel Marcus, Aug 17 2024
KEYWORD
nonn
AUTHOR
STATUS
approved