OFFSET
1,2
COMMENTS
Equivalently, numbers n such that triangular(2*n) - triangular(n) is a square.
LINKS
Index entries for linear recurrences with constant coefficients, signature (99,-99,1).
FORMULA
a(n) = A098308(2*n-2).
a(1) = 0, a(2) = 8, a(3) = 800 and a(n) = 99*a(n-1)-99*a(n-2)+a(n-3) for n>3. - Giovanni Resta, Apr 12 2013
G.f.: -8*x^2*(x+1) / ((x-1)*(x^2-98*x+1)). - Colin Barker, May 31 2013
a(n) = (49+20*sqrt(6))^(-n)*(49+20*sqrt(6)-2*(49+20*sqrt(6))^n+(49-20*sqrt(6))*(49+20*sqrt(6))^(2*n))/12. - Colin Barker, Mar 05 2016
a(n) = 8*A108741(n). - R. J. Mathar, Feb 19 2017
MATHEMATICA
a[n_]:=Floor[(1/12)*(49 + 20*Sqrt[6])^n]; Table[a[n], {n, 0, 10}] (* Giovanni Resta, Apr 12 2013 *)
LinearRecurrence[{99, -99, 1}, {0, 8, 800}, 20] (* Harvey P. Dale, Nov 01 2022 *)
PROG
(C)
#include <stdio.h>
#include <math.h>
int main() {
unsigned long long a, i, t;
for (i=0; i < (1L<<32); ++i) {
a = (i*i) + ((i+1)*i/2);
t = sqrt(a);
if (a == t*t) printf("%llu\n", i);
}
return 0;
}
(PARI) lista(nn) = for(n=0, nn, if(issquare(n^2 + n*(n+1)/2), print1(n, ", "))); \\ Altug Alkan, Mar 05 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Alex Ratushnyak, Apr 12 2013
STATUS
approved