login
A361192
Number of intersections of a grid and (growing) circle with center at a lattice point.
0
1, 4, 12, 8, 12, 20, 12, 20, 16, 20, 28, 20, 28, 20, 28, 36, 28, 36, 32, 36, 28, 36, 28, 44, 36, 44, 36, 44, 40, 44, 36, 44, 52, 44, 52, 44, 52, 44, 52, 44, 52, 60, 48, 60, 52, 60, 52, 60, 52, 60, 52, 60, 68, 52, 68, 60, 68, 64, 68, 60, 68, 60, 68, 60, 68, 76, 68, 76, 60, 76, 68, 76, 68
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
A242118 (without 0) and A017113 are subsequences.
Sequence in context: A377047 A331054 A372651 * A310569 A145046 A205849
KEYWORD
nonn
AUTHOR
Volodymyr Dykun, Mar 03 2023
EXTENSIONS
a(16) and beyond from Andrey Zabolotskiy, Sep 20 2023
STATUS
approved