OFFSET
1,2
COMMENTS
Counted intersections are intersections of the circumference of a circle and the grid (all the grid lines together). Beginning with the smallest circle, the radius is increasing, and a new term is added only when the number of intersections changes.
a(n) is a multiple of 4 for all n except 1.
EXAMPLE
a(1)=1 because at the beginning it's just a point. If we start increasing the circle, there would be 4 intersections, so a(2)=4, this holds while the radius is between 0 and 1 (assuming the cells of the grid have side length 1). If the radius is between 1 and sqrt(2), there are 12 intersections, so a(3)=12. After that: r=sqrt(2), a(4)=8; sqrt(2) < r < 2, a(5)=12.
The number of intersections changes when the squared radius reaches a sum of two nonzero squares (A000404) and when it starts exceeding a sum of two squares, so in the latter case there are three consecutive terms of the sequence corresponding to the squared radius smaller than a term of A001481, equal to it, and exceeding it, like a(3)-a(5) in the example above.
MATHEMATICA
issq[n_] := n == Floor[Sqrt[n]]^2;
ss[1] = 0; ss[n_] := Product[If[Mod[First@pe, 4] == 1, Last@pe + 1, Boole[EvenQ[Last@pe] || First@pe == 2]], {pe, FactorInteger[n]}] - Boole[issq[n]]; (* A063725, after Charles R Greathouse IV *)
t = 4; a = {1};
Do[AppendTo[a, t - 4 ss[n]]; If[issq[n], t += 8]; AppendTo[a, t], {n, 40}];
First /@ Split[a] (* Andrey Zabolotskiy, Sep 20 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Volodymyr Dykun, Mar 03 2023
EXTENSIONS
a(16) and beyond from Andrey Zabolotskiy, Sep 20 2023
STATUS
approved