%I #20 Sep 08 2022 08:45:03
%S 1,2,3,4,5,6,8,10,12,15,17,19,24,26,28,33,35,37,42,44,46,51,53,55,60,
%T 62,64,69,71,73,78,80,82,87,89,91,96,98,100,105,107,109,114,116,118,
%U 123,125,127,132,134,136,141,143,145,150,152,154,159,161,163,168,170
%N Smallest positive a(n) such that number of solutions to a(n)=a(j)+a(k) j<k<n is two or less.
%C Numbers {1,6,8} mod 9 plus {2,3,4,5,12}.
%H Vincenzo Librandi, <a href="/A060470/b060470.txt">Table of n, a(n) for n = 1..3000</a>
%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,1,-1).
%F From _Chai Wah Wu_, Feb 21 2018: (Start)
%F a(n) = a(n-1) + a(n-3) - a(n-4) for n > 13.
%F G.f.: x*(2*x^12 + x^9 + x^8 + x^7 + x^6 + x^2 + x + 1)/(x^4 - x^3 - x + 1). (End)
%F a(n) = 2*n + 3*floor(n/3 + 2/3) - 17 for n>9. - _Bruno Berselli_, Feb 22 2018
%e 12 is in the sequence since it is 4+8 and 2+10 but no other sum of two distinct terms.
%t f[s_List, j_Integer] := Block[{cnt, k = s[[-1]] + 1, ss = Plus @@@ Subsets[s, {j}]}, While[ cnt = Count[ss, k]; cnt == 0 || cnt > 2, k++]; Append[s, k]]; Nest[f[#, 2] &, {1, 2}, 70] (* _Robert G. Wilson v_, Jul 05 2014 *)
%t CoefficientList[Series[(2 x^12 + x^9 + x^8 + x^7 + x^6 + x^2 + x + 1) / (x^4 - x^3 - x + 1), {x, 0, 100}], x] (* _Vincenzo Librandi_, Feb 22 2018 *)
%o (Magma) I:=[1,2,3,4,5,6,8,10,12,15,17,19,24]; [n le 13 select I[n] else Self(n-1)+Self(n-3)-Self(n-4): n in [1..70]]; // _Vincenzo Librandi_, Feb 22 2018
%o (Magma) [n le 9 select Floor(n^2/12+n/2+3/4) else 2*n+3*Floor(n/3+2/3)-17: n in [1..65]]; // _Bruno Berselli_, Feb 22 2018
%Y Cf. A003044, A033627, A060469, A060471, A060472. Virtually identical to A003663.
%K nonn,easy
%O 1,2
%A _Henry Bottomley_, Mar 15 2001