%I #60 Sep 14 2022 02:03:39
%S 2,5,14,29,50,77,110,149,194,245,302,365,434,509,590,677,770,869,974,
%T 1085,1202,1325,1454,1589,1730,1877,2030,2189,2354,2525,2702,2885,
%U 3074,3269,3470,3677,3890,4109,4334,4565,4802,5045,5294,5549,5810,6077,6350
%N Sum of three consecutive squares: a(n) = n^2 + (n + 1)^2 + (n + 2)^2.
%C A rectangular prism with sides n, n + 1, and n + 2 will have four diagonals of different lengths. The sum of the squares of all four is three times the numbers in this sequence beginning with 14 (third term in the sequence for n = 1). - _J. M. Bergot_, Sep 15 2011
%C From _Jean-Christophe Hervé_, Nov 11 2015: (Start)
%C This sequence differs from A005918 only in the first term.
%C a(n) is also defined for any negative number and a(-n) = a(n-2).
%C If a 2-set Y and a 3-set Z are disjoint subsets of an n-set (n >= 5) X then a(n-5) is the number of 4-subsets of X intersecting both Y and Z (from comment in A005918 by _Milan Janjic_, Sep 08 2007).
%C (End)
%H Jean-Christophe Hervé, <a href="/A120328/b120328.txt">Table of n, a(n) for n = -1..999</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3,-3,1).
%H <a href="/index/Tu#2wis">Index entries for two-way infinite sequences</a>.
%F From _R. J. Mathar_, Aug 07 2008: (Start)
%F a(n) = A005918(n + 1), n >= 0.
%F O.g.f.: (2 - x + 5*x^2)/(x*(1 - x)^3). (End)
%F a(n) = 3*(2*n + 1) + a(n - 1) (with a(-1) = 2). - _Vincenzo Librandi_, Nov 13 2010
%F a(n) = 3*n^2 + 6*n + 5. - _T. D. Noe_ by way of _Alonso del Arte_, Oct 29 2012
%F From _Jean-Christophe Hervé_, Nov 11 2015: (Start)
%F a(n) = 3*(n + 1)^2 + 2 == 2 (mod 3), hence a(n) is never square.
%F a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for all n in Z. (End)
%F From _Amiram Eldar_, Sep 14 2022: (Start)
%F Sum_{n>=-1} 1/a(n) = coth(sqrt(2/3)*Pi)*Pi/(2*sqrt(6)) + 1/4.
%F Sum_{n>=-1} (-1)^(n+1)/a(n) = cosech(sqrt(2/3)*Pi)*Pi/(2*sqrt(6)) + 1/4. (End)
%p [seq(n^2+(n+1)^2+(n+2)^2, n=-1..45)];
%t Table[Total[Range[n, n + 2]^2], {n, -1, 45}] (* _Harvey P. Dale_, Jan 23 2011 *)
%o (Sage) [i^2+(i+1)^2+(i+2)^2 for i in range(-1,46)] # _Zerinvary Lajos_, Jul 03 2008
%o (PARI) a(n) = n^2 + (n + 1)^2 + (n + 2)^2; \\ _Altug Alkan_, Nov 11 2015
%o (Magma) [3*n^2 + 6*n + 5 : n in [-1..50]]; // _Wesley Ivan Hurt_, Nov 12 2015
%Y Cf. A001844, A005918, A027575, A027578, A027865.
%Y Cf. A027574, A027602.
%K easy,nonn
%O -1,1
%A _Zerinvary Lajos_, Jun 21 2006