OFFSET
1,2
COMMENTS
Numbers {1,6,8} mod 9 plus {2,3,4,5,12}.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..3000
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
From Chai Wah Wu, Feb 21 2018: (Start)
a(n) = a(n-1) + a(n-3) - a(n-4) for n > 13.
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)
a(n) = 2*n + 3*floor(n/3 + 2/3) - 17 for n>9. - Bruno Berselli, Feb 22 2018
EXAMPLE
12 is in the sequence since it is 4+8 and 2+10 but no other sum of two distinct terms.
MATHEMATICA
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 *)
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 *)
PROG
(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
(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
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Henry Bottomley, Mar 15 2001
STATUS
approved