cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A097581 a(n) = 3*2^floor((n-1)/2) + (-1)^n.

This page as a plain text file.
%I A097581 #22 Apr 18 2017 22:43:38
%S A097581 2,4,5,7,11,13,23,25,47,49,95,97,191,193,383,385,767,769,1535,1537,
%T A097581 3071,3073,6143,6145,12287,12289,24575,24577,49151,49153,98303,98305,
%U A097581 196607,196609,393215,393217,786431,786433,1572863,1572865
%N A097581 a(n) = 3*2^floor((n-1)/2) + (-1)^n.
%C A097581 Previous name was: 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.
%C A097581 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) is 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,......
%H A097581 G. C. Greubel, <a href="/A097581/b097581.txt">Table of n, a(n) for n = 1..1000</a>
%H A097581 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (-1,2,2).
%F A097581 From _R. J. Mathar_, Nov 13 2009: (Start)
%F A097581 a(n) = -a(n-1) + 2*a(n-2) + 2*a(n-3).
%F A097581 G.f.: x*(2+6*x+5*x^2)/((1+x)*(1-2*x^2)). (End)
%e A097581 Starting with a(1)=4 the new sequence is 4,6,9,11,19,21,39,41,79,81,159,161
%e A097581 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,.......
%t A097581 LinearRecurrence[{-1,2,2},{2,4,5},40] (* _Harvey P. Dale_, Aug 10 2011 *)
%t A097581 Table[3*2^(Floor[(n - 1)/2]) + (-1)^n, {n, 1,50}] (* _G. C. Greubel_, Apr 18 2017 *)
%o A097581 (PARI) a(n)=3*2^floor((n-1)/2)+(-1)^n
%Y A097581 Cf. A016116, A086341.
%K A097581 nonn
%O A097581 1,1
%A A097581 _Pierre CAMI_, Sep 20 2004
%E A097581 Equation in the comment corrected by _R. J. Mathar_, Nov 13 2009
%E A097581 Better name from _Ralf Stephan_, Aug 19 2013