cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A361192 Number of intersections of a grid and (growing) circle with center at a lattice point.

Original entry on oeis.org

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

Views

Author

Volodymyr Dykun, Mar 03 2023

Keywords

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.

Examples

			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.
		

Crossrefs

A242118 (without 0) and A017113 are subsequences.

Programs

  • 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 *)

Extensions

a(16) and beyond from Andrey Zabolotskiy, Sep 20 2023