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

A026552 Irregular triangular array T read by rows: T(n, 0) = T(n, 2*n) = 1, T(n, 1) = T(n, 2*n-1) = floor(n/2 + 1), for even n >= 2, T(n, k) = T(n-1, k-2) + T(n-1, k-1) + T(n-1, k), otherwise T(n, k) = T(n-1, k-2) + T(n-1, k).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 3, 2, 1, 1, 2, 4, 4, 4, 2, 1, 1, 3, 7, 10, 12, 10, 7, 3, 1, 1, 3, 8, 13, 19, 20, 19, 13, 8, 3, 1, 1, 4, 12, 24, 40, 52, 58, 52, 40, 24, 12, 4, 1, 1, 4, 13, 28, 52, 76, 98, 104, 98, 76, 52, 28, 13, 4, 1, 1, 5, 18, 45, 93, 156, 226, 278
Offset: 0

Views

Author

Keywords

Comments

T(n, k) = number of integer strings s(0)..s(n) such that s(0) = 0, s(n) = n-k, |s(i)-s(i-1)|<=1 if i is even or i = 1, |s(i)-s(i-1)| = 1 if i is odd and i >= 3.

Examples

			First 5 rows:
  1;
  1, 1, 1;
  1, 2, 3,  2,  1;
  1, 2, 4,  4,  4,  2,  1;
  1, 3, 7, 10, 12, 10,  7,  3,  1;
		

Crossrefs

Programs

  • Mathematica
    z = 12; t[n_, 0] := 1; t[n_, k_] := 1 /; k == 2 n; t[n_, 1] := Floor[n/2 + 1]; t[n_, k_] := Floor[n/2 + 1] /; k == 2 n - 1; t[n_, k_] := t[n, k] = If[EvenQ[n], t[n - 1, k - 2] + t[n - 1, k - 1] + t[n - 1, k], t[n - 1, k - 2] + t[n - 1, k]]; u = Table[t[n, k], {n, 0, z}, {k, 0, 2 n}];
    TableForm[u] (* A026552 array *)
    v = Flatten[u] (* A026552 sequence *)
  • Sage
    @CachedFunction
    def T(n,k): # T = A026552
        if (k==0 or k==2*n): return 1
        elif (k==1 or k==2*n-1): return (n+2)//2
        elif (n%2==0): return T(n-1, k) + T(n-1, k-1) + T(n-1, k-2)
        else: return T(n-1, k) + T(n-1, k-2)
    flatten([[T(n,k) for k in (0..2*n)] for n in (0..10)]) # G. C. Greubel, Dec 17 2021

Formula

Sum_{k=0..2*n} T(n,k) = A026565(n). - G. C. Greubel, Dec 17 2021

Extensions

Updated by Clark Kimberling, Aug 28 2014

A026567 a(n) = Sum_{i=0..2*n} Sum_{j=0..i} T(i, j), where T is given by A026552.

Original entry on oeis.org

1, 4, 13, 31, 85, 193, 517, 1165, 3109, 6997, 18661, 41989, 111973, 251941, 671845, 1511653, 4031077, 9069925, 24186469, 54419557, 145118821, 326517349, 870712933, 1959104101, 5224277605, 11754624613, 31345665637, 70527747685
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [Truncate((2*(1+(-1)^n)*6^((n+2)/2) + 27*(1-(-1)^n)*6^((n-1)/2) -14)/10): n in [0..40]]; // G. C. Greubel, Dec 19 2021
    
  • Mathematica
    CoefficientList[Series[(1 +3x +3x^2)/((1-x)(1-6x^2)), {x, 0, 40}], x] (* Vincenzo Librandi, Feb 25 2014 *)
    LinearRecurrence[{1,6,-6},{1,4,13},30] (* Harvey P. Dale, Aug 23 2014 *)
  • Sage
    [(1/10)*(2*(1+(-1)^n)*6^((n+2)/2) +27*(1-(-1)^n)*6^((n-1)/2) -14) for n in (0..40)] # G. C. Greubel, Dec 19 2021

Formula

a(n) = Sum_{i=0..2*n} Sum_{j=0..i} A026552(i, j).
G.f.: (1+3*x+3*x^2)/((1-x)*(1-6*x^2)). - Ralf Stephan, Feb 03 2004
a(n) = 6*a(n-2) + 7. - Philippe Deléham, Feb 24 2014
a(2*k) = A233325(k). - Philippe Deléham, Feb 24 2014
From Colin Barker, Nov 25 2016: (Start)
a(n) = (2^(n/2+2) * 3^(n/2+1) - 7)/5 for n even.
a(n) = (2^((n-1)/2) * 3^((n+5)/2) - 7)/5 for n odd. (End)
a(n) = (1/10)*(2*(1+(-1)^n)*6^((n+2)/2) + 27*(1-(-1)^n)*6^((n-1)/2) - 14). - G. C. Greubel, Dec 19 2021

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

Original entry on oeis.org

3, 9, 21, 57, 129, 345, 777, 2073, 4665, 12441, 27993, 74649, 167961, 447897, 1007769, 2687385, 6046617, 16124313, 36279705, 96745881, 217678233, 580475289, 1306069401, 3482851737, 7836416409, 20897110425, 47018498457
Offset: 0

Views

Author

Keywords

Comments

The even terms are the number of holes of Sierpiński triangle-like fractals. The odd terms are the total number of holes and triangles. - Kival Ngaokrajang, Mar 30 2014
All terms are divisible by 3 (see g.f.). - Joerg Arndt, Dec 20 2014
Former title a(n) = Sum_{j=0..2*n} Sum_{k=0..j} A026536(j, k) was incorrect. - G. C. Greubel, Apr 12 2022

Crossrefs

Programs

  • Magma
    [(3/5)*(-1 + 6^(1+Floor(n/2))*((n+1) mod 2) + 16*6^(Floor((n-1)/2))*(n mod 2)): n in [0..40]]; // G. C. Greubel, Apr 12 2022
    
  • Mathematica
    Table[(3/5)*(-1 +3*6^(n/2)*(1+(-1)^n) +8*6^((n-1)/2)*(1-(-1)^n)), {n, 0, 40}] (* G. C. Greubel, Apr 12 2022 *)
  • PARI
    Vec( 3*(1+2*x-2*x^2)/((1-x)*(1-6*x^2))+O(x^33)); \\ Joerg Arndt, Dec 20 2014
    
  • SageMath
    [(3/5)*(-1 + 6*6^(n/2)*((n+1)%2)  + 16*6^((n-1)/2)*(n%2)) for n in (0..40)] # G. C. Greubel, Apr 12 2022

Formula

G.f.: 3*(1+2*x-2*x^2)/((1-x)*(1-6*x^2)). - Ralf Stephan, Feb 03 2004
From G. C. Greubel, Apr 12 2022: (Start)
a(n) = (3/5)*( -1 + 3*6^(n/2)*(1 + (-1)^n) + 8*6^((n-1)/2)*(1 - (-1)^n) ).
a(2*n) = (3/5)*(6^(n+1) - 1).
a(2*n+1) = (3/5)*(16*6^n -1).
a(n) = a(n-1) + 6*a(n-2) - a(n-3). (End)

Extensions

Name corrected by G. C. Greubel, Apr 12 2022
Showing 1-3 of 3 results.