OFFSET
1,2
COMMENTS
Also numbers n such that the sum of the hexagonal numbers H(n) and H(n+1) is equal to m^2 + (m+1)^2 for some m. - Colin Barker, Dec 10 2014
Also nonnegative integers x in the solutions to 4*x^2-2*y^2+2*x-2*y = 0, the corresponding values of y being A251867. - Colin Barker, Dec 10 2014
LINKS
Colin Barker, Table of n, a(n) for n = 1..654
Index entries for linear recurrences with constant coefficients, signature (35,-35,1).
FORMULA
For n>1, a(n) = A089928(n*4-5).
From Bruno Berselli, Apr 12 2013: (Start)
G.f.: 2*x^2*(5-x)/((1-x)*(1-34*x+x^2)).
a(n) = ((1+sqrt(2))^(4n-3)+(1-sqrt(2))^(4n-3)-2)/8.
a(n) = 35*a(n-1)-35*a(n-2)+a(n-3). - Colin Barker, Dec 10 2014
EXAMPLE
a(3) = A089928(7) = 348.
MAPLE
f:= gfun:-rectoproc({a(n)=35*(a(n-1)-a(n-2))+a(n-3), a(1)=0, a(2)=10, a(3)=348}, a(n), remember):
map(f, [$1..50]); # Robert Israel, Sep 06 2015
MATHEMATICA
LinearRecurrence[{35, - 35, 1}, {0, 10, 348}, 20] (* Vincenzo Librandi, Sep 06 2015 *)
PROG
(C)
#include <stdio.h>
#include <math.h>
typedef unsigned long long U64;
U64 rootPronic(U64 a) {
U64 sr = 1L<<31, s, b;
if (a < sr*(sr+1)) {
sr>>=1;
while (a < sr*(sr+1)) sr>>=1;
}
for (b = sr>>1; b; b>>=1) {
s = sr+b;
if (a >= s*(s+1)) sr = s;
}
return sr;
}
int main() {
U64 a, n, r, t;
for (n=0; n < (1L<<31); n++) {
a = (n*(n+1)) + n*n;
t = rootPronic(a);
if (a == t*(t+1)) printf("%llu\n", n);
}
}
(PARI) concat(0, Vec(2*x^2*(5-x)/((1-x)*(1-34*x+x^2))+O(x^100))) \\ Colin Barker, Dec 10 2014
(Magma) [Floor(((1+Sqrt(2))^(4*n-3)+(1-Sqrt(2))^(4*n-3)-2)/8): n in [1..20]]; // Vincenzo Librandi, Sep 08 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Alex Ratushnyak, Apr 12 2013
EXTENSIONS
More terms from Bruno Berselli, Apr 12 2013
STATUS
approved