A065102 a(0) = c, a(1) = p*c^3; a(n+2) = p*c^2*a(n+1) - a(n), for p = 2, c = 3.
3, 54, 969, 17388, 312015, 5598882, 100467861, 1802822616, 32350339227, 580503283470, 10416708763233, 186920254454724, 3354147871421799, 60187741431137658, 1080025197889056045, 19380265820571871152
Offset: 0
Links
- Harry J. Smith, Table of n, a(n) for n=0,...,100
- Tanya Khovanova, Recursive Sequences
- J.-P. Ehrmann et al., Problem POLYA002, Integer pairs (x,y) for which (x^2+y^2)/(1+pxy) is an integer.
- Index entries for linear recurrences with constant coefficients, signature (18,-1).
Programs
-
Mathematica
a[0] = c; a[1] = p*c^3; a[n_] := a[n] = p*c^2*a[n - 1] - a[n - 2]; p = 2; c = 3; Table[ a[n], {n, 0, 20} ] Clear[f,lst,n,a] f[n_]:=Fibonacci[n]; lst={};Do[a=f[n]*(3/8);If[IntegerQ[a],AppendTo[lst,a]],{n,0,5!}];lst (* Vladimir Joseph Stephan Orlovsky, Oct 25 2009 *) nxt[{a_,b_}]:={b,18b-a}; NestList[nxt,{3,54},20][[;;,1]] (* or *) LinearRecurrence[{18,-1},{3,54},20] (* Harvey P. Dale, Apr 23 2023 *)
-
PARI
polya002(2,3,17) \\ For definition of function polya002 see A052530.
-
PARI
{ p=2; c=3; k=p*c^2; for (n=0, 100, if (n>1, a=k*a1 - a2; a2=a1; a1=a, if (n, a=a1=k*c, a=a2=c)); write("b065102.txt", n, " ", a) ) } \\ Harry J. Smith, Oct 07 2009
Formula
G.f.: 3/(1 - 18*x + x^2). - Floor van Lamoen, Feb 07 2002
a(n) = 3*A049660(n+1). - R. J. Mathar, Sep 27 2014
Comments