%I #16 Jan 25 2024 07:37:00
%S 1,10,31,72,137,234,367,544,769,1050,1391,1800,2281,2842,3487,4224,
%T 5057,5994,7039,8200,9481,10890,12431,14112,15937,17914,20047,22344,
%U 24809,27450,30271,33280,36481,39882,43487,47304,51337,55594,60079,64800,69761,74970
%N Number of squares in an n X n grid of squares with diagonals.
%C This sequence is the sum of the number of squares with horizontal/vertical sides (whose length is a positive integer), which is equal to Sum_{j=1..n} j^2 = (n*(n + 1)*(2*n + 1))/6, and the number of squares with diagonal sides (whose length is a multiple of sqrt(2)/2), which is Sum_{j=1..n} (A111746(n - 1)) = floor((n*(4*n^2 - 1))/6). - _Marco Ripà_, Jan 14 2024
%H Colin Barker, <a href="/A111500/b111500.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (3,-2,-2,3,-1).
%F a(n) = n^3 + n^2/2 - 1/4 + (1/4)*(-1)^n.
%F a(n) = 3*a(n-1) - 2*a(n-2) - 2*a(n-3) + 3*a(n-4) - a(n-5) for n > 4. - _Colin Barker_, May 28 2015
%F G.f.: (x^3 + 3*x^2 + 7*x + 1) / ((x-1)^4*(x+1)). - _Colin Barker_, May 28 2015
%F From _Marco Ripà_, Jan 14 2024: (Start)
%F a(n) = Sum_{j=1..n} (A000290(j) + A111746(j-1)).
%F a(n) = floor(n^3 + n^2/2). (End)
%p seq(n^3+n^2/2-1/4+1/4*(-1)^n,n=1..65);
%o (PARI) Vec((x^3+3*x^2+7*x+1) / ((x-1)^4*(x+1)) + O(x^100)) \\ _Colin Barker_, May 28 2015
%Y Cf. A000290, A100583, A111746.
%K nonn,easy
%O 0,2
%A _Floor van Lamoen_, Nov 16 2005