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 A154139 #32 Dec 23 2024 14:53:42 %S A154139 0,6,9,39,56,230,329,1343,1920,7830,11193,45639,65240,266006,380249, %T A154139 1550399,2216256,9036390,12917289,52667943,75287480,306971270, %U A154139 438807593,1789159679,2557558080,10427986806,14906540889,60778761159,86881687256 %N A154139 Indices k such that 4 plus the k-th triangular number is a perfect square. %C A154139 Also numbers n such that (ceiling(sqrt(n*(n+1)/2)))^2 - n*(n+1)/2 = 4. - _Ctibor O. Zizka_, Nov 10 2009 %H A154139 Vincenzo Librandi, <a href="/A154139/b154139.txt">Table of n, a(n) for n = 1..1000</a> %H A154139 F. T. Adams-Watters, <a href="https://web.archive.org/web/*/http://list.seqfan.eu/oldermail/seqfan/2009-October/002504.html">SeqFan Discussion</a>, Oct 2009 %H A154139 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,6,-6,-1,1). %F A154139 a(n) = a(n-1) + 6*a(n-2) - 6*a(n-3) - a(n-4) + a(n-5). %F A154139 G.f.: x^2*(6 +3*x -6*x^2 -x^3)/((1-x)*(x^2-2*x-1)*(x^2+2*x-1)) = 1 + 1/2*(4+11*x)/(x^2-2*x-1) + 1/2/(x-1) + 1/2*(-3+2*x)/(x^2+2*x-1). %F A154139 For n>4, a(n) = 6*a(n-2) - a(n-4) + 2. - _Ctibor O. Zizka_, Nov 10 2009 %e A154139 0*(0+1)/2+4 = 2^2. 6*(6+1)/2+4 = 5^2. 9*(9+1)/2+4 = 7^2. 39*(39+1)/2+4 = 28^2. %p A154139 a := proc (n) if type(sqrt(4+(1/2)*n*(n+1)), integer) = true then n else end if end proc: seq(a(n), n = 0 .. 10^7); # _Emeric Deutsch_, Oct 31 2009 %t A154139 LinearRecurrence[{1, 6, -6, -1, 1}, {0, 6, 9, 39, 56}, 40] (* _Vincenzo Librandi_, Dec 11 2012 *) %t A154139 Join[{0}, Select[Range[0, 1000], ( Ceiling[Sqrt[#*(# + 1)/2]] )^2 - #*(# + 1)/2 == 4 &] ] (* _G. C. Greubel_, Sep 03 2016 *) %t A154139 Join[{0},Position[Accumulate[Range[66000]]+4,_?(IntegerQ[Sqrt[#]]&)]//Flatten] (* The program generates the first 13 terms of the sequence. *) (* _Harvey P. Dale_, Feb 18 2023 *) %o A154139 (Magma) I:=[0, 6, 9, 39,56]; [n le 5 select I[n] else Self(n-1)+6*Self(n-2)-6*Self(n-3)-Self(n-4)+Self(n-5): n in [1..40]]; // _Vincenzo Librandi_, Dec 11 2012 %Y A154139 Cf. A000217, A000290, A006451. %K A154139 nonn,easy %O A154139 1,2 %A A154139 _R. J. Mathar_, Oct 18 2009 %E A154139 a(17)-a(18) from _Emeric Deutsch_, Oct 31 2009 %E A154139 a(19)-a(25) from _Donovan Johnson_, Nov 01 2010 %E A154139 More terms from _Max Alekseyev_, Jan 24 2012