%I #58 Jul 04 2023 12:27:07
%S 8,25,128,729,4232,24649,143648,837225,4879688,28440889,165765632,
%T 966152889,5631151688,32820757225,191293391648,1114939592649,
%U 6498344164232,37875125392729,220752408192128,1286639323760025,7499083534368008,43707861882448009,254748087760320032,1484780664679472169
%N a(1) = 8; a(n) = 3*a(n-1) + 2*sqrt(2*a(n-1)*(a(n-1)-7)) - 7 for n > 1.
%C Related to A055997.
%C If we solve X^2 + (X+7)^2 = (X+N)^2 over the positive integers we find that the solutions belong to three sequences:
%C 1) The first is a(1) = 7; a(n) = 3*a(n-1) + 2*sqrt(2*a(n-1)*(a(n-1)-7)) - 7 for n > 1: 7, 14, 63, 350, 2023, 11774, 68607, 399854, 2330503, 13583150, 79168383, 461427134, ... We observe that a(n) = 7*A055997(n).
%C 2) The second is this sequence.
%C 3) The third is a(1) = 9; a(n) = 3*a(n-1) + 2*sqrt(2*a(n-1)*(a(n-1)-7))-7 for n > 1: 9, 32, 169, 968, 5625, 32768, 190969, 1113032, 6487209, 37810208, 220374025, 1284433928, 7486229529, 43632943232, 254311429849, 1482235635848, ...
%C There is a property of the formula:
%C If y = 3*x + 2*sqrt(2*x*(x-q)) - q then x = 3*y - 2*sqrt(2*y*(y-q)) - q.
%C Let F(X) = 3*x - 2*sqrt(2*x*(x-7)) - 7.
%C Let us use this function:
%C With the 1st sequence: With the 2nd: With the 3rd:
%C F(2023)=350 F(729)=128 F(968)=169
%C F(350)=63 F(128)=25 F(169)=32
%C F(63)=14 F(25)=8 F(32)=9
%C F(14)=7 F(8)=9 F(9)=8
%C F(7)=14 F(9)=8 F(8)=9
%H G. C. Greubel, <a href="/A275151/b275151.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (7, -7, 1).
%F a(n) = 3*a(n-1) + 2*sqrt(2*a(n-1)*(a(n-1)-7)) - 7, for n > 1, with a(1)=8.
%F Conjectures from _Colin Barker_, Jul 19 2016: (Start)
%F a(n) = (14 + (11-6*sqrt(2))*(3+2*sqrt(2))^n + (3-2*sqrt(2))^n*(11+6*sqrt(2)))/4.
%F a(n) = 7*a(n-1) - 7*a(n-2) + a(n-3) for n > 3.
%F G.f.: x*(8 - 31*x + 9*x^2) / ((1-x)*(1 - 6*x + x^2)).
%F (End)
%p a:= proc(n) option remember; `if`(n=1, 8,
%p 3*a(n-1)+2*isqrt(2*a(n-1)*(a(n-1)-7))-7)
%p end:
%p seq(a(n), n=1..25);
%t NestList[3 # + 2 Sqrt[2 # (# - 7)] - 7 &, 8, 23] (* _Michael De Vlieger_, Jul 18 2016 *)
%o (PARI) m=30; v=concat([8], vector(m-1)); for(n=2, m, v[n] = floor(3*v[n-1] +2*sqrt(2*v[n-1]*(v[n-1]-7))-7)); v \\ _G. C. Greubel_, Oct 07 2018
%o (Magma) I:=[8]; [n le 1 select I[n] else Floor(3*Self(n-1) +2*Sqrt(2*Self(n-1)*(Self(n-1) - 7)) -7): n in [1..30]]; // _G. C. Greubel_, Oct 07 2018
%Y Cf. A055997.
%K nonn
%O 1,1
%A _Manuel López Holgueras_, Jul 17 2016