The OEIS is supported by the many generous donors to the OEIS Foundation.

All possible numbers of whole squares which can be contained inside a square drawn with all of its vertices on lattice points.

2

`%I #33 Mar 16 2016 22:12:23
`

`%S 0,1,4,5,9,12,13,16,17,20,24,25,28,33,36,37,40,41,45,49,52,53,60,61,
`

`%T 64,65,72,73,76,80,81,84,85,92,93,100,101,104,105,108,109,112,113,116,
`

`%U 117,121,124,125,129,132,136,137,144,145,148,149,153,156,157,160,164,169
`

`%N All possible numbers of whole squares which can be contained inside a square drawn with all of its vertices on lattice points.
`

`%H Ray Chandler, <a href="/A194154/b194154.txt">Table of n, a(n) for n = 1..10000</a>
`

`%H C. Foster, <a href="http://www.foster77.co.uk/Foster,%20Mathematical%20Gazette,%20Squares%20within%20Squares.pdf">Squares Within Squares</a>, Mathematical Gazette, 96(537), 96.47, 2012.
`

`%H Eugen J. Ionascu, <a href="http://arxiv.org/abs/1508.03643">Ehrhart polynomial for lattice squares, cubes and hypercubes</a>, arXiv:1508.03643 [math.NT], 2015. (Cites A194154 but gives a different sequence, which is now A269741.)
`

`%t nmax = 1000;
`

`%t a1 = {};
`

`%t a = 1;
`

`%t While[
`

`%t 2 (a - 1)^2 <= nmax,
`

`%t b = a;
`

`%t While[
`

`%t c = (a - 1)^2 + (b - 1)^2;
`

`%t c <= nmax,
`

`%t h = GCD[a, b];
`

`%t c += 2 (h - 1);
`

`%t If[c <= nmax, AppendTo[a1, c]];
`

`%t b++;
`

`%t ];
`

`%t a++;
`

`%t ];
`

`%t a1 = Union[a1]
`

`%t (* _Ray Chandler_, Jun 01 2015 *)
`

`%Y Cf. A269741.
`

`%K nonn
`

`%O 1,3
`

`%A _Colin Foster_, Aug 17 2011
`

`%E Extended by _Ray Chandler_, Jun 01 2015
`