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

A084964 Follow n+2 by n. Also solution of a(n+2)=a(n)+1, a(0)=2, a(1)=0.

Original entry on oeis.org

2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 9, 7, 10, 8, 11, 9, 12, 10, 13, 11, 14, 12, 15, 13, 16, 14, 17, 15, 18, 16, 19, 17, 20, 18, 21, 19, 22, 20, 23, 21, 24, 22, 25, 23, 26, 24, 27, 25, 28, 26, 29, 27, 30, 28, 31, 29, 32, 30, 33, 31, 34, 32, 35, 33, 36, 34, 37, 35, 38, 36, 39
Offset: 0

Views

Author

Michael Somos, Jun 15 2003

Keywords

Crossrefs

Cf. A217764(1,n) = a(n+2).

Programs

  • Haskell
    import Data.List (transpose)
    a084964 n = a084964_list !! n
    a084964_list = concat $ transpose [[2..], [0..]]
    -- Reinhard Zumkeller, Apr 06 2015
  • Magma
    &cat[ [n+2, n]: n in [0..37] ]; // Klaus Brockhaus, Nov 23 2009
    
  • Maple
    A084964:=n->floor(n/2)+1+(-1)^n; seq(A084964(k), k=0..100); # Wesley Ivan Hurt, Nov 08 2013
  • Mathematica
    lst={}; a=1; Do[a=n-a; AppendTo[lst, a], {n, 0, 100}]; lst (* Vladimir Joseph Stephan Orlovsky, Dec 14 2008 *)
    Table[{n,n-2},{n,2,40}]//Flatten (* or *) LinearRecurrence[{1,1,-1},{2,0,3},80] (* Harvey P. Dale, Sep 12 2021 *)
  • PARI
    a(n)=n\2-2*(n%2)+2
    

Formula

G.f.: (2-2x+x^2)/((1-x)(1-x^2)).
a(2n+1)=n. a(2n)=n+2. a(n+2)=a(n)+1. a(n)=-a(-3-n).
a(n) = floor(n/2) + 1 + (-1)^n. - Reinhard Zumkeller, Aug 27 2005
A112032(n)=2^a(n); A112033(n)=3*2^a(n); a(n)=A109613(n+2)-A052938(n). - Reinhard Zumkeller, Aug 27 2005
a(n) = n + 1 - a(n-1) (with a(0)=2). - Vincenzo Librandi, Aug 08 2010
a(n) = floor(n/2)*3 - floor((n-1)/2)*2. - Ross La Haye, Mar 27 2013
a(n) = 3*n - 3 - 5*floor((n-1)/2). - Wesley Ivan Hurt, Nov 08 2013
a(n) = (3 + 5*(-1)^n + 2*n)/4. - Wolfgang Hintze, Dec 13 2014
E.g.f.: ((4 + x)*cosh(x) - (1 - x)*sinh(x))/2. - Stefano Spezia, Jul 01 2023

Extensions

First part of definition adjusted to match offset by Klaus Brockhaus, Nov 23 2009

A097067 Expansion of g.f. (1-4*x+5*x^2)/(1-2*x)^2.

Original entry on oeis.org

1, 0, 1, 4, 12, 32, 80, 192, 448, 1024, 2304, 5120, 11264, 24576, 53248, 114688, 245760, 524288, 1114112, 2359296, 4980736, 10485760, 22020096, 46137344, 96468992, 201326592, 419430400, 872415232, 1811939328, 3758096384, 7784628224, 16106127360, 33285996544, 68719476736
Offset: 0

Views

Author

Paul Barry, Jul 22 2004

Keywords

Comments

Binomial transform of A097065. Binomial transform is (n-2)*2^(n-1)+2, or A048495 with an extra leading 1.

Crossrefs

Essentially the same as A001787.

Programs

  • Magma
    [(n-1)*2^(n-2)+5*0^n/4 : n in [0..30]]; // Vincenzo Librandi, Sep 25 2011
    
  • Maple
    a:=n->abs(floor(sum (2^(n-1),j=1..n))): seq(a(n),n=-1..28); # Zerinvary Lajos, Jun 27 2007
  • PARI
    Vec((1-4*x+5*x^2)/(1-2*x)^2 + O(x^50)) \\ Altug Alkan, Nov 13 2015

Formula

a(n) = (n-1)*2^(n-2) + 5*0^n/4.
a(n) = 4*a(n-1) - 4*a(n-2), n > 1.
a(n+1) = A001787(n).
E.g.f.: (5 - exp(2*x)*(1 - 2*x))/4. - Stefano Spezia, Jul 01 2023

A209350 Number of initially rising meander words, where each letter of the cyclic n-ary alphabet occurs twice.

Original entry on oeis.org

1, 0, 1, 5, 9, 11, 16, 19, 25, 29, 36, 41, 49, 55, 64, 71, 81, 89, 100, 109, 121, 131, 144, 155, 169, 181, 196, 209, 225, 239, 256, 271, 289, 305, 324, 341, 361, 379, 400, 419, 441, 461, 484, 505, 529, 551, 576, 599, 625, 649, 676, 701, 729, 755, 784, 811, 841
Offset: 0

Views

Author

Alois P. Heinz, Mar 06 2012

Keywords

Comments

In a meander word letters of neighboring positions have to be neighbors in the alphabet, where in a cyclic alphabet the first and the last letters are considered neighbors too. The words are not considered cyclic here.
A word is initially rising if it is empty or if it begins with the first letter of the alphabet that can only be followed by the second letter in this word position.
a(n) is also the number of (2*n-1)-step walks on n-dimensional cubic lattice from (1,0,...,0) to (2,2,...,2) with positive unit steps in all dimensions such that the indices of dimensions used in consecutive steps differ by 1 or are in the set {1,n}.

Examples

			a(0) = 1: the empty word.
a(1) = 0 = |{ }|.
a(2) = 1 = |{abab}|.
a(3) = 5 = |{abacbc, abcabc, abcacb, abcbac, abcbca}|.
a(4) = 9 = |{ababcdcd, abadcbcd, abadcdcb, abcbadcd, abcbcdad, abcdabcd, abcdadcb, abcdcbad, abcdcdab}|.
		

Crossrefs

Row n=2 of A209349.
First differences for n>2 give: A084964(n+1), A097065(n+3).
Cf. A245578.

Programs

  • Maple
    a:= n-> `if`(n<3, (n-1)^2, (n/2+1)^2 -(n mod 2)*5/4):
    seq(a(n), n=0..60);
  • Mathematica
    LinearRecurrence[{2,0,-2,1},{1,0,1,5,9,11,16},60] (* Harvey P. Dale, Jan 02 2020 *)

Formula

G.f.: -(3*x^6-5*x^5-2*x^4+5*x^3+x^2-2*x+1) / ((x+1)*(x-1)^3).
a(n) = (n-1)^2 if n<3, a(n) = (n/2+1)^2 - (n mod 2)*5/4 else.

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

Original entry on oeis.org

1, 0, 2, 2, 5, 6, 10, 12, 17, 20, 26, 30, 37, 42, 50, 56, 65, 72, 82, 90, 101, 110, 122, 132, 145, 156, 170, 182, 197, 210, 226, 240, 257, 272, 290, 306, 325, 342, 362, 380, 401, 420, 442, 462, 485, 506, 530, 552, 577, 600, 626, 650, 677, 702, 730, 756, 785, 812
Offset: 0

Views

Author

Paul Barry, Jul 22 2004

Keywords

Comments

Partial sums of A097065. Pairwise sums are A000124, with extra leading 1.
Binomial transform is 1, 1, 3, 9, 26, ..., A072863 with extra leading 1.

Crossrefs

Programs

  • GAP
    List([0..70], n-> (2*n^2 +3 +5*(-1)^n)/8); # G. C. Greubel, Jun 30 2019
  • Magma
    [(2*n^2 +3 +5*(-1)^n)/8: n in [0..70]]; // G. C. Greubel, Jun 30 2019
    
  • Mathematica
    CoefficientList[Series[(1-2x+2x^2)/((1+x)(1-x)^3), {x, 0, 70}], x] (* or *) LinearRecurrence[{2, 0, -2, 1}, {1, 0, 2, 2}, 70] (* Harvey P. Dale, Apr 08 2014 *)
    Table[(2n^2 +3 +5(-1)^n)/8, {n,0,70}] (* Vincenzo Librandi, Apr 09 2014 *)
  • PARI
    vector(70, n, n--; (2*n^2 +3 +5*(-1)^n)/8) \\ G. C. Greubel, Jun 30 2019
    
  • Sage
    [(2*n^2 +3 +5*(-1)^n)/8 for n in (0..70)] # G. C. Greubel, Jun 30 2019
    

Formula

G.f.: (1-2*x+2*x^2)/((1-x^2)*(1-x)^2).
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4).
a(n) = 5*(-1)^n/8 + (2*n^2+3)/8.
a(n) = A004652(n+1) - A004526(n+1) = ceiling(((n+1)/2)^2) - floor((n+1)/2). - Ridouane Oudra, Jun 22 2019
E.g.f.: ((4+x+x^2)*cosh(x) - (1-x-x^2)*sinh(x))/4. - G. C. Greubel, Jun 30 2019

A265611 a(n) = a(n-1) + floor((n-1)/2) - (-1)^n + 2 for n>=2, a(0)=1, a(1)=3.

Original entry on oeis.org

1, 3, 4, 8, 10, 15, 18, 24, 28, 35, 40, 48, 54, 63, 70, 80, 88, 99, 108, 120, 130, 143, 154, 168, 180, 195, 208, 224, 238, 255, 270, 288, 304, 323, 340, 360, 378, 399, 418, 440, 460, 483, 504, 528, 550, 575, 598, 624, 648, 675, 700, 728, 754, 783, 810, 840
Offset: 0

Views

Author

Peter Luschny, Dec 17 2015

Keywords

Crossrefs

Cf. A084964 and A097065, after the first 3: a(n+1) - a(n) for n>0.
Cf. A055998, after 3: a(n+1) + a(n) for n>0.
Cf. A063929: a(2*n+1) gives the second column of the triangle; for n>0, a(2*n) gives the third column.

Programs

  • Magma
    [1] cat [(2*n*(n+6)-5*(-1)^n+5)/8: n in [1..60]]; // Bruno Berselli, Dec 18 2015
  • Maple
    A265611 := proc(n) iquo(n+1,2); %*(%+irem(n+1,2)+2)+0^n end:
    seq(A265611(n), n=0..55);
  • Mathematica
    Join[{1}, Table[(2 n (n + 6) - 5 (-1)^n + 5)/8, {n, 1, 60}]] (* Bruno Berselli, Dec 18 2015 *)
  • PARI
    Vec((x^4-2*x^3+2*x^2-x-1)/(x^4-2*x^3+2*x-1) + O(x^1000)) \\ Altug Alkan, Dec 18 2015
    
  • Sage
    # The initial values x, y = 0, 1 give the quarter-squares A002620.
    def A265611():
        x, y = 1, 2
        while True:
           yield x
           x, y = x + y, x//y + 1
    a = A265611(); print([next(a) for i in range(60)])
    

Formula

O.g.f.: (x^4-2*x^3+2*x^2-x-1)/(x^4-2*x^3+2*x-1).
E.g.f.: 1-(5/8)*exp(-x)+(1/8)*(5+14*x+2*x^2)*exp(x).
a(2*n) = n*(n+3) + 0^n = A028552(n) + 0^n. [Here 0^0 = 1, otherwise 0^s = 0. - N. J. A. Sloane, Aug 26 2022]
a(2*n+1) = (n+1)*(n+3) = A005563(n+1).
a(n+1) - a(n) = floor(n/2) + 2 + (-1)^n - 0^n.
a(n) = a(-n-6) = (2*n*(n+6) - 5*(-1)^n + 5)/8 for n>0, a(0)=1. [Bruno Berselli, Dec 18 2015]
For n>0, a(n) = n + 1 + Sum_{i=1..n+1} floor(i/2) + (-1)^i = n + floor((n+1)^2/4) + (1 - (-1)^n)/2. - Enrique Pérez Herrero, Dec 18 2015
Sum_{n>=0} 1/a(n) = 85/36. - Enrique Pérez Herrero, Dec 18 2015
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4) for n>5. - R. H. Hardin, Dec 21 2015, proved by Susanne Wienand for the algorithm sent to the seqfan mailing list and used in the Sage script below.
a(n) = A002620(n+1) + A052928(n+1) for n>=1. (Note A198442(n) = A002620(n+2) - A052928(n+2) for n>=1.) - Peter Luschny, Dec 22 2015
a(n) = (floor((n+3)/2)-1)*(ceiling((n+3)/2)+1) for n>0. - Wesley Ivan Hurt, Mar 30 2017

A267182 Row 2 of the square array in A267181.

Original entry on oeis.org

1, 2, 0, 3, 1, 4, 2, 5, 3, 6, 4, 7, 5, 8, 6, 9, 7, 10, 8, 11, 9, 12, 10, 13, 11, 14, 12, 15, 13, 16, 14, 17, 15, 18, 16, 19, 17, 20, 18, 21, 19, 22, 20, 23, 21, 24, 22, 25, 23, 26, 24, 27, 25, 28, 26, 29, 27, 30, 28, 31, 29, 32, 30, 33, 31, 34, 32, 35, 33, 36, 34, 37, 35, 38, 36, 39, 37, 40, 38, 41, 39
Offset: 0

Views

Author

N. J. A. Sloane, Jan 17 2016

Keywords

Comments

From Charlie Neder, Feb 06 2019: (Start)
Colin Barker's conjectures below are true.
Proof: A267181(ka,kb) = A267181(a,b) since both operations preserve the greatest common factor of the two coordinates, so A267181(2k,2) = A267181(k,1) = k for k > 1, the second conjecture. For odd coordinates, we have the forced chain (2k+1,2) -> (2,2k+1) -> (2,2k-1) -> ... -> (2,1) -> (1,2) -> (1,1) with k+3 operations, the third conjecture. The rest follow from combining these. (End)

Crossrefs

Cf. A267181.
Essentially the same as A097065 and A084964.

Formula

Conjectures from Colin Barker, Jan 29 2016: (Start)
a(n) = (1-5*(-1)^n+2*n)/4 for n>0.
a(n) = (n-2)/2 for n>0 and even.
a(n) = (n+3)/2 for n odd.
a(n) = a(n-1)+a(n-2)-a(n-3) for n>3.
G.f.: (1+x-3*x^2+2*x^3) / ((1-x)^2*(1+x)).
(End) [These are true - see Comments]

A321373 Array T(n,k) read by antidiagonals where the first row is (-1)^k*A140966(k) and each subsequent row is obtained by adding A001045(k) to the preceding one.

Original entry on oeis.org

2, 2, -1, 2, 0, 3, 2, 1, 4, 1, 2, 2, 5, 4, 7, 2, 3, 6, 7, 12, 9, 2, 4, 7, 10, 17, 20, 23, 2, 5, 8, 13, 22, 31, 44, 41, 2, 6, 9, 16, 27, 42, 65, 84, 87, 2, 7, 10, 19, 32, 53, 86, 127, 172, 169, 2, 8, 11, 22, 37, 64, 107, 170, 257, 340, 343
Offset: 0

Views

Author

Paul Curtz, Nov 08 2018

Keywords

Comments

Array:
2, -1, 3, 1, 7, 9, 23, 41, 87, ... = (-1)^n*A140966(n)
2, 0, 4, 4, 12, 20, 44, 84, 172, ... = abs(A084247(n+1))
2, 1, 5, 7, 17, 31, 65, 127, 257, ... = A014551(n)
2, 2, 6, 10, 22, 42, 86, 170, 342, ... = A078008(n+2) = A014113(n+1)
2, 3, 7, 13, 27, 53, 107, 213, 427, ... = A048573(n)
2, 4, 8, 16, 32, 64, 128, 256, 512, ... = A000079(n+1)
2, 5, 9, 19, 37, 75, 149, 299, 597, ... = A062092(n)
2, 6, 10, 22, 42, 86, 170, 342, 682, ... = A078008(n+3) = A014113(n+2).
T(n+1,k) = (-1)^k*A140966(k) + (n+1)*A001045(k).
Every row T(n+1,k) has the signature (1,2).
T(0,k) = 2, -2, 2, -2, ... = (-1)^n*2.
T(n+1,k) - T(0,k) = (n+1)*A001045(n).
5*A001045(n) is not in the OEIS.

Examples

			Triangle a(n):
  2;
  2, -1;
  2,  0,  3;
  2,  1,  4,  1;
  2,  2,  5,  4,  7;
  2,  3,  6,  7, 12,  9;
  2,  4,  7, 10, 17, 20, 23;
  etc.
Row sums: 2, 1, 5, 8, 20, 39, 83, 166, 338, 677, 1361, 2724, ... = b(n+2).
With b(0) = 2 and b(1) = 0, b(n) = b(n-1) + 2*b(n-2)  + n - 4, n > 1.
b(n) = A001045(n) - A097065(n-1).
b(n) = b(n-2) + A000225(n-2).
		

Crossrefs

Programs

  • Mathematica
    T[_, 0] = 2;
    T[0, k_] := (2^k + 5(-1)^k)/3;
    T[n_ /; n>0, k_ /; k>0] := T[n, k] = T[n-1, k] + (2^k + (-1)^(k+1))/3;
    T[, ] = 0;
    Table[T[n-k, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Nov 10 2018 *)
Showing 1-7 of 7 results.