OFFSET
1,1
COMMENTS
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..10000
Ron Knott, Pythagorean triangles and Triples
Eric Weisstein's World of Mathematics, Pythagorean Triple
Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
FORMULA
From Bruno Berselli, Sep 30 2011: (Start)
G.f.: x*(5+12*x)/((1-x)^2*(1+x)^2).
a(n) = ((17+7*(-1)^n)/2)*((2*n-(-1)^n+1)/4) = (17*n+(7*n-5)*(-1)^n+5)/4.
a(n)*a(n+1) = a(10*s), where s is A002620(n+1).
a(n) = 2*a(n-2) - a(n-4). (End)
MATHEMATICA
With[{nn=30}, Riffle[5Range[nn], 12Range[nn]]] (* or *) LinearRecurrence[ {0, 2, 0, -1}, {5, 12, 10, 24}, 60] (* Harvey P. Dale, Aug 18 2012 *)
PROG
(Magma) &cat[[5*n, 12*n]: n in [1..27]]; // Bruno Berselli, Sep 30 2011
(PARI) a(n)=(n+1)\2*if(n%2, 5, 12) \\ Charles R Greathouse IV, Oct 07 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Omar E. Pol, Sep 12 2011
EXTENSIONS
More terms from Bruno Berselli, Sep 30 2011
STATUS
approved