OFFSET
1,3
COMMENTS
Here round(x) = floor(x + 1/2).
a(n) is related to the number of lattice points in a circle. Let C(x) equal the number of square lattice points in a circle of radius sqrt(x) centered at the origin. Then a(n) = (C(2n) - 4n - 1)/4. (Prop 3.5 in Dent & Shor paper)
LINKS
Nicholas Dent and Caleb M. Shor, On residues of rounded shifted fractions with a common numerator, arXiv:2206.15452 [math.NT], 2022.
FORMULA
a(n) = n - floor(2n/3) + floor(2n/5) - floor(2n/7) + ...
a(n) = -n + Sum_{k=1..2n} d_1(k) - d_3(k), where d_i(k) is the number of divisors of k that are congruent to i modulo 4.
EXAMPLE
For n=5: round(5/1), round(5/2), round(5/3), round(5/4), round(5/5) = 5, 3, 2, 1, 1 among which 4 are odd so a(5)=4.
PROG
(PARI) a(n) = sum(k=1, n, round(n/k)%2) \\ Andrew Howroyd, May 28 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Caleb M. Shor, May 28 2023
STATUS
approved