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 A215098 #32 Oct 01 2024 15:44:22 %S A215098 0,1,2,5,10,15,20,27,36,45,54,65,78,91,104,119,136,153,170,189,210, %T A215098 231,252,275,300,325,350,377,406,435,464,495,528,561,594,629,666,703, %U A215098 740,779,820,861,902,945,990,1035,1080,1127,1176,1225,1274,1325,1378,1431 %N A215098 a(0)=0, a(1)=1, a(n) = n*(n-1) - a(n-2). %C A215098 Same seed, b(n) = n*(n+1) - b(n-2) : 0, 1, 6, 11, 14, 19, 28, 37, 44, 53, 66, 79, 90, 103, 120, 137, 152, 169, 190, 211, 230, 251, 276, 301, 324, 349, 378, 407, 434, 463, 496, 529, 560, 593, ... %C A215098 b(n) = a(n+1) - 1 if (n mod 4) < 2, otherwise b(n) = a(n+1) + 1. %H A215098 Vincenzo Librandi, <a href="/A215098/b215098.txt">Table of n, a(n) for n = 0..1000</a> %H A215098 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (3,-4,4,-3,1). %F A215098 G.f.: x*(1-x+3*x^2-x^3)/(1-3*x+4*x^2-4*x^3+3*x^4-x^5). - _David Scambler_, Aug 06 2012 %F A215098 a(n) = (n^2 +n -1 +cos(pi*n/2) +sin(pi*n/2))/2. - _Vaclav Kotesovec_, Aug 11 2012 %t A215098 CoefficientList[Series[(x -x^2 +3x^3 -x^4)/(1 -3x +4x^2 -4x^3 +3x^4 -x^5), {x, 0, 70}], x] (* _Vincenzo Librandi_, Jul 18 2013 *) %t A215098 RecurrenceTable[{a[0]==0,a[1]==1,a[n]==n(n-1)-a[n-2]},a,{n,60}] (* or *) LinearRecurrence[{3,-4,4,-3,1},{0,1,2,5,10},60] (* _Harvey P. Dale_, May 15 2016 *) %o A215098 (Python) %o A215098 prpr = 0 %o A215098 prev = 1 %o A215098 for n in range(2,77): %o A215098 print(prpr, end=', ') %o A215098 curr = n*(n-1) - prpr %o A215098 prpr = prev %o A215098 prev = curr %o A215098 (Magma) [n le 2 select n-1 else 2*Binomial(n-1,2) -Self(n-2): n in [1..81]]; // _G. C. Greubel_, Nov 25 2022 %o A215098 (SageMath) %o A215098 def A215098(n): %o A215098 if (n<2): return n %o A215098 else: return 2*binomial(n,2) - A215098(n-2) %o A215098 [A215098(n) for n in range(81)] # _G. C. Greubel_, Nov 25 2022 %Y A215098 Cf. A007590 (a(0)=0, a(n) = n*(n-1) - a(n-1)). %Y A215098 Cf. A178218 (a(1)=1, a(n) = n*(n+1) - a(n-1)). %K A215098 nonn,easy %O A215098 0,3 %A A215098 _Alex Ratushnyak_, Aug 03 2012