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

A135231 Row sums of triangle A135230.

Original entry on oeis.org

1, 2, 4, 6, 12, 22, 44, 86, 172, 342, 684, 1366, 2732, 5462, 10924, 21846, 43692, 87382, 174764, 349526, 699052, 1398102, 2796204, 5592406, 11184812, 22369622, 44739244, 89478486, 178956972, 357913942, 715827884, 1431655766, 2863311532, 5726623062, 11453246124, 22906492246, 45812984492
Offset: 0

Views

Author

Gary W. Adamson, Nov 23 2007

Keywords

Examples

			a(3) = 6 = sum of row 4 terms of triangle A135230; (1 + 2 + 2 + 1).
a(5) = 22 = A005578(6).
a(6) = 44 = A005578(7) + 1.
		

Crossrefs

Programs

  • Magma
    function T(n,k)
      if k eq n then return 1;
      elif k eq 0 then return (3+(-1)^n)/2;
      else return (&+[Binomial(n-2*j-1, k-1): j in [0..Floor((n-1)/2)]]);
      end if; return T; end function;
    [(&+[T(n,j): j in [0..n]]): n in [0..40]]; // G. C. Greubel, Nov 20 2019
    
  • Maple
    T:= proc(n, k) option remember;
          if k=n then 1
        elif k=0 then (3+(-1)^n)/2
        else add(binomial(n-2*j-1, k-1), j=0..floor((n-1)/2))
          fi; end:
    seq( add(T(n, j), j=0..n), n=0..40); # G. C. Greubel, Nov 20 2019
  • Mathematica
    T[n_, k_]:= T[n, k]= If[k==n, 1, If[k==0, (3+(-1)^n)/2, Sum[Binomial[n-1 - 2*j, k-1], {j, 0, Floor[(n-1)/2]}]]]; Table[Sum[T[n, j], {j, 0, n}], {n, 0, 40}] (* G. C. Greubel, Nov 20 2019 *)
  • PARI
    T(n,k) = if(k==n, 1, if(k==0, (3+(-1)^n)/2, sum(j=0, (n-1)\2, binomial( n-2*j-1, k-1)) )); \\ G. C. Greubel, Nov 20 2019
    
  • Sage
    @CachedFunction
    def T(n, k):
        if (k==n): return 1
        elif (k==0): return (3+(-1)^n)/2
        else: return sum(binomial(n-2*j-1, k-1) for j in (0..floor((n-1)/2)))
    [sum(T(n, j) for j in (0..n)) for n in (0..40)] # G. C. Greubel, Nov 20 2019

Formula

a(2*n+1) = A005578(n+1) if n is odd.
Conjectures from Chai Wah Wu, Aug 31 2023: (Start)
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3) for n > 3.
G.f.: (-2*x^3 - x^2 + 1)/((x - 1)*(x + 1)*(2*x - 1)). (End)

Extensions

Terms a(16) onward added and offset changed by G. C. Greubel, Nov 20 2019
Showing 1-1 of 1 results.