OFFSET
1,1
COMMENTS
The rule can be generalized for any number of starting terms s: (xs, ..., x2, x1) -> (x1, x1 + x2, ..., x1 + x2 + ... + xs), using (0, 1, ..., s-1) as seed values. This sequence is s=3, and s=2 yields the Fibonacci series.
For s=3 the ratio of S1 (the first in the sub-series) to S3 (the 3rd in the sub-series) converges on 2.2469796 and the ration of S2 (the 2nd in the sub-series) to S3 converges on 1.2469796 thus the difference, S2-S3, converges on 1 regardless of the seed values used.
For s=20 the series is: 19, 190, 2660, 33915, 445949, ....
a(n-2) is the top left entry of the n-th power of the 3 X 3 matrix [0, 1, 1; 1, 1, 1; 1, 0, 1] or of the 3 X 3 matrix [0, 1, 1; 1, 1, 0; 1, 1, 1]. - R. J. Mathar, Feb 03 2014
From Andrew Pharo, Jun 02 2014: (Start)
For s=2 the ratio of successive terms is 1.6180339887... or phi (or phi(2));
for s=3 this ratio is 2.24697960412319..., phi(3) = 4*cos(Pi/7)^2-1 (see Falbo link);
for s=4 this ratio is 3.5133370918694...;
for s=20 this ratio is 13.0538985560545... and so on.
We can define a function phi(s) which approximates to:
phi(s) ~ phi(2) + theta*(s-2) where theta ~ 0.636264133.
(End)
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..2844
Clement Falbo, The Golden Ratio - A Contrary Viewpoint, Vol. 36, No. 2, March 2005, The College Mathematics Journal.
Y-h. Guo, Some n-Color Compositions, J. Int. Seq. 15 (2012) 12.1.2, eq. (10) and Theorem 8.
Brian Hopkins, Hua Wang, Restricted Color n-color Compositions, arXiv:2003.05291 [math.CO], 2020.
R. Sachdeva and A. K. Agarwal, Combinatorics of certain restricted n-color composition functions, Discrete Mathematics, 340, (2017), 361-372.
Index entries for linear recurrences with constant coefficients, signature (2,1,-1).
FORMULA
a(n) = 2a(n-1) + a(n-2) - a(n-3). - Charles R Greathouse IV, Nov 28 2012
The essentially identical sequence 1,0,2,3,8,17,39,... with offset 0 is defined by a(n) = 2a(n-1) + a(n-2) - a(n-3) with initial terms a(0)=1, a(1)=0, a(2)=2. - N. J. A. Sloane, Jan 16 2017
G.f.: -x*(-2+x) / ( 1-2*x-x^2+x^3 ). - R. J. Mathar, Feb 03 2014
EXAMPLE
The seed values are (0,1,2), giving a(1) = 2. (2, 2+1, 2+1+0) is the next triple, giving a(2) = 2+1+0 = 3. (3, 6, 8) is next, yielding a(3) = 8. The triples that follow begin (8,14,17), (17,31,39), etc.
MATHEMATICA
Rest@ CoefficientList[Series[-x (-2 + x)/(1 - 2 x - x^2 + x^3), {x, 0, 32}], x] (* Michael De Vlieger, Jun 17 2020 *)
sr[{x_, y_, z_}]:={z, y+z, x+y+z}; NestList[sr, {0, 1, 2}, 40][[All, 3]] (* Harvey P. Dale, Aug 18 2020 *)
PROG
(PARI) first(n)=my(x=0, y=1, z=2, v=List([z])); for(i=2, n, [x, y, z]=[z, y+z, x+y+z]; listput(v, c)); Vec(v) \\ Charles R Greathouse IV, Nov 28 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Andrew Pharo, Nov 27 2012
STATUS
approved