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.

Showing 1-3 of 3 results.

A112685 a(n)=5a(n-2)+2a(n-3).

Original entry on oeis.org

1, 1, 1, 7, 7, 37, 49, 199, 319, 1093, 1993, 6103, 12151, 34501, 72961, 196807, 433807, 1129957, 2562649, 6517399, 15073159, 37712293, 88400593, 218707783, 517427551, 1270340101, 3024553321, 7386555607, 17663446807, 42981884677, 103090345249
Offset: 0

Views

Author

Paul Curtz, Mar 02 2008

Keywords

Comments

Last digit has period 12.

Programs

  • Mathematica
    nxt[{a_,b_,c_}]:={b,c,5b+2a}; NestList[nxt,{1,1,1},30][[;;,1]] (* or *) LinearRecurrence[{0,5,2},{1,1,1},40] (* Harvey P. Dale, Dec 15 2023 *)

Formula

Differences: 0, 0, 6, 0, 30, 12, 150, 120, 774 ... = 6*A135138.
O.g.f.: (-1-x+4*x^2)/((2*x+1)(x^2+2*x-1)) . a(n) = [(-2)^(n+1)+9*A000129(n+1)-15*A000129(n)]/7. - R. J. Mathar, Mar 17 2008

Extensions

More terms from R. J. Mathar, Mar 17 2008

A135139 a(n) = 5*a(n-2) + 2*a(n-3).

Original entry on oeis.org

1, 2, 4, 12, 24, 68, 144, 388, 856, 2228, 5056, 12852, 29736, 74372, 174384, 431332, 1020664, 2505428, 5965984, 14568468, 34840776, 84774308, 203340816, 493553092, 1186252696, 2874447092, 6918369664, 16744740852, 40340742504, 97560443588
Offset: 0

Views

Author

Paul Curtz, Feb 13 2008

Keywords

Crossrefs

Cf. A135138.

Programs

  • Mathematica
    a = {1, 2, 4}; Do[AppendTo[a, 5*a[[ -2]] + 2*a[[ -3]]], {40}]; a (* Stefan Steinerberger, Feb 15 2008 *)
    LinearRecurrence[{0,5,2},{1,2,4},30] (* Harvey P. Dale, May 25 2012 *)

Formula

From R. J. Mathar, Feb 15 2008: (Start)
O.g.f.: 4*(x-2)/(7*(x^2+2*x-1)) - 1/(7*(1+2*x)).
a(n) = (4*A078343(n+1)-(-2)^n)/7.
a(n) = A135138(n+2) + 2*A135138(n+1) - A135138(n). (End)

Extensions

More terms from R. J. Mathar and Stefan Steinerberger, Feb 15 2008

A136161 a(n) = 2*a(n-3) - a(n-6), starting a(0..5) = 0, 5, 2, 1, 3, 1.

Original entry on oeis.org

0, 5, 2, 1, 3, 1, 2, 1, 0, 3, -1, -1, 4, -3, -2, 5, -5, -3, 6, -7, -4, 7, -9, -5, 8, -11, -6, 9, -13, -7, 10, -15, -8, 11, -17, -9, 12, -19, -10, 13, -21, -11, 14, -23, -12, 15, -25, -13, 16, -27, -14
Offset: 0

Views

Author

Paul Curtz, Mar 16 2008

Keywords

Comments

Consider the general recurrence a(n) = k*a(n-1) + (5-2*k)*a(n-2) + (2-k)*a(n-3). The coefficients, in k, can be used to form the triple (k, 5-2*k, 2-k). Each triple is associated with a sequence, for example (0, 5, 2) leads to A111108, A112685, ..., (1, 3, 1) leads to A051927, A097075, ..., and so on. This sequence is formed from the triples {(0, 5, 2), (1, 3, 1), (2, 1, 0), (3, -1, -1), (4, -3, -2), ...}, for k >= 0. (Comment modified by G. C. Greubel, Dec 31 2023).

Crossrefs

Programs

  • Magma
    I:=[0,5,2,1,3,1]; [n le 6 select I[n] else 2*Self(n-3) - Self(n-6): n in [1..60]]; // G. C. Greubel, Dec 26 2023
    
  • Mathematica
    LinearRecurrence[{0,0,2,0,0,-1},{0,5,2,1,3,1},60] (* Harvey P. Dale, Aug 16 2012 *)
    Table[PadRight[{n, 5-2*n, 2-n}], {n,0,20}]//Flatten (* _G. C. Greubel, Dec 26 2023 *)
  • PARI
    Vec(x*(5+2*x+x^2-7*x^3-3*x^4)/((1-x)^2*(1+x+x^2)^2+O(x^99))) \\ Charles R Greathouse IV, Jul 06 2011
    
  • SageMath
    def a(n): # a = A136161
        if n<6: return (0,5,2,1,3,1)[n]
        else: return 2*a(n-3) - a(n-6)
    [a(n) for n in range(61)] # G. C. Greubel, Dec 26 2023

Formula

G.f.: x*(5+2*x+x^2-7*x^3-3*x^4) / ( (1-x)^2*(1+x+x^2)^2 ). - R. J. Mathar, Jul 06 2011
a(3n) = n.
a(3n+1) = 5 - 2*n.
a(3n+3) = 2 - n.
a(n) = (1/9)*( 27 - 2*(n+1) - 34*ChebyshevU(n, -1/2) + (-1)^n*(9*A099254(n) - 6*A099254(n-1)) ). - G. C. Greubel, Dec 26 2023
Showing 1-3 of 3 results.