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.

A026640 a(n) = A026637(2*n, n-2).

Original entry on oeis.org

1, 8, 38, 161, 662, 2672, 10676, 42398, 167756, 662252, 2610758, 10283861, 40490702, 159394424, 627456188, 2470223186, 9726696572, 38308366784, 150916209308, 594704861546, 2344206594332, 9243186573248, 36456892635848
Offset: 2

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [1] cat [n le 2 select 4^(n+1) -3^(n+1) +1 else ((7*n^2+24*n+24 )*Self(n-1) + 2*(2*n+3)*(n+2)*Self(n-2))/(2*n*(n+4)): n in [1..40]]; // G. C. Greubel, Jul 01 2024
    
  • Mathematica
    a[n_]:= a[n]= If[n<5, 4^(n-1) -3^(n-1) +1 -Boole[n==2], ((7*n^2 -4*n + 4)*a[n-1] +2*n*(2*n-1)*a[n-2])/(2*(n-2)*(n+2))];
    Table[a[n], {n,2,40}] (* G. C. Greubel, Jul 01 2024 *)
  • SageMath
    @CachedFunction
    def a(n): # a = A026640
        if n<5: return 4^(n-1) -3^(n-1) +1 -int(n==2)
        else: return ((7*n^2-4*n+4)*a(n-1) + 2*n*(2*n-1)*a(n-2))/(2*(n-2)*(n+2))
    [a(n) for n in range(2,41)] # G. C. Greubel, Jul 01 2024

Formula

a(n) = ((7*n^2 - 4*n + 4)*a(n-1) + 2*n*(2*n-1)*a(n-2))/(2*(n-2)*(n+2)), n >= 5. - G. C. Greubel, Jul 01 2024