%I #66 Jul 24 2023 10:00:19
%S -1,0,5,20,51,104,185,300,455,656,909,1220,1595,2040,2561,3164,3855,
%T 4640,5525,6516,7619,8840,10185,11660,13271,15024,16925,18980,21195,
%U 23576,26129,28860,31775,34880,38181,41684,45395,49320,53465,57836,62439,67280,72365,77700,83291,89144,95265,101660
%N a(n) = n^3 - n^2 + n - 1 = (n-1) * (n^2 + 1).
%C Number of walks of length 4 between any two distinct vertices of the complete graph K_{n+1} (n >= 1). Example: a(2) = 5 because in the complete graph ABC we have the following walks of length 4 between A and B: ABACB, ABCAB, ACACB, ACBAB and ACBCB. - _Emeric Deutsch_, Apr 01 2004
%C 1/a(n) for n >= 2, is in base n given by 0.repeat(0,0,1,1), due to (1/n^3 + 1/n^4)*(1/(1-1/n^4)) = 1/((n-1)*(n^2+1)). - _Wolfdieter Lang_, Jun 20 2014
%C For n>3, a(n) is 1220 in base n-1. - _Bruno Berselli_, Jan 26 2016
%C For odd n, a(n) * (n+1) / 2 + 1 also represents the first integer in a sum of n^4 consecutive integers that equals n^8. - _Patrick J. McNab_, Dec 26 2016
%H Harry J. Smith, <a href="/A062158/b062158.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (4,-6,4,-1).
%F a(n) = round(n^4/(n+1)) for n >= 2.
%F a(n) = A062160(n, 4), for n > 2.
%F G.f.: (4*x-1)*(1+x^2)/(1-x)^4 (for the signed sequence). - _Emeric Deutsch_, Apr 01 2004
%F a(n) = floor(n^5/(n^2+n)) for n > 0. - _Gary Detlefs_, May 27 2010
%F a(n) = -A053698(-n). - _Bruno Berselli_, Jan 26 2016
%F Sum_{n>=2} 1/a(n) = A268086. - _Amiram Eldar_, Nov 18 2020
%F E.g.f.: exp(x)*(x^3 + 2*x^2 + x - 1). - _Stefano Spezia_, Apr 22 2023
%e a(4) = 4^3 - 4^2 + 4 - 1 = 64 - 16 + 4 - 1 = 51.
%p [seq(n^3-n^2+n-1,n=0..49)]; # _Zerinvary Lajos_, Jun 29 2006
%p a:=n->sum(1+sum(n, k=1..n), k=2..n):seq(a(n), n=0...43); # _Zerinvary Lajos_, Aug 24 2008
%t Table[n^3 - n^2 + n - 1, {n, 0, 49}] (* _Alonso del Arte_, Apr 30 2014 *)
%o (PARI) { for (n=0, 1000, write("b062158.txt", n, " ", n*(n*(n - 1) + 1) - 1) ) } \\ _Harry J. Smith_, Aug 02 2009
%o (Magma) [n^3 - n^2 + n - 1 : n in [0..50]]; // _Wesley Ivan Hurt_, Dec 26 2016
%Y Cf. A002061, A023443, A053698, A060884, A060888, A062159, A062160, A268086.
%K sign,easy
%O 0,3
%A _Henry Bottomley_, Jun 08 2001
%E More terms from _Emeric Deutsch_, Apr 01 2004
|