OFFSET
1,2
COMMENTS
The old definition of this sequence was "a(n) = least positive integer > a(n-1) and not equal to a(i)+a(j)+a(k) for 1<=i<=j<=k<=n". However, Ralf Stephan observes that this does not fit the terms shown. The present definition (due to Stephan) has been adopted as a temporary solution. - N. J. A. Sloane, Nov 24 2004
Regarding the old definition, see Comments at A047239. - Clark Kimberling, Oct 09 2019
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
From Colin Barker, Oct 10 2019: (Start)
G.f.: x*(1 + x + 3*x^3 + 5*x^4 - 3*x^5 + 5*x^6) / ((1 - x)^2*(1 + x)).
a(n) = a(n-1) + a(n-2) - a(n-3) for n>6.
a(n) = -(39/2) - (5*(-1)^n)/2 + 6*n for n>4.
(End)
MATHEMATICA
p = {1, 2, 3, 7}; r = 12 Range[200]; Union[p, 1 + r, 2 + r] (* Clark Kimberling, Oct 10 2019 *)
PROG
(PARI) Vec(x*(1 + x + 3*x^3 + 5*x^4 - 3*x^5 + 5*x^6) / ((1 - x)^2*(1 + x)) + O(x^40)) \\ Colin Barker, Oct 20 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Clark Kimberling, Oct 10 2019
STATUS
approved