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-4 of 4 results.

A081250 Numbers k such that A081249(m)/m^2 has a local minimum for m = k.

Original entry on oeis.org

1, 3, 11, 33, 101, 303, 911, 2733, 8201, 24603, 73811, 221433, 664301, 1992903, 5978711, 17936133, 53808401, 161425203, 484275611, 1452826833, 4358480501, 13075441503, 39226324511, 117678973533, 353036920601, 1059110761803
Offset: 0

Views

Author

Klaus Brockhaus, Mar 17 2003

Keywords

Comments

The limit of the local minima, lim_{n->infinity} A081249(n)/n^2 = 1/10. For local maxima cf. A081251.

Examples

			11 is a term since A081249(10)/10^2 = 11/100 = 0.110, A081249(11)/11^2 = 13/121 = 0.107, A081249(12)/12^2 = 16/144 = 0.111.
		

Crossrefs

Programs

  • GAP
    List([0..30], n-> (5*3^n +(-1)^n -2)/4); # G. C. Greubel, Jul 14 2019
  • Magma
    [Floor(3^n*5/4): n in [0..30]]; // Vincenzo Librandi, Jun 10 2011
    
  • Maple
    a[0]:=1:a[1]:=3:for n from 2 to 50 do a[n]:=2*a[n-1]+3*a[n-2]+2 od: seq(a[n], n=0..30); # Zerinvary Lajos, Apr 28 2008
  • Mathematica
    Floor[5*3^Range[0, 30]/4] (* Wesley Ivan Hurt, Mar 30 2017 *)
  • PARI
    vector(30, n, n--; (5*3^n +(-1)^n -2)/4) \\ G. C. Greubel, Jul 14 2019
    
  • Sage
    [(5*3^n +(-1)^n -2)/4 for n in (0..30)] # G. C. Greubel, Jul 14 2019
    

Formula

a(n) = floor(3^n*5/4).
G.f.: x*(1+x^2)/((1-x)*(1+x)*(1-3*x)).
a(n) = 3*a(n-1) + 1*a(n-2) - 3*a(n-3).
a(n) = (5*3^n + (-1)^n - 2)/4. - Paul Barry, May 19 2003
a(n) = a(n-2) + 10*3^(n-2) for n > 1.
a(n+2) - a(n) = A005052(n).
a(2*n) = Sum_{j=1..n+1} A062107(2*j).
a(2*n+1) = Sum_{j=1..n+1} A062107(2*j+1).
With a leading 0, this is a(n) = (5*3^n - 6 + 4*0^n - 3*(-1)^n)/12, the binomial transform of A084183. - Paul Barry, May 19 2003
Convolution of 3^n and {1, 0, 2, 0, 2, 0, ...}. a(n) = Sum_{k=0..n} ((1 + (-1)^k) - 0^k)*3^(n-k) = Sum_{k=0..n} ((1 + (-1)^(n-k)) - 0^(n-k))3^k. - Paul Barry, Jul 19 2004
a(n) = 2*a(n-1) + 3*a(n-2) + 2, a(0)=1, a(1)=3. - Zerinvary Lajos, Apr 28 2008

Extensions

Offset changed from 1 to 0 by Vincenzo Librandi, Jun 10 2011

A081251 Numbers n such that A081249(m)/m^2 has a local maximum for m = n.

Original entry on oeis.org

2, 6, 20, 60, 182, 546, 1640, 4920, 14762, 44286, 132860, 398580, 1195742, 3587226, 10761680, 32285040, 96855122, 290565366, 871696100, 2615088300, 7845264902, 23535794706, 70607384120, 211822152360, 635466457082, 1906399371246
Offset: 1

Views

Author

Klaus Brockhaus, Mar 17 2003

Keywords

Comments

The limit of the local maxima, lim A081249(n)/n^2 = 1/6. For local minima cf. A081250.
Also the number of different 4- and 3-colorings for the vertices of all triangulated planar polygons on a base with n+2 vertices, if the colors of the two base vertices are fixed. - Patrick Labarque, Mar 23 2010
From Toby Gottfried, Apr 18 2010: (Start)
a(n) = the number of ternary sequences of length n+1 where the numbers of (0's, 1's) are both odd.
A015518 covers the (odd, even) and (even, odd) cases, and A122983 covers (even, even). (End)

Examples

			6 is a term since A081249(5)/5^2 = 4/25 = 0.160, A081249(6)/6^2 = 7/36 = 0.194, A081249(7)/7^2 = 9/49 = 0.184.
		

Crossrefs

Programs

  • GAP
    List([1..30], n-> (9*3^(n-1) -(-1)^n -2)/4); # G. C. Greubel, Jul 14 2019
  • Magma
    [Floor(3^(n+1)/4) : n in [1..30]]; // Vincenzo Librandi, Jun 25 2011
    
  • Maple
    seq(floor(3^(n+1)/4), n=1..30). # Mircea Merca, Dec 27 2010
  • Mathematica
    a[n_]:= Floor[3^(n+1)/4]; Array[a, 30]
    Table[(9*3^(n-1) -(-1)^n -2)/4, {n, 1, 30}] (* G. C. Greubel, Jul 14 2019 *)
  • PARI
    vector(30, n, (9*3^(n-1) -(-1)^n -2)/4) \\ G. C. Greubel, Jul 14 2019
    
  • Sage
    [(9*3^(n-1) -(-1)^n -2)/4 for n in (1..30)] # G. C. Greubel, Jul 14 2019
    

Formula

G.f.: 2/((1-x)*(1+x)*(1-3*x)).
a(n) = a(n-2) + 2*3^(n) for n > 1.
a(n+2) - a(n) = A008776(n).
a(n) = 2*A033113(n+1).
a(2*n+1) = A054880(n+1).
a(n) = floor(3^(n+1)/4). - Mircea Merca, Dec 26 2010
From G. C. Greubel, Jul 14 2019: (Start)
a(n) = (9*3^(n-1) -(-1)^n -2)/4.
E.g.f.: (3*exp(3*x) - 2*exp(x) - exp(-x))/4. (End)

A081134 Distance to nearest power of 3.

Original entry on oeis.org

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

Views

Author

Klaus Brockhaus, Mar 08 2003

Keywords

Examples

			a(7) = 2 since 9 is closest power of 3 to 7 and 9 - 7 = 2.
		

Crossrefs

Programs

  • Maple
    a:= n-> (h-> min(n-h, 3*h-n))(3^ilog[3](n)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Mar 28 2021
  • Mathematica
    Flatten[Table[Join[Range[0,3^n],Range[3^n-1,1,-1]],{n,0,4}]] (* Harvey P. Dale, Dec 31 2013 *)
  • PARI
    a(n) = my (p=#digits(n,3)); return (min(n-3^(p-1), 3^p-n)) \\ Rémy Sigrist, Mar 24 2018
    
  • Python
    def A081134(n):
        kmin, kmax = 0,1
        while 3**kmax <= n:
            kmax *= 2
        while True:
            kmid = (kmax+kmin)//2
            if 3**kmid > n:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        return min(n-3**kmin, 3*3**kmin-n) # Chai Wah Wu, Mar 31 2021

Formula

a(n) = min(n-3^floor(log(n)/log(3)), 3*3^floor(log(n)/log(3))-n).
From Peter Bala, Sep 30 2022: (Start)
a(n) = n - A006166(n); a(n) = 2*n - A003605(n).
a(1) = 0, a(2) = 1, a(3) = 0; thereafter, a(3*n) = 3*a(n), a(3*n+1) = 2*a(n) + a(n+1) and a(3*n+2) = a(n) + 2*a(n+1). (End)

A104522 Expansion of (-1+x+3*x^2-x^3)/((x+1)(3*x-1)(x-1)^2).

Original entry on oeis.org

1, 3, 7, 19, 53, 155, 459, 1371, 4105, 12307, 36911, 110723, 332157, 996459, 2989363, 8968075, 26904209, 80712611, 242137815, 726413427, 2179240261, 6537720763, 19613162267, 58839486779, 176518460313, 529555380915, 1588666142719, 4765998428131
Offset: 0

Views

Author

Creighton Dement, Apr 20 2005

Keywords

Comments

A floretion-generated sequence relating to A081250 (Numbers n such that A081249(m)/m^2 has a local minimum for m = n).
Binomial transform starts: 1, 4, 14, 50, 184, 696, 2688, 10528, 41600, 165248, ... - Wesley Ivan Hurt, Sep 12 2014
Floretion Algebra Multiplication Program, FAMP Code: 1famforrokseq[ - .5'j + .5'k - .5j' + .5k' - 'ii' - .5'ij' - .5'ik' - .5'ji' - .5'ki']

Crossrefs

Programs

  • Magma
    [(5*3^n+4*(n+1)-(-1)^n)/8 : n in [0..30]]; // Wesley Ivan Hurt, Sep 12 2014
  • Maple
    A104522:=n->(5*3^n+4*(n+1)-(-1)^n)/8: seq(A104522(n), n=0..30); # Wesley Ivan Hurt, Sep 12 2014
  • Mathematica
    CoefficientList[Series[(-1 + x + 3 x^2 - x^3)/((x + 1) (3*x - 1) (x - 1)^2), {x, 0, 30}], x] (* Wesley Ivan Hurt, Sep 12 2014 *)

Formula

a(n) = (1/8) * (5*3^n + 4*(n+1) - (-1)^n). - Ralf Stephan, Nov 13 2010.
a(n+2) - 2a(n+1) + a(n) = A081250(n+1) - A081250(n).
a(n) = 4*a(n-1)-2*a(n-2)-4*a(n-3)+3*a(n-4). - Wesley Ivan Hurt, Sep 12 2014
Showing 1-4 of 4 results.