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 A182334 #41 Sep 08 2022 08:45:55 %S A182334 0,1,3,10,15,120,325,528,4095,11026,17955,139128,374545,609960, %T A182334 4726275,12723490,20720703,160554240,432224101,703893960,5454117903, %U A182334 14682895930,23911673955,185279454480,498786237505,812293020528,6294047334435,16944049179226 %N A182334 Triangular numbers that differ from a square by 1. %C A182334 From _Robert G. Wilson v_, Jun 20 2015: (Start) %C A182334 Actually this sequence is the union of two subsequences; the triangular numbers that are less than a square by 1 and those that are greater than a square by 1. %C A182334 The first sequence by index of the triangular numbers is A072221: b(n) = 6b(n-1) - b(n-2) + 2, with b(0)=1, b(1)=4. %C A182334 And obviously the second sequence by index of the triangular numbers is A006451: c(n) = 6c(n-2) - c(n-4) + 2 with c(0)=0, c(1)=2, c(2)=5, c(3)=15. %C A182334 (End) %D A182334 Edward J. Barbeau, Pell's Equation (Springer 2003) at 17. %H A182334 Harvey P. Dale, <a href="/A182334/b182334.txt">Table of n, a(n) for n = 1..1000</a> %H A182334 <a href="/index/Rec#order_09">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,35,0,0,-35,0,0,1). %F A182334 a(n) = 35*a(n-3) - 35*a(n-6) + a(n-9). - _Charles R Greathouse IV_, Apr 25 2012 %F A182334 G.f.: x^2*(1+3*x+10*x^2-20*x^3+15*x^4-25*x^5+38*x^6+x^8-x^9) / ((1-x)*(1+x+x^2)*(1-34*x^3+x^6)). - _Colin Barker_, Sep 17 2016 %e A182334 T(2) = 3 = 2^2 - 1, T(4) = 10 = 3^2 + 1, T(5) = 15 = 4^2 - 1, and T(15) = 120 = 11^2 - 1. %t A182334 lst = {}; Do[t = n*(n + 1)/2; If[IntegerQ[(t - 1)^(1/2)] || IntegerQ[(t + 1)^(1/2)], AppendTo[lst, t]], {n, 0, 10^4}]; lst (* _Arkadiusz Wesolowski_, Aug 06 2012 *) %t A182334 b[n_] := b[n] = 6 b[n - 1] - b[n - 2] + 2; b[0] = 1; b[1] = 4; c[n_] := c[n] = 6 c[n - 2] - c[n - 4] + 2; c[0] = 0; c[1] = 2; c[2] = 5; c[3] = 15; #(# + 1)/2 & /@ Union@ Join[ Array[b, 9, 0], Array[c, 18, 0]] (* or *) %t A182334 #(# + 1)/2 & /@ Join[{0, 1}, LinearRecurrence[{1, 0, 6, -6, 0, -1, 1}, {2, 4, 5, 15, 25, 32, 90}, 35]] (* or *) %t A182334 #(# + 1)/2 & /@ CoefficientList[ Series[x + x^2 (1 + x) (2 + x^2 - 3 x^3 + x^4)/((1 - x) (1 - 6 x^3 + x^6)), {x, 0, 36}], x] (* _Robert G. Wilson v_, Jun 20 2015 *) %t A182334 a[n_] := a[n] = 35 a[n - 3] - 35 a[n - 6] + a[n - 9]; a[1] = 0; a[2] = 1; a[3] = 3; a[4] = 10; a[5] = 15; a[6] = 120; a[7] = 325; a[8] = 528; a[9] = 4095; a[10] = 11026; a[11] = 17955; Array[a, 36] (* _Robert G. Wilson v_ after _Charles R Greathouse IV_, Apr 25 2012 *) %t A182334 Select[Accumulate[Range[0,6*10^6]],AnyTrue[Sqrt[#+{1,-1}],IntegerQ]&] (* or *) LinearRecurrence[{0,0,35,0,0,-35,0,0,1},{0,1,3,10,15,120,325,528,4095,11026,17955},40] (* The first program uses the AnyTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Dec 24 2015 *) %o A182334 (Magma) I:=[0,1,3,10,15,120,325,528,4095,11026,17955]; [n le 11 select I[n] else 35*Self(n-3)-35*Self(n-6)+Self(n-9): n in [1..30]]; // _Vincenzo Librandi_, Jun 21 2015 %o A182334 (PARI) concat(0, Vec(x^2*(1+3*x+10*x^2-20*x^3+15*x^4-25*x^5+38*x^6+x^8-x^9)/((1-x)*(1+x+x^2)*(1-34*x^3+x^6)) + O(x^30))) \\ _Colin Barker_, Sep 17 2016 %Y A182334 Subsequence of A000217 and of A087279. %Y A182334 Cf. A001110, A006451, A072221, A229131, A299921. %K A182334 nonn,easy %O A182334 1,3 %A A182334 _Arkadiusz Wesolowski_, Apr 25 2012