This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A178946 #27 Sep 08 2022 08:45:54 %S A178946 1,3,11,22,45,73,119,172,249,335,451,578,741,917,1135,1368,1649,1947, %T A178946 2299,2670,3101,3553,4071,4612,5225,5863,6579,7322,8149,9005,9951, %U A178946 10928,12001,13107,14315,15558,16909,18297,19799,21340,23001 %N A178946 a(n) = n*(n+1)*(2*n+1)/6 - n*floor(n/2). %C A178946 Previous name was: A modified variant of A005900. %C A178946 Let S(x) = (1, 3, 5, 7,...); then A178946 = (1/2) * ((S(x)^2 + S(x^2)). %C A178946 If n is even, a(n) is the sum of the first n squares minus n^2/2. If n is odd, a(n) is the sum of the first n squares minus n(n-1)/2. - _Wesley Ivan Hurt_, Sep 17 2013 %H A178946 Vincenzo Librandi, <a href="/A178946/b178946.txt">Table of n, a(n) for n = 1..1000</a> %H A178946 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (2,1,-4,1,2,-1). %F A178946 a(2n) = A005900(2n)/2. a(2n+1) = (A005900(2n+1)+2n+1)/2. %F A178946 a(n) = +2*a(n-1) +a(n-2) -4*a(n-3) +a(n-4) +2*a(n-5) -a(n-6). G.f.: x*(1+x+4*x^2+x^4+x^3) / ( (1+x)^2*(x-1)^4 ). - _R. J. Mathar_, Jan 03 2011 %F A178946 a(n) = A000330(n+1) - A093353(n), n>0. - _Wesley Ivan Hurt_, Sep 17 2013 %e A178946 (1/2) *((1, 6, 19, 44, 85, 146, 231,...) + (1, 0, 3, 0, 5, 0, 7, 0, 9,...)) = %e A178946 (1, 3, 11, 22, 45, 73, 119,...). %p A178946 A005900 := proc(n) n*(2*n^2+1)/3 ; end proc: %p A178946 A178946 := proc(n) if type(n,'even') then A005900(n)/2 ; else (A005900(n)+n)/2 ; end if;end proc: %p A178946 seq(A178946(n),n=1..60) ; # _R. J. Mathar_, Jan 03 2011 %p A178946 seq(k*(k+1)*(2*k+1)/6 - k*floor(k/2), k=1..100); # _Wesley Ivan Hurt_, Sep 17 2013 %t A178946 Table[n(n+1)(2n+1)/6-n*Floor[n/2], {n,100}] (* _Wesley Ivan Hurt_, Sep 17 2013 *) %t A178946 LinearRecurrence[{2,1,-4,1,2,-1},{1,3,11,22,45,73},50] (* _Harvey P. Dale_, Mar 20 2018 *) %o A178946 (Magma) [n*(n+1)*(2*n+1)/6 - n*Floor(n/2): n in [1..50]]; // _Vincenzo Librandi_, Sep 17 2013 %Y A178946 Cf. A000330, A005900, A093353. %K A178946 nonn %O A178946 1,2 %A A178946 _Gary W. Adamson_, Dec 30 2010 %E A178946 Better name using formula from _Wesley Ivan Hurt_, _Joerg Arndt_, Sep 17 2013