login
Numbers k such that the root-mean-square value of 1, 2, ..., k, i.e., sqrt((1/k)*Sum_{j=1..k} j^2), is an integer.
6

%I #37 Sep 03 2019 03:39:21

%S 1,337,65521,12710881,2465845537,478361323441,92799630902161,

%T 18002650033695937,3492421306906109761,677511730889751597841,

%U 131433783371304903871537,25497476462302261599480481,4946378999903267445395341921,959572028504771582145096852337

%N Numbers k such that the root-mean-square value of 1, 2, ..., k, i.e., sqrt((1/k)*Sum_{j=1..k} j^2), is an integer.

%C Equivalently, numbers k such that sqrt((k+1)*(2*k+1)/6) is an integer.

%H Indranil Ghosh, <a href="/A084231/b084231.txt">Table of n, a(n) for n = 1..437</a>

%H Peter Khoury and Gerard D. Koffi, <a href="http://www.cs.umb.edu/~eb/458/final/KoffiPresentation.pdf">Continued fractions and their application to solving Pell’s equations</a> (2009)

%H Tanya Khovanova, <a href="http://www.tanyakhovanova.com/RecursiveSequences/RecursiveSequences.html">Recursive Sequences</a>

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (195,-195,1).

%F a(n) = ((7/2 + 2*sqrt(3))*(97 + 56*sqrt(3))^n + (7/2 - 2*sqrt(3))*(97 - 56*sqrt(3))^n - 3)/4.

%F a(n) = (floor((7/2 + 2*sqrt(3))*(97 + 56*sqrt(3))^n) - 2)/4.

%F a(n+3) = 195*(a(n+2) - a(n+1)) + a(n).

%F G.f.: x*(1+142*x+x^2)/((1-x)*(1-194*x+x^2)).

%F a(n) = ((7 - 4*sqrt(3))^(1+2n) + (7 + 4*sqrt(3))^(1+2n) - 6)/8. - Peter Pein (peter.pein(AT)dordos.de), Mar 03 2005

%F a(n) = 195*a(n-1) - 195*a(n-2) + a(n-3), with a(0)=0, a(1)=1, a(2)=337, a(3)=65521. - _Harvey P. Dale_, Jul 14 2011

%e 337 is in the sequence because sqrt((1/337)*Sum_{k=1..337} k^2) is an integer (195=A084232(1)).

%t a[n_]:=Expand[((7-4 Sqrt[3])^(1+2n)+(7+4 Sqrt[3])^(1+2n)-6)/8] (* Peter Pein *)

%t CoefficientList[Series[x (1+142x+x^2)/((1-x)(1-194x+x^2)),{x,0,30}],x] (* or *) Join[{0},LinearRecurrence[{195,-195,1},{1,337,65521},30]] (* _Harvey P. Dale_, Jul 14 2011 *)

%Y Cf. A084232.

%K nonn,easy

%O 1,2

%A _Ignacio Larrosa Cañestro_, May 20 2003

%E One more term from Peter Pein (peter.pein(AT)dordos.de), Mar 03 2005