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.
%I A087503 #38 Sep 03 2025 07:39:28 %S A087503 1,3,6,12,21,39,66,120,201,363,606,1092,1821,3279,5466,9840,16401, %T A087503 29523,49206,88572,147621,265719,442866,797160,1328601,2391483, %U A087503 3985806,7174452,11957421,21523359,35872266,64570080,107616801,193710243,322850406,581130732 %N A087503 a(n) = 3*(a(n-2) + 1), with a(0) = 1, a(1) = 3. %H A087503 Vincenzo Librandi, <a href="/A087503/b087503.txt">Table of n, a(n) for n = 0..2000</a> %H A087503 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,3,-3). %F A087503 a(n) = a(n-1) + A038754(n). (i.e., partial sums of A038754). %F A087503 From _Hieronymus Fischer_, Sep 19 2007, formulas adjusted to offset, Dec 29 2012: (Start) %F A087503 G.f.: (1+2*x)/((1-3*x^2)*(1-x)). %F A087503 a(n) = (3/2)*(3^((n+1)/2)-1) if n is odd, else a(n) = (3/2)*(5*3^((n-2)/2)-1). %F A087503 a(n) = (3/2)*(3^floor((n+1)/2) + 3^floor(n/2) - 3^floor((n-1)/2)-1). %F A087503 a(n) = 3^floor((n+1)/2) + 3^floor((n+2)/2)/2 - 3/2. %F A087503 a(n) = A132667(a(n+1)) - 1. %F A087503 a(n) = A132667(a(n-1) + 1) for n > 0. %F A087503 A132667(a(n)) = a(n-1) + 1 for n > 0. %F A087503 Also numbers such that: a(0)=1, a(n) = a(n-1) + (p-1)*p^((n+1)/2 - 1) if n is odd, else a(n) = a(n-1) + p^(n/2), where p=3. (End) %F A087503 a(n) = A052993(n)+2*A052993(n-1). - _R. J. Mathar_, Sep 10 2021 %p A087503 A087503 := proc(n) %p A087503 option remember; %p A087503 if n <=1 then %p A087503 op(n+1,[1,3]) ; %p A087503 else %p A087503 3*procname(n-2)+3 ; %p A087503 end if; %p A087503 end proc: %p A087503 seq(A087503(n),n=0..20) ; # _R. J. Mathar_, Sep 10 2021 %t A087503 RecurrenceTable[{a[0]==1,a[1]==3,a[n]==3(a[n-2]+1)},a,{n,40}] (* or *) LinearRecurrence[{1,3,-3},{1,3,6},40] (* _Harvey P. Dale_, Jan 01 2015 *) %o A087503 (Magma) [(3/2)*(3^Floor((n+1)/2)+3^Floor(n/2)-3^Floor((n-1)/2)-1): n in [0..40]]; // _Vincenzo Librandi_, Aug 16 2011 %o A087503 (Python) %o A087503 def A087503(n): return (3+((n+1&1)<<1))*3**(n+1>>1)-3>>1 # _Chai Wah Wu_, Sep 02 2025 %Y A087503 Sequences with similar recurrence rules: A027383 (p=2), A133628 (p=4), A133629 (p=5). %Y A087503 Other related sequences for different p: A016116 (p=2), A038754 (p=3), A084221 (p=4), A133632 (p=5). %Y A087503 See A133629 for general formulas with respect to the recurrence rule parameter p. %Y A087503 Related sequences: A132666, A132667, A132668, A132669. %K A087503 nonn,easy,changed %O A087503 0,2 %A A087503 _Reinhard Zumkeller_, Sep 11 2003 %E A087503 Additional comments from _Hieronymus Fischer_, Sep 19 2007 %E A087503 Edited by _N. J. A. Sloane_, May 04 2010. I merged two essentially identical entries with different offsets, so some of the formulas may need to be adjusted. %E A087503 Formulas and MAGMA prog adjusted to offset 0 by _Hieronymus Fischer_, Dec 29 2012