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.

A026637 Triangular array T read by rows: T(n,0) = T(n,n) = 1 for n >= 0, T(n,1) = T(n,n-1) = floor((3*n-1)/2) for n >= 1, otherwise T(n,k) = T(n-1,k-1) + T(n-1,k) for 2 <= k <= n-2, n >= 4.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 4, 4, 1, 1, 5, 8, 5, 1, 1, 7, 13, 13, 7, 1, 1, 8, 20, 26, 20, 8, 1, 1, 10, 28, 46, 46, 28, 10, 1, 1, 11, 38, 74, 92, 74, 38, 11, 1, 1, 13, 49, 112, 166, 166, 112, 49, 13, 1, 1, 14, 62, 161, 278, 332, 278, 161, 62, 14, 1, 1, 16, 76, 223, 439, 610, 610, 439, 223, 76, 16, 1
Offset: 0

Views

Author

Keywords

Comments

T(n, k) = number of paths from (0, 0) to (n-k, k) in directed graph having vertices (i, j) and edges (i, j)-to-(i+1, j) and (i, j)-to-(i, j+1) for i, j >= 0 and edges (i, j)-to-(i+1, j+1) for i=0, j >= 1 and odd and for j=0, i >= 1 and odd.
See A228053 for a sequence with many terms in common with this one. - T. D. Noe, Aug 07 2013

Examples

			Triangle begins as:
  1;
  1,  1;
  1,  2,  1;
  1,  4,  4,   1;
  1,  5,  8,   5,   1;
  1,  7, 13,  13,   7,   1;
  1,  8, 20,  26,  20,   8,   1;
  1, 10, 28,  46,  46,  28,  10,   1;
  1, 11, 38,  74,  92,  74,  38,  11,  1;
  1, 13, 49, 112, 166, 166, 112,  49, 13,  1;
  1, 14, 62, 161, 278, 332, 278, 161, 62, 14,  1;
		

Crossrefs

Sums include: A000007 (alternating sign row), A026644 (row), A026645, A026646, A026647 (diagonal).

Programs

  • Haskell
    a026637 n k = a026637_tabl !! n !! k
    a026637_row n = a026637_tabl !! n
    a026637_tabl = [1] : [1,1] : map (fst . snd)
       (iterate f (0, ([1,2,1], [0,1,1,0]))) where
       f (i, (xs, ws)) = (1 - i,
         if i == 1 then (ys, ws) else (zipWith (+) ys ws, ws'))
            where ys = zipWith (+) ([0] ++ xs) (xs ++ [0])
                  ws' = [0,1,0,0] ++ drop 2 ws
    -- Reinhard Zumkeller, Aug 08 2013
    
  • Magma
    function T(n,k) // T = A026637
       if k eq 0 or k eq n then return 1;
       elif k eq 1 or k eq n-1 then return Floor((3*n-1)/2);
       else return T(n-1, k) + T(n-1, k-1);
       end if;
    end function;
    [T(n,k): k in [0..n], n in [0..15]]; // G. C. Greubel, Jun 28 2024
    
  • Maple
    A026637 := proc(n,k)
          option remember;
          if k=0 or k=n then
            1
        elif k=1 or k=n-1 then
            floor((3*n-1)/2) ;
        elif k <0 or k > n then
            0;
        else
            procname(n-1,k-1)+procname(n-1,k) ;
        end if;
    end proc: # R. J. Mathar, Apr 26 2015
  • Mathematica
    T[n_, k_] := T[n, k] = Which[k == 0 || k == n, 1, k == 1 || k == n-1, Floor[(3n-1)/2], k < 0 || k > n, 0, True, T[n-1, k-1] + T[n-1, k]];
    Table[T[n, k], {n, 0, 11}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jan 30 2018 *)
  • SageMath
    def T(n,k): # T = A026637
        if k==0 or k==n: return 1
        elif k==1 or k==n-1: return ((3*n-1)//2)
        else: return T(n-1, k) + T(n-1, k-1)
    flatten([[T(n,k) for k in range(n+1)] for n in range(16)]) # G. C. Greubel, Jun 28 2024

Formula

From G. C. Greubel, Jun 28 2024: (Start)
T(n, n-k) = T(n, k).
T(2*n-1, n-1) = A026641(n), n >= 1.
Sum_{k=0..n} T(n, k) = A026644(n).
Sum_{k=0..n} (-1)^k*T(n, k) = A000007(n). (End)

A080239 Antidiagonal sums of triangle A035317.

Original entry on oeis.org

1, 1, 2, 3, 6, 9, 15, 24, 40, 64, 104, 168, 273, 441, 714, 1155, 1870, 3025, 4895, 7920, 12816, 20736, 33552, 54288, 87841, 142129, 229970, 372099, 602070, 974169, 1576239, 2550408, 4126648, 6677056, 10803704, 17480760, 28284465, 45765225, 74049690
Offset: 1

Views

Author

Paul Barry, Feb 11 2003

Keywords

Comments

Convolution of Fibonacci sequence with sequence (1, 0, 0, 0, 1, 0, 0, 0, 1, ...).
There is an interesting relation between a(n) and the Fibonacci sequence f(n). Sqrt(a(4n-2)) = f(2n). By using this fact we can calculate the value of a(n) by the following (1),(2),(3),(4) and (5). (1) a(1) = 1. (2) If n = 2 (mod 4), then a(n) = f((n+2)/2)^2. (3) If n = 3 (mod 4), then a(n) = (f((n+5)/2)^2-2f((n+1)/2)^2-1)/3. (4) If n = 0 (mod 4), then a(n) = (f((n+4)/2)^2+f(n/2)^2-1)/3. (5) If n = 1 (mod 4), then a(n) = (2f((n+3)/2)^2-f((n-1)/2)^2+1)/3. - Hiroshi Matsui and Ryohei Miyadera, Aug 08 2006
Sequences of the form s(0)=a, s(1)=b, s(n) = s(n-1) + s(n-2) + k if n mod m = p, else s(n) = s(n-1) + s(n-2) will have a form fib(n-1)*a + fib(n)*b + P(x)*k. a(n) is the P(x) sequence for m=4...s(n) = fib(n)*a + fib(n-1)*b + a(n-4-p)*k. - Gary Detlefs, Dec 05 2010
A different formula for a(n) as a function of the Fibonacci numbers f(n) may be conjectured. The pattern is of the form a(n) = f(p)*f(p-q) - 1 if n mod 4 = 3, else f(p)*f(p-q) where p = 2,2,4,4,4,4,6,6,6,6,8,8,8,8... and q = 0,1,3,2,0,1,3,2,0,1,3,2... p(n) = 2 * A002265(n+4) = 2*(floor((n+3)/2) - floor((n+3)/4)) (see comment by Jonathan Vos Post at A002265). A general formula for sequences having period 4 with terms a,b,c,d is given in A121262 (the discrete Fourier transform, as for all periodic sequences) and is a function of t(n)= 1/4*(2*cos(n*Pi/2) + 1 + (-1)^n). r4(a,b,c,d,n) = a*t(n+3) + b*t(n+2) + c*t(n+1) + d*t(n). This same formula may be used to subtract the 1 at n mod 4 = 3. a(n) = f(p(n))*f(p(n) - r4(1,0,3,2,n)) - r4(0,0,1,0,n). - Gary Detlefs, Dec 09 2010
This sequence is the sequence B4,1 on p. 34 of "Pascal-like triangles and Fibonacci-like sequences" in the references. In this article the authors treat more general sequences that have this sequence as an example. - Hiroshi Matsui and Ryohei Miyadera, Apr 11 2014
It is easy to see that a(n) = a(n-4) + f(n), where f(n) is the Fibonacci sequence. By using this repeatedly we have for a natural number m
a(4m) =a(4) + f(4m) + f(4m-4) + ... + f(8),
a(4m+1) = a(1) + f(4m) + f(4m-4) + ... + f(5),
a(4m+2) = a(2) + f(4m) + f(4m-4) + ... + f(6) and
a(4m+3) = a(3) + f(4m) + f(4m-4) + ... + f(7).
- Wataru Takeshita and Ryohei Miyadera, Apr 11 2014
a(n-1) counts partially ordered partitions of (n-1) into (1,2,3,4) where the position (order) of 2's is unimportant. E.g., a(5)=6 (n-1)=4 These are (4),(31),(13),(22),(211,121,112=one),(1111). - David Neil McGrath, May 12 2015

Crossrefs

Programs

  • GAP
    List([1..40], n-> Sum([0..Int((n-1)/4)], k-> Fibonacci(n-4*k) )); # G. C. Greubel, Jul 13 2019
  • Haskell
    a080239 n = a080239_list !! (n-1)
    a080239_list = 1 : 1 : zipWith (+)
       (tail a011765_list) (zipWith (+) a080239_list $ tail a080239_list)
    -- Reinhard Zumkeller, Jan 06 2012
    
  • Magma
    I:=[1,1,2,3,6,9]; [n le 6 select I[n] else Self(n-1)+Self(n-2)+Self(n-4)-Self(n-5)-Self(n-6): n in [1..50]]; // Vincenzo Librandi, Jun 07 2015
    
  • Maple
    f:=proc(n) option remember; local t1; if n <= 2 then RETURN(1); fi: if n mod 4 = 1 then t1:=1 else t1:=0; fi: f(n-1)+f(n-2)+t1; end; [seq(f(n), n=1..100)]; # N. J. A. Sloane, May 25 2008
    with(combinat): f:=n-> fibonacci(n): p:=n-> 2*(floor((n+3)/2)-floor((n+3)/4)): t:=n-> 1/4*(2*cos(n*Pi/2)+1+(-1)^n): r4:=(a,b,c,d,n)-> a*t(n+3)+b*t(n+2)+c*t(n+1)+d*t(n): seq(f(p(n))*f(p(n)-r4(1,0,3,2,n))-r4(0,0,1,0,n), n = 1..33); # Gary Detlefs, Dec 09 2010
    with(combinat): a:=proc(n); add(fibonacci(n-4*k),k=0..floor((n-1)/4)) end: seq(a(n), n = 1..33); # Johannes W. Meijer, Apr 19 2012
  • Mathematica
    (*f[n] is the Fibonacci sequence and a[n] is the sequence of A080239*) f[n_]:= f[n] =f[n-1] +f[n-2]; f[1]=1; f[2]=1; a[n_]:= Which[n==1, 1, Mod[n, 4]==2, f[(n+2)/2]^2, Mod[n, 4]==3, (f[(n+5)/2]^2 - 2f[(n + 1)/2]^2 -1)/3, Mod[n, 4]==0, (f[(n+4)/2]^2 + f[n/2]^2 -1)/3, Mod[n, 4] == 1, (2f[(n+3)/2]^2 -f[(n-1)/2]^2 +1)/3] (* Hiroshi Matsui and Ryohei Miyadera, Aug 08 2006 *)
    a=0; b=0; lst={a,b}; Do[z=a+b+1; AppendTo[lst,z]; a=b; b=z; z=a+b; AppendTo[lst,z]; a=b; b=z; z=a+b; AppendTo[lst,z]; a=b; b=z; z=a+b; AppendTo[lst,z]; a=b; b=z,{n,4!}]; lst (* Vladimir Joseph Stephan Orlovsky, Feb 16 2010 *)
    (* Let f[n] be the Fibonacci sequence and a2[n] the sequence A080239 expressed by another formula discovered by Wataru Takeshita and Ryohei Miyadera *)
    f=Fibonacci; a2[n_]:= Block[{m, s}, s = Mod[n, 4]; m = (n-s)/4;
    Which[n==1, 1, n==2, 1, n==3, 2, s==0, 3 + Sum[f[4 i], {i, 2, m}], s == 1, 1 + Sum[f[4i+1], {i, 1, m}], s==2, 1 + Sum[f[4i+2], {i, 1, m}], s == 3, 2 + Sum[f[4i+3], {i, 1, m}]]]; Table[a2[n], {n, 1, 40}] (* Ryohei Miyadera, Apr 11 2014, minor update by Jean-François Alcover, Apr 29 2014 *)
    LinearRecurrence[{1, 1, 0, 1, -1, -1}, {1, 1, 2, 3, 6, 9}, 41] (* Vincenzo Librandi, Jun 07 2015 *)
  • PARI
    vector(40, n, f=fibonacci; sum(k=0,((n-1)\4), f(n-4*k))) \\ G. C. Greubel, Jul 13 2019
    
  • Sage
    [sum(fibonacci(n-4*k) for k in (0..floor((n-1)/4))) for n in (1..40)] # G. C. Greubel, Jul 13 2019
    

Formula

G.f.: x/((1-x^4)(1 - x - x^2)) = x/(1 - x - x^2 - x^4 + x^5 + x^6).
a(n) = a(n-1) + a(n-2) + a(n-4) - a(n-5) - a(n-6).
a(n) = Sum_{j=0..floor(n/2)} Sum_{k=0..floor((n-j)/2)} binomial(n-j-2k, j-2k) for n>=0.
Another recurrence is given in the Maple code.
If n mod 4 = 1 then a(n) = a(n-1) + a(n-2) + 1, else a(n)= a(n-1) + a(n-2). - Gary Detlefs, Dec 05 2010
a(4n) = A058038(n) = Fibonacci(2n+2)*Fibonacci(2n).
a(4n+1) = A081016(n) = Fibonacci(2n+2)*Fibonacci(2n+1).
a(4n+2) = A049682(n+1) = Fibonacci(2n+2)^2.
a(4n+3) = A081018(n+1) = Fibonacci(2n+2)*Fibonacci(2n+3).
a(n) = 8*a(n-4) - 8*a(n-8) + a(n-12), n>12. - Gary Detlefs, Dec 10 2010
a(n+1) = a(n) + a(n-1) + A011765(n+1). - Reinhard Zumkeller, Jan 06 2012
a(n) = Sum_{k=0..floor((n-1)/4)} Fibonacci(n-4*k). - Johannes W. Meijer, Apr 19 2012

A026642 a(n) = A026637(2*n-1, n-2).

Original entry on oeis.org

1, 7, 28, 112, 439, 1711, 6652, 25846, 100450, 390670, 1520764, 5925718, 23112931, 90239407, 352654084, 1379410438, 5400188206, 21157958962, 82959736504, 325514137048, 1278093308806, 5021436970822, 19740128055928
Offset: 2

Views

Author

Keywords

Crossrefs

Programs

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

Formula

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

A026638 a(n) = A026637(2*n, n).

Original entry on oeis.org

1, 2, 8, 26, 92, 332, 1220, 4538, 17036, 64412, 244928, 935684, 3588392, 13806704, 53271548, 206040506, 798600332, 3101109164, 12062148368, 46986821516, 183276382472, 715748620424, 2798274135368, 10951009023716, 42895901012792, 168167959150232, 659793819847040
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Magma
    [1] cat [n le 2 select 2^(2*n-1) else ((7*n-4)*Self(n-1) + 2*(2*n-1)*Self(n-2))/(2*n): n in [1..40]]; // G. C. Greubel, Jul 01 2024
    
  • Mathematica
    CoefficientList[Series[1/(2+x)+3/((2+x)*Sqrt[1-4*x])-1,{x,0,20}],x] (* Vaclav Kotesovec, Oct 21 2012 *)
  • PARI
    my(x='x+O('x^66)); Vec( 1/(2+x)+3/((2+x)*sqrt(1-4*x))-1 ) \\ Joerg Arndt, May 04 2013
    
  • SageMath
    @CachedFunction
    def a(n): # a = A026638
        if n<3: return 2^(n*(n+1)/2)
        else: return ((7*n-4)*a(n-1) + 2*(2*n-1)*a(n-2))/(2*n)
    [a(n) for n in range(41)] # G. C. Greubel, Jul 01 2024

Formula

From Vaclav Kotesovec, Oct 21 2012: (Start)
G.f.: (3 - (x+1)*sqrt(1-4*x))/((x+2)*sqrt(1-4*x)).
Recurrence: 2*n*a(n) = (7*n-4)*a(n-1) + 2*(2*n-1)*a(n-2).
a(n) ~ 2^(2*n+2)/(3*sqrt(Pi*n)) (End)

A026639 a(n) = A026637(2*n, n-1).

Original entry on oeis.org

1, 5, 20, 74, 278, 1049, 3980, 15170, 58052, 222914, 858512, 3314960, 12829070, 49748705, 193259660, 751954250, 2929965020, 11431262390, 44651369720, 174597927740, 683388447260, 2677230376490, 10496941482680, 41188078562324
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

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

Formula

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

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

A026645 a(n) = Sum_{k=0..floor(n/2)} A026637(n, k).

Original entry on oeis.org

1, 1, 3, 5, 14, 21, 55, 85, 216, 341, 848, 1365, 3340, 5461, 13191, 21845, 52208, 87381, 206968, 349525, 821514, 1398101, 3264044, 5592405, 12979006, 22369621, 51642594, 89478485, 205592744, 357913941, 818848135, 1431655765, 3262611696, 5726623061, 13003800704, 22906492245
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    T[n_, k_]:= T[n, k]= If[k==0 || k==n, 1, If[k==1 || k==n-1, Floor[(3*n- 1)/2], T[n-1,k] + T[n-1,k-1] ]];
    A026645[n_]:= Sum[T[n, k], {k, 0, Floor[n/2]}];
    Table[A026645[n], {n,0,40}] (* G. C. Greubel, Jun 29 2024 *)
  • SageMath
    @CachedFunction
    def T(n,k): # T = A026637
        if k==0 or k==n: return 1
        elif k==1 or k==n-1: return ((3*n-1)//2)
        else: return T(n-1, k) + T(n-1, k-1)
    def A026645(n): return sum(T(n,k) for k in range((n//2)+1))
    [A026645(n) for n in range(41)] # G. C. Greubel, Jun 29 2024
Showing 1-7 of 7 results.