%I #7 Dec 12 2017 08:40:55
%S 2,4,31,71,151,286,518,904,1543,2591,4303,7090,11618,18964,30871,
%T 50159,81391,131950,213782,346216,560527,907319,1468471,2376466,
%U 3845666,6222916,10069423,16293239,26363686,42658014,69022856,111682095,180706247,292389711
%N Solution of the complementary equation a(n) = a(n-1) + a(n-2) + b(n)^2, where a(0) = 2, a(1) = 4, b(0) = 1, b(1) = 3, b(2) = 5, and (a(n)) and (b(n)) are increasing complementary sequences.
%C The increasing complementary sequences a() and b() are uniquely determined by the titular equation and initial values.
%C a(n)/a(n-1) -> (1 + sqrt(5))/2 = golden ratio (A001622).
%C See A296245 for a guide to related sequences.
%H Clark Kimberling, <a href="/A296249/b296249.txt">Table of n, a(n) for n = 0..1000</a>
%H Clark Kimberling, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL10/Kimberling/kimberling26.html">Complementary equations</a>, J. Int. Seq. 19 (2007), 1-13.
%F a(n) = H + R, where H = f(n-1)*a(0) + f(n)*a(1) and R = f(n-1)*b(2)^2 + f(n-2)*b(3)^2 + ... + f(2)*b(n-1)^2 + f(1)*b(n)^2, where f(n) = A000045(n), the n-th Fibonacci number.
%e a(0) = 2, a(1) = 4, b(0) = 1, b(1) = 3, b(2) = 5;
%e a(2) = a(0) + a(1) + b(2)^2 = 31;
%e Complement: (b(n)) = (1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ...)
%t a[0] = 2; a[1] = 4; b[0] = 1; b[1] = 3; b[2] = 5;
%t a[n_] := a[n] = a[n - 1] + a[n - 2] + b[n]^2;
%t j = 1; While[j < 6 , k = a[j] - j - 1;
%t While[k < a[j + 1] - j + 1, b[k] = j + k + 2; k++]; j++];
%t Table[a[n], {n, 0, k}] (* A296249 *)
%t Table[b[n], {n, 0, 20}] (* complement *)
%Y Cf. A001622, A296245.
%K nonn,easy
%O 0,1
%A _Clark Kimberling_, Dec 10 2017