OFFSET
1,2
REFERENCES
D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 2, p. 601.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Harry J. Smith, Table of n, a(n) for n = 1..20000
G. Xiao, Contfrac
Index entries for linear recurrences with constant coefficients, signature (0,0,1,0,0,1,0,0,-1).
FORMULA
a(1)=1, a(2)=2, a(3)=1, a(4)=3, a(5)=1, a(6)=1, a(7)=1, a(8)=3, then for k>=1 a(6*k+3)=a(6*k+6)=2*k+1, a(6*k+4)=a(6*k+8)=3, a(6*k+5)=a(6*k+7)=1. - Benoit Cloitre, Apr 08 2003
From Colin Barker, May 16 2016: (Start)
a(n) = a(n-3)+a(n-6)-a(n-9) for n>9.
G.f.: x*(1+2*x+x^2+2*x^3-x^4-3*x^6+x^8-x^10) / ((1-x)^2*(1+x)*(1-x+x^2)*(1+x+x^2)^2).
(End)
EXAMPLE
1.359140914229522617680143735... = 1 + 1/(2 + 1/(1 + 1/(3 + 1/(1 + ...)))). - Harry J. Smith, May 10 2009
MATHEMATICA
ContinuedFraction[E/2, 94] (* Jean-François Alcover, Apr 01 2011 *)
Join[{1, 2}, LinearRecurrence[{0, 0, 1, 0, 0, 1, 0, 0, -1}, {1, 3, 1, 1, 1, 3, 3, 3, 1}, 92]] (* Ray Chandler, Sep 03 2015 *)
PROG
(PARI) { allocatemem(932245000); default(realprecision, 55000); x=contfrac(exp(1)/2); for (n=1, 20000, write("b006083.txt", n, " ", x[n])); } \\ Harry J. Smith, May 10 2009
(PARI) Vec(x*(1+2*x+x^2+2*x^3-x^4-3*x^6+x^8-x^10) / ((1-x)^2*(1+x)*(1-x+x^2)*(1+x+x^2)^2) + O(x^50)) \\ Colin Barker, May 16 2016
CROSSREFS
KEYWORD
cofr,nonn,easy
AUTHOR
EXTENSIONS
More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 20 2003
STATUS
approved