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. (It produces A109474.) The present definition (due to Stephan) has been adopted as a temporary solution. It would be nice to have a definition similar to the original one. - N. J. A. Sloane, Nov 24 2004
From Philippe Deléham, Nov 21 2016: (Start)
First differences are 2, 1, 5, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11, 3, 11,...
For n>3, numbers that are congruent to 9 or 12 mod 14. (End)
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
FORMULA
a(n) = a(n-1)+a(n-2)-a(n-3) for n>6. G.f.: x*(1+2*x+3*x^3+2*x^4+6*x^5)/((1-x)^2*(1+x)). - Colin Barker, May 02 2012
MATHEMATICA
CoefficientList[Series[(1 + 2 x + 3 x^3 + 2 x^4 + 6 x^5)/((1 - x)^2 (1 + x)), {x, 0, 60}], x] (* Vincenzo Librandi, Oct 18 2013 *)
PROG
(Magma) [1, 3, 4] cat [7*n - 21 + 2*(-1)^n: n in [4..60]]; // Vincenzo Librandi, Oct 18 2013
(PARI) a(n) = if(n>3, 7*n - 21 + 2*(-1)^n, [1, 3, 4][n]) \\ Charles R Greathouse IV, Nov 21 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from David Duran (dduran(AT)ashland.edu), Dec 14 2005
STATUS
approved