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.

Previous Showing 21-24 of 24 results.

A343125 Triangle T(k, n) = (n+3)*(k-n) - 4, k >= 2, 1 <= n <= k-1, read by rows.

Original entry on oeis.org

0, 4, 1, 8, 6, 2, 12, 11, 8, 3, 16, 16, 14, 10, 4, 20, 21, 20, 17, 12, 5, 24, 26, 26, 24, 20, 14, 6, 28, 31, 32, 31, 28, 23, 16, 7, 32, 36, 38, 38, 36, 32, 26, 18, 8, 36, 41, 44, 45, 44, 41, 36, 29, 20, 9, 40, 46, 50, 52, 52, 50, 46, 40, 32, 22, 10
Offset: 2

Views

Author

Russell Jay Hendel, Apr 06 2021

Keywords

Comments

T(k, n) is even if k is odd.
T(k, n) = T(k, n+1) for n = k/2 - 2 if k >= 6 is even.
T(k, n) = T(k, n+2) for n = (k-1)/2 - 2 if k >= 7 is odd.
For fixed n, T(k, n) is linear in k.
The T(k, j) contribute coefficients to a closed formula for the sum of the first n+1 squares of the k-generalized Fibonacci numbers, F(k, j) = A092921(k, j). See A343138 for sums of squares of F(k, j). See the Formula section for closed formula. Although other sequences occur in coefficients in the closed formula for sums of squares, they are linear in nature. All coefficient sequences are mentioned in the arXiv link. The closed formula generalizes results of Schumacher (see References) for the cases k=3 and k=4 with a uniform proof method (see arXiv link).

Examples

			Triangle T(k, n) begins:
   k \ n|  1  2  3  4  5  6  7  8  9  10 11
  ------+----------------------------------
   2    |  0
   3    |  4  1
   4    |  8  6  2
   5    | 12 11  8  3
   6    | 16 16 14 10  4
   7    | 20 21 20 17 12  5
   8    | 24 26 26 24 20 14  6
   9    | 28 31 32 31 28 23 16  7
  10    | 32 36 38 38 36 32 26 18  8
  11    | 36 41 44 45 44 41 36 29 20  9
  12    | 40 46 50 52 52 50 46 40 32 22 10
.
The following are the closed formulas for k = 3, 4 for A(k, n) = Sum_{m=0..n} F(k, m)^2, with F(k, n) = A092921(k, n), the k-generalized Fibonacci numbers, and A(k, n) = A343138(k, n), the sum of squares of F(k, n). These formulas are derived from the closed formula in the formula section. Of course further simplifications are possible. For k = 2, T(2, 1) = 0 so illustrations start with k = 3.
k | Formula
--+--------------------------------------------------------
3 | Sum_{m=0..n} F(3,m)^2 = (1/4)*(2*F(3,n)*F(3,n+2) + 4*F(3,n+1)*F(3,n+2) - (k - 2)*F(3,n)^2 - T(3,1)*F(3,n+1)^2 - T(3,2)*F(3,n+2)^2 + 1).
4 | Sum_{m=0..n} F(3,m)^2 = (1/6)*(-2*F(4,n)*F(4,n+1) + 2*F(4,n)*F(4,n+3) + 4*F(4,n+1)*F(4,n+3) + 6*F(4,n+2)*F(4,n+3) - (k-2)*F(4,n)^2 - T(4,1)*F(4,n+1)^2 - T(4, 2)*F(4,n+2)^2 - T(4,3)*F(4,n+3)^2 + 2).
		

References

  • Raphael Schumacher, How to Sum the Squares of the Tetranacci Numbers and the Fibonacci m-step Numbers, Fibonacci Quarterly, 57, (2019), 168-175.
  • Raphael Schumacher, Explicit Formulas for Sums Involving the Squares of the First n Tribonacci Numbers, Fibonacci Quarterly, 58 (2020), 194-202.

Crossrefs

Programs

  • Maple
    T := (k, n) -> (n + 3)*(k - n) - 4:
    seq(print(seq(T(k, n), n=1..k-1)), k = 2..12); # Peter Luschny, Apr 02 2021
  • Mathematica
    Table[(n + 3) (k - n) - 4, {k, 2, 12}, {n, k - 1}] // Flatten (* Michael De Vlieger, Apr 06 2021 *)
  • PARI
    T(k,n)=(n + 3)*(k - n) - 4
    for(k = 2,12,for(n = 1,k - 1, print1(T(k,n),", ")))
    
  • Sage
    flatten([[(n+3)*(k-n) -4 for n in (1..k-1)] for k in (2..15)]) # G. C. Greubel, Nov 22 2021

Formula

Let F(k, n) = A092921(k, n), the k-generalized Fibonacci numbers. Let A(k, n) = A343138(k, n) = Sum_{m=0..n} F(k, m)^2, the sum of the first m+1 k-generalized Fibonacci numbers. Then, for k >= 2, a closed formula for A(k, n) is:
A(k, n) = (1/(2*k-2)) * (Sum_{j=0..k-2, m=j+1..k-1} 2*(j+1)*(m-k+1) * F(k, n+j) * F(k, n+m)) - (k-2)*F(k, n)^2 - Sum_{j=1..k}(T(k, j) * F(k, n+j)^2) + (k-2)).
From G. C. Greubel, Nov 22 2021: (Start)
T(2*n-2, n) = A028557(n-2), n >= 2.
T(4*n-6, n) = 2*A140672(n-2), n >= 2. (End)

A349903 Array read by ascending antidiagonals. Inverse Euler transform of the right-shifted k-bonacci numbers.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 0, 1, 1, -1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 2, -1, 0, 0, 0, 0, 1, 2, 2, 0, 0, 0, 0, 0, 0, 1, 3, 4, 0, 0, 0, 0, 0, 0, 1, 2, 6, 5, 0, 0, 0, 0, 0, 0, 0, 1, 4, 10, 8, 0, 0, 0, 0, 0, 0, 0, 1, 2, 7, 18, 11, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 14, 31, 18, 0, 0
Offset: 0

Views

Author

Peter Luschny, Dec 05 2021

Keywords

Examples

			Array starts:
[0] 0, 1, 0, -1, 0,  0, 0,  0,  0,  0,  0,  0,   0, ...
[1] 0, 1, 1,  0, 0, -1, 0,  0,  0,  0,  0,  0,   0, ...
[2] 0, 1, 1,  1, 2,  2, 4,  5,  8, 11, 18, 25,  40, ...
[3] 0, 0, 1,  1, 2,  3, 6, 10, 18, 31, 56, 96, 172, ...
[4] 0, 0, 0,  1, 1,  2, 4,  7, 14, 26, 50, 93, 178, ...
[5] 0, 0, 0,  0, 1,  1, 2,  4,  8, 15, 30, 58, 114, ...
[6] 0, 0, 0,  0, 0,  1, 1,  2,  4,  8, 16, 31,  62, ...
[7] 0, 0, 0,  0, 0,  0, 1,  1,  2,  4,  8, 16,  32, ...
[8] 0, 0, 0,  0, 0,  0, 0,  1,  1,  2,  4,  8,  16, ...
[9] 0, 0, 0,  0, 0,  0, 0,  0,  1,  1,  2,  4,   8, ...
.
Compare the rows with the columns of A349802.
		

Crossrefs

Rows are the inverse Euler transforms of A063524, A057427, A000045, A000073, A000078, A001591, A001592.

Programs

  • Maple
    read transforms;
    F := proc(n, k) option remember;
         ifelse(k < 2, k, add(F(n, k-j), j = 1..min(n, k))) end:
    Frow := (n, len) -> [seq(0, j = 0..n-3), seq(F(n, k), k = 0..len)]:
    Arow := (n, len) -> EULERi(Frow(n, len)):
    for n from 0 to 9 do Arow(n, 14 - n) od;

A277828 Least number of tosses of a fair coin needed to have an even chance or better of getting a run of at least m consecutive heads or consecutive tails.

Original entry on oeis.org

1, 2, 5, 11, 23, 45, 90, 179, 357, 712, 1422, 2842, 5681, 11360, 22716, 45430, 90856, 181709, 363413, 726822, 1453640, 2907276, 5814546, 11629086, 23258166, 46516327, 93032647
Offset: 1

Views

Author

Tim Miles, Nov 01 2016

Keywords

Comments

There are a family of sequences that represent the number of sequences of tosses of a fair coin to n tosses where there are no runs of m or more consecutive heads or consecutive tails. Some are given in this Encyclopedia. Their general form is given as part of the formula below. As n increases, the proportion of sequences of tosses that meet this condition decreases. When that proportion becomes a half or less of the total number of sequences of tosses, there is an even or better chance that a run of m consecutive heads or m consecutive tails occurs.
There is actually a family of sequences of which the above sequence is an instance: those in which, for successive values of m, r*g(n) <= 2^n for r > 1.
a(n) - ceiling((log 2)*2^n + (1-log 2)*n + (log 2)/2-2) equals 0 or (almost never) 1 for all n. Obtained using Weisstein's exact formula for Fibonacci k-step number seeing that the function g(N) described in the Formula section is 2*A092921(n-1,N+1). - Andrey Zabolotskiy, Nov 01 2016

References

  • Marcus du Sautoy, The Number Mysteries, Fourth Estate, 2011, pages 126 - 127.

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local l, j; Digits:= 50;
          if n<3 then n else l:= 0$n;
            for j from 0 while l[n]<1/2 do l:= seq(
              (`if`(i=1, 1.0, l[i-1])+l[n-1])/2, i=1..n)
            od; j
          fi
        end:
    seq(a(n), n=1..16);  # Alois P. Heinz, Nov 01 2016
  • Mathematica
    a[n_] := a[n] = Module[{l, j}, If[n < 3, n, l = Table[0, {n}]; For[j = 0, l[[n]] < 1/2, j++, l = Table[(If[i == 1, 1, l[[i - 1]]] + l[[n - 1]])/2, {i, n}]]; j]];
    Array[a, 16] (* Jean-François Alcover, May 31 2019, after Alois P. Heinz *)
  • PARI
    step(v)=my(n=#v); concat([sum(i=1,n-1,v[i])], concat(vector(n-2,i, v[i]), 2*v[n]+v[n-1]))
    a(n)=if(n<3, return(n)); my(v=vector(n), flips=1, needed=1/2); v[1]=1; while(v[n]Charles R Greathouse IV, Nov 02 2016
    
  • PARI
    a(n)=if(n<3, return(n)); my(M=2^(n-1),v=powers(2,n-1)[2..n],i=1,m=n); while(1, v[i]=vecsum(v); if(v[i]<=M, return(m)); if(i++>#v, i=1); M*=2; m++) \\ Charles R Greathouse IV, Nov 02 2016
  • Python
    def a(m):
        if m == 1:
            return 1
        g = [2**i for i in range(1, m)]
        sg, lim, n = sum(g), 2**(m-1), m
        while True:
            g.append(sg)
            sg <<= 1
            sg -= g.pop(0)
            if g[-1] <= lim:
                return n
            lim <<= 1
            n += 1
    print([a(i) for i in range(1, 15)])
    # Andrey Zabolotskiy, Nov 01 2016
    

Formula

For successive integers m, where g(n) is the number of sequences of tosses of a fair coin with runs of fewer than m consecutive heads or tails out of all possible sequences of tosses to n tosses, g(n) = 2^n where n <= m-1, and thereafter g(n) = g(n-1) + g(n-2) + ... + g(n-m+1) and a(m) = the least value of n for which 2g(n) <= 2^n.

Extensions

a(11)-a(22) from Andrey Zabolotskiy, Nov 01 2016
a(23)-a(27) from Alois P. Heinz, Nov 02 2016

A364145 a(n) is the sum of the first 2*n nonzero n-bonacci numbers.

Original entry on oeis.org

0, 2, 7, 28, 116, 480, 1968, 8000, 32320, 130048, 521984, 2092032, 8377344, 33529856, 134164480, 536756224, 2147237888, 8589410304, 34358624256, 137436594176, 549750833152, 2199012769792, 8796071002112, 35184325951488, 140737391886336, 562949752094720
Offset: 0

Views

Author

Muhammad Adam Dombrowski and Greg Dresden, Jul 10 2023

Keywords

Comments

For our purposes, for n > 0 fixed we define the k-th n-bonacci number T(n,k) as equal to 0 for k <= 0, equal to 1 for k=1, and then equal to the sum of the previous n numbers for k > 1. For n=2, then, we get T(2,k) equal to F(n) = A000045(n), the Fibonacci numbers. For n=3, then, T(3,k) is the tribonacci numbers, and so on.
a(n) is thus defined as Sum_{k=1..2*n} T(n,k).

Examples

			For n=3, a(3) is the sum of the first 6 nonzero tribonacci numbers, found at A000073. This gives a(3) = 1 + 1 + 2 + 4 + 7 + 13 = 28.
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := SeriesCoefficient[Series[x/(1 - Sum[x^i, {i, 1, n}]), {x, 0, k + 1}], k]; Table[Sum[T[n, k], {k, 1, 2n}], {n, 1, 30}]

Formula

a(n) = (2*4^n - (n-1)*2^n)/4 for n>=1.
a(n) = Sum_{i=1..2*n} A092921(n,i).
G.f.: -x*(12*x^2-9*x+2)/((4*x-1)*(2*x-1)^2). - Alois P. Heinz, Jul 11 2023
E.g.f.: exp(2*x)*(1 - 2*x - cosh(2*x) + 5*sinh(2*x))/4. - Stefano Spezia, Jul 12 2023
Previous Showing 21-24 of 24 results.