|
| |
|
|
A097581
|
|
a(1)=2 then if n even a(n)=a(n-1)+2 and if n odd a(n)=a(n-2)+a(n-1)-1.
|
|
1
| |
|
|
2, 4, 5, 7, 11, 13, 23, 25, 47, 49, 95, 97, 191, 193, 383, 385, 767, 769, 1535, 1537, 3071, 3073, 6143, 6145, 12287, 12289, 24575, 24577, 49151, 49153, 98303, 98305, 196607, 196609, 393215, 393217, 786431, 786433, 1572863, 1572865
(list; graph; refs; listen; history; internal format)
|
|
|
|
OFFSET
| 1,1
|
|
|
COMMENTS
| This sequence a(n)=A016116(n-1)+A086341(n). Generalization: starting with a(1) even then if n even a(n)=a(n-1)+2 and if n odd a(n)=a(n-2)+a(n-1)-1 you get a new sequence as a(1) increases But if a(1) is odd you get always the same sequence with only less values as a(1) increases If a(1) even the sequence difference between two sequences with different but consecutive a(1) is the sequence of powers of 2 = 2,2,4,4,8,8,16,16,32,32,......
|
|
|
FORMULA
| a(n) = -a(n-1)+2*a(n-2)+2*a(n-3). G.f.: x*(2+6*x+5*x^2)/((1+x)*(1-2*x^2)). [R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Nov 13 2009]
|
|
|
EXAMPLE
| Starting with a(1)=4 the new sequence is 4,6,9,11,19,21,39,41,79,81,159,161
The sequence difference between sequence starting with a(1)=4 and the sequence starting with a(1)=2 is 2,2,4,4,8,8,16,16,32,32,64,64,.......
|
|
|
MATHEMATICA
| LinearRecurrence[{-1, 2, 2}, {2, 4, 5}, 40] (* From Harvey P. Dale, Aug 10 2011 *)
|
|
|
CROSSREFS
| Cf. A016116, A086341.
Sequence in context: A192590 A028289 A039673 * A090614 A171022 A097697
Adjacent sequences: A097578 A097579 A097580 * A097582 A097583 A097584
|
|
|
KEYWORD
| nonn
|
|
|
AUTHOR
| Pierre CAMI (pierre-cami(AT)bbox.fr), Sep 20 2004
|
|
|
EXTENSIONS
| Equation in the comment corrected by R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Nov 13 2009
|
| |
|
|