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.

A153337 Number of zig-zag paths from top to bottom of a 2n-1 by 2n-1 square whose color is that of the top right corner.

Original entry on oeis.org

1, 4, 24, 136, 720, 3624, 17584, 83024, 383904, 1746280, 7839216, 34812144, 153204064, 669108496, 2903267040, 12526343584, 53779871552, 229895033832, 978965187184, 4154438114480, 17575883030496, 74150192517808
Offset: 1

Views

Author

Joseph Myers, Dec 24 2008

Keywords

Examples

			a(3) = 3 * 2 ^ (2*3 - 2) - 2* (3 - 1) * binomial(2*3 - 2, 3 - 1) = 24. - _Indranil Ghosh_, Feb 19 2017
		

Crossrefs

Programs

  • Mathematica
    Table[(n)2^(2n-2)-2(n-1) Binomial[2n-2,n-1],{n,1,22}] (* Indranil Ghosh, Feb 19 2017 *)
  • PARI
    a(n) = n*2^(2*n-2) - 2*(n-1)*binomial(2*n-2,n-1); \\ Michel Marcus, Feb 19 2017
  • Python
    import math
    def C(n,r):
        f=math.factorial
        return f(n)/f(r)/f(n-r)
    def A153337(n):
        return str(n*2**(2*n-2)-2*(n-1)*C(2*n-2,n-1)) # Indranil Ghosh, Feb 19 2017
    

Formula

a(n) = n*2^(2n-2) - 2(n-1)*binomial(2n-2,n-1).