%I #4 May 13 2018 01:11:21
%S 1,6,15,29,50,79,117,165,224,295,379,477,591,722,871,1039,1227,1436,
%T 1667,1921,2199,2502,2831,3187,3571,3985,4430,4907,5417,5961,6540,
%U 7155,7807,8497,9226,9995,10805,11657,12552,13491,14475,15505,16582,17707,18881
%N Solution (a(n)) of the complementary equation in Comments.
%C Define sequences a(n) and b(n) recursively, starting with a(0) = 1, b(0) = 2:
%C b(n) = least new;
%C a(n) = a(n-1) + b(n) + b(n-1) + ... + b(0),
%C where "least new k" means the least positive integer not yet placed.
%e b(1) = least not in {a(0),b(0)} = 3;
%e a(1) = a(0) + b(1) + b(0) = 1 + 3 + 2 = 6.
%t z = 1000;
%t mex[list_, start_] := (NestWhile[# + 1 &, start, MemberQ[list, #] &]);
%t c = 1; a = {1}; b = {2}; x = {1};
%t Do[AppendTo[b, mex[Flatten[{a, b}], 1]];
%t AppendTo[x, 1];
%t AppendTo[a, c Last[a] + (Reverse[x] b // Total)], {z}]
%t Take[a, 30]
%t (* _Peter J. C. Moses_, May 10 2018 *)
%Y Cf. A298173, A198741.
%K nonn,easy
%O 0,2
%A _Clark Kimberling_, May 12 2018
|