A209972
Number of binary words of length n avoiding the subword given by the binary expansion of k; square array A(n,k), n>=0, k>=0, read by antidiagonals.
Original entry on oeis.org
1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 3, 1, 1, 1, 2, 3, 4, 1, 1, 1, 2, 4, 5, 5, 1, 1, 1, 2, 4, 7, 8, 6, 1, 1, 1, 2, 4, 7, 12, 13, 7, 1, 1, 1, 2, 4, 7, 12, 20, 21, 8, 1, 1, 1, 2, 4, 7, 12, 21, 33, 34, 9, 1, 1, 1, 2, 4, 8, 13, 20, 37, 54, 55, 10, 1, 1, 1, 2, 4, 8, 15, 24, 33, 65, 88, 89, 11, 1, 1
Offset: 0
Square array begins:
1, 1, 1, 1, 1, 1, 1, 1, 1, ...
1, 1, 2, 2, 2, 2, 2, 2, 2, ...
1, 1, 3, 3, 4, 4, 4, 4, 4, ...
1, 1, 4, 5, 7, 7, 7, 7, 8, ...
1, 1, 5, 8, 12, 12, 12, 13, 15, ...
1, 1, 6, 13, 20, 21, 20, 24, 28, ...
1, 1, 7, 21, 33, 37, 33, 44, 52, ...
1, 1, 8, 34, 54, 65, 54, 81, 96, ...
1, 1, 9, 55, 88, 114, 88, 149, 177, ...
Columns give: 0, 1:
A000012, 2:
A001477(n+1), 3:
A000045(n+2), 4, 6:
A000071(n+3), 5:
A005251(n+3), 7:
A000073(n+3), 8, 12, 14:
A008937(n+1), 9, 11, 13:
A049864(n+2), 10:
A118870, 15:
A000078(n+4), 16, 20, 24, 26, 28, 30:
A107066, 17, 19, 23, 25, 29:
A210003, 18, 22:
A209888, 21:
A152718(n+3), 27:
A210021, 31:
A001591(n+5), 32:
A001949(n+5), 33, 35, 37, 39, 41, 43, 47, 49, 53, 57, 61:
A210031.
-
A[n_, k_] := Module[{bb, cnt = 0}, Do[bb = PadLeft[IntegerDigits[j, 2], n]; If[SequencePosition[bb, IntegerDigits[k, 2], 1]=={}, cnt++], {j, 0, 2^n-1 }]; cnt];
Table[A[n-k, k], {n, 0, 12}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Nov 01 2021 *)
A126198
Triangle read by rows: T(n,k) (1 <= k <= n) = number of compositions of n into parts of size <= k.
Original entry on oeis.org
1, 1, 2, 1, 3, 4, 1, 5, 7, 8, 1, 8, 13, 15, 16, 1, 13, 24, 29, 31, 32, 1, 21, 44, 56, 61, 63, 64, 1, 34, 81, 108, 120, 125, 127, 128, 1, 55, 149, 208, 236, 248, 253, 255, 256, 1, 89, 274, 401, 464, 492, 504, 509, 511, 512, 1, 144, 504, 773, 912, 976, 1004, 1016, 1021, 1023, 1024
Offset: 1
Triangle begins:
1;
1, 2;
1, 3, 4;
1, 5, 7, 8;
1, 8, 13, 15, 16;
1, 13, 24, 29, 31, 32;
1, 21, 44, 56, 61, 63, 64;
Could also be extended to a square array:
1 1 1 1 1 1 1 ...
1 2 2 2 2 2 2 ...
1 3 4 4 4 4 4 ...
1 5 7 8 8 8 8 ...
1 8 13 15 16 16 16 ...
1 13 24 29 31 32 32 ...
1 21 44 56 61 63 64 ...
which when read by antidiagonals (downwards) gives A048887.
- J. Riordan, An Introduction to Combinatorial Analysis, Wiley, 1958, pp. 154-155.
2nd column = Fibonacci numbers, next two columns are
A000073,
A000078; last three diagonals are 2^n, 2^n-1, 2^n-3.
-
A126198 := proc(n,k) coeftayl( x*(1-x^k)/(1-2*x+x^(k+1)),x=0,n); end: for n from 1 to 11 do for k from 1 to n do printf("%d, ",A126198(n,k)); od; od; # R. J. Mathar, Mar 09 2007
# second Maple program:
T:= proc(n, k) option remember;
if n=0 or k=1 then 1
else add(T(n-j, k), j=1..min(n, k))
fi
end:
seq(seq(T(n, k), k=1..n), n=1..15); # Alois P. Heinz, Oct 23 2011
-
rows = 11; t[n_, k_] := Sum[ (-1)^i*2^(n-i*(k+1))*Binomial[ n-i*k, i], {i, 0, Floor[n/(k+1)]}] - Sum[ (-1)^i*2^((-i)*(k+1)+n-1)*Binomial[ n-i*k-1, i], {i, 0, Floor[(n-1)/(k+1)]}]; Flatten[ Table[ t[n, k], {n, 1, rows}, {k, 1, n}]](* Jean-François Alcover, Nov 17 2011, after Max Alekseyev *)
A189161
T(n,k)=Number of nXk binary arrays without the pattern 0 0 1 1 diagonally, vertically or horizontally.
Original entry on oeis.org
2, 4, 4, 8, 16, 8, 15, 64, 64, 15, 28, 225, 512, 225, 28, 52, 784, 3375, 3375, 784, 52, 96, 2704, 21952, 37976, 21952, 2704, 96, 177, 9216, 140608, 424401, 424401, 140608, 9216, 177, 326, 31329, 884736, 4597967, 8210464, 4597967, 884736, 31329, 326, 600
Offset: 1
Some solutions for 6X4
..0..0..0..0....0..0..0..0....0..0..0..0....0..0..0..0....0..0..0..0
..1..0..1..0....1..0..1..0....1..0..0..0....0..1..1..1....1..0..1..0
..1..0..1..0....1..0..1..0....0..1..0..1....0..0..1..0....0..0..0..0
..1..0..0..0....0..1..1..0....1..0..1..0....0..1..0..0....1..0..0..1
..0..0..1..0....0..0..1..0....0..0..0..0....0..0..1..0....0..1..0..0
..1..1..0..1....0..1..0..1....0..0..0..0....0..0..0..0....1..0..1..0
Column 2 is column 1 squared
Column 3 is column 1 cubed
A352105
Numbers whose maximal tribonacci representation (A352103) is palindromic.
Original entry on oeis.org
0, 1, 3, 5, 7, 8, 14, 18, 23, 27, 36, 40, 51, 52, 62, 69, 78, 88, 95, 102, 110, 130, 148, 156, 176, 181, 194, 211, 229, 242, 246, 264, 277, 294, 312, 325, 326, 363, 397, 411, 448, 463, 477, 514, 548, 562, 599, 617, 650, 674, 682, 715, 739, 770, 803, 827, 838, 862
Offset: 1
The first 10 terms are:
n a(n) A352103(a(n))
-- ---- -------------
1 0 0
2 1 1
3 3 11
4 5 101
5 7 111
6 8 1001
7 14 1111
8 18 10101
9 23 11011
10 27 11111
-
t[1] = 1; t[2] = 2; t[3] = 4; t[n_] := t[n] = t[n - 1] + t[n - 2] + t[n - 3]; trib[n_] := Module[{s = {}, m = n, k}, While[m > 0, k = 1; While[t[k] <= m, k++]; k--; AppendTo[s, k]; m -= t[k]; k = 1]; IntegerDigits[Total[2^(s - 1)], 2]]; q[n_] := Module[{v = trib[n]}, nv = Length[v]; i = 1; While[i <= nv - 3, If[v[[i ;; i + 3]] == {1, 0, 0, 0}, v[[i ;; i + 3]] = {0, 1, 1, 1}; If[i > 3, i -= 4]]; i++]; i = Position[v, _?(# > 0 &)]; If[i == {}, True, PalindromeQ[FromDigits[v[[i[[1, 1]] ;; -1]]]]]]; Select[Range[0, 1000], q]
A027084
G.f.: x^2*(x^2 + x + 1)/(x^4 - 2*x + 1).
Original entry on oeis.org
1, 3, 7, 14, 27, 51, 95, 176, 325, 599, 1103, 2030, 3735, 6871, 12639, 23248, 42761, 78651, 144663, 266078, 489395, 900139, 1655615, 3045152, 5600909, 10301679, 18947743, 34850334, 64099759, 117897839, 216847935, 398845536
Offset: 2
- Hamoon Mousavi, Jeffrey Shallit, Mechanical Proofs of Properties of the Tribonacci Word, arXiv:1407.5841 [cs.FL], 2014.
- Bo Tan and Zhi-Ying Wen, Some properties of the Tribonacci sequence, European Journal of Combinatorics, 28 (2007) 1703-1719. See Prop. 2.9, |D_n|.
- Index entries for linear recurrences with constant coefficients, signature (2, 0, 0, -1).
A055216
Triangle T(n,k) by rows, n >= 0, 0<=k<=n: T(n,k) = Sum_{i=0..n-k} binomial(n-k,i) *Sum_{j=0..k-i} binomial(i,j).
Original entry on oeis.org
1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 3, 1, 1, 5, 10, 8, 3, 1, 1, 6, 15, 17, 9, 3, 1, 1, 7, 21, 31, 23, 9, 3, 1, 1, 8, 28, 51, 50, 26, 9, 3, 1, 1, 9, 36, 78, 96, 66, 27, 9, 3, 1, 1, 10, 45, 113, 168, 147, 76, 27, 9, 3, 1, 1, 11, 55, 157, 274, 294, 192, 80, 27, 9, 3, 1
Offset: 0
8=T(5,2) counts these strings: 013, 023, 113, 123, 133, 223, 233, 333.
Rows:
1;
1,1;
1,2,1;
1,3,3,1;
1,4,6,3,1;
...
- D. S. Hirschberg, Algorithms for the longest subsequence problem, J. ACM, 24 (1977), 664-675.
- C. Kimberling, Path-counting and Fibonacci numbers, Fib. Quart. 40 (4) (2002) 328-338, Example 1E.
- V. I. Levenshtein, Efficient reconstruction of sequences from their subsequences or supersequences, J. Combin. Theory Ser. A 93 (2001), no. 2, 310-332.
-
A055216 := proc(n,k)
a := 0 ;
for i from 0 to n-k do
a := a+binomial(n-k,i)*add(binomial(i,j),j=0..k-i) ;
end do:
a ;
end proc: # R. J. Mathar, Mar 13 2013
-
T[n_, k_] := Sum[Binomial[n - k, i]*Sum[Binomial[i, j], {j, 0, k - i}], {i, 0, n - k}];
Table[T[n, k], {n, 0, 11}, {k, 0, n}] // Flatten (* Jean-François Alcover, Oct 28 2019 *)
A113300
Sum of even-indexed terms of tribonacci numbers.
Original entry on oeis.org
0, 1, 3, 10, 34, 115, 389, 1316, 4452, 15061, 50951, 172366, 583110, 1972647, 6673417, 22576008, 76374088, 258371689, 874065163, 2956941266, 10003260650, 33840788379, 114482567053, 387291750188, 1310198605996, 4432370135229, 14994600761871, 50726371026838
Offset: 0
-
I:=[0,1,3]; [n le 3 select I[n] else 3*Self(n-1) +Self(n-2) +Self(n-3): n in [1..61]]; // G. C. Greubel, Nov 19 2021
-
Accumulate[Take[LinearRecurrence[{1,1,1},{0,0,1},60],{1,-1,2}]] (* Harvey P. Dale, Nov 06 2011 *)
LinearRecurrence[{3,1,1},{0,1,3},40] (* Vladimir Joseph Stephan Orlovsky, Jan 31 2012 *)
a[ n_] := Sum[ SeriesCoefficient[ SeriesCoefficient[ x / (1 - x - y - x y) , {x, 0, n - k}]^2 , {y, 0, k}], {k, 0, n}]; (* Michael Somos, Jun 27 2017 *)
-
@CachedFunction
def T(n): # T(n) = A000073(n)
if (n<2): return 0
elif (n==2): return 1
else: return T(n-1) +T(n-2) +T(n-3)
def a(n): return sum( T(2*j) for j in (0..n) )
[a(n) for n in (0..60)] # G. C. Greubel, Nov 19 2021
Original entry on oeis.org
1, 2, 4, 8, 16, 32, 64, 127, 252, 500, 992, 1968, 3904, 7744, 15361, 30470, 60440, 119888, 237808, 471712, 935680, 1855999, 3681528, 7302616, 14485344, 28732880, 56994048, 113052416, 224248833, 444816138, 882329660
Offset: 0
a(3) = binomial(3,3)*2^3 = 8.
a(7) = binomial(7,7)*2^7 - binomial(1,0)*2^0 = 127.
- O. Dunkel, Solutions of a probability difference equation, Amer. Math. Monthly, 32 (1925), 354-370; see p. 356 with r = 6.
- Index entries for linear recurrences with constant coefficients, signature (2,0,0,0,0,0,-1)
-
for k from 0 to 20 do for n from 0 to 30 do b(n):=sum((-1)^j*binomial(n-k*j,n-(k+1)*j)*2^(n-(k+1)*j),j=0..floor(n/(k+1))):od:k: seq(b(n),n=0..30):od; k:=6:taylor(1/(1-2*z+z^(k+1)),z=0,30);
Original entry on oeis.org
1, 2, 4, 8, 16, 32, 64, 128, 255, 508, 1012, 2016, 4016, 8000, 15936, 31744, 63233, 125958, 250904, 499792, 995568, 1983136, 3950336, 7868928, 15674623, 31223288, 62195672, 123891552, 246787536, 491591936, 979233536
Offset: 0
a(4) = binomial(4,4)*2^4 = 16.
a(9) = binomial(9,9)*2^9 - binomial(2,1)*2^1 = 512 - 4 = 508.
-
k:=7:taylor(1/(1-2*z+z^(k+1)),z=0,30); for k from 0 to 20 do for n from 0 to 30 do b(n):=sum((-1)^j*binomial(n-k*j,n-(k+1)*j)*2^(n-(k+1)*j),j=0..floor(n/(k+1))):od:k: seq(b(n),n=0..30):od;
A018921
Define the generalized Pisot sequence T(a(0),a(1)) by: a(n+2) is the greatest integer such that a(n+2)/a(n+1) < a(n+1)/a(n). This is T(4,8).
Original entry on oeis.org
4, 8, 15, 28, 52, 96, 177, 326, 600, 1104, 2031, 3736, 6872, 12640, 23249, 42762, 78652, 144664, 266079, 489396, 900140, 1655616, 3045153, 5600910, 10301680, 18947744, 34850335, 64099760, 117897840, 216847936, 398845537, 733591314, 1349284788, 2481721640
Offset: 0
- Colin Barker, Table of n, a(n) for n = 0..1000
- D. W. Boyd, Linear recurrence relations for some generalized Pisot sequences, Advances in Number Theory ( Kingston ON, 1991) 333-340, Oxford Sci. Publ., Oxford Univ. Press, New York, 1993
- Index entries for linear recurrences with constant coefficients, signature (2,0,0,-1).
- Index entries for Pisot sequences
-
Tiv:=[4,8]; [n le 2 select Tiv[n] else Ceiling(Self(n-1)^2/Self(n-2))-1: n in [1..40]]; // Bruno Berselli, Feb 17 2016
-
RecurrenceTable[{a[1] == 4, a[2] == 8, a[n] == Ceiling[a[n-1]^2/a[n-2]] - 1}, a, {n, 40}] (* Bruno Berselli, Feb 17 2016 *)
LinearRecurrence[{2,0,0,-1},{4,8,15,28},40] (* Harvey P. Dale, Mar 05 2019 *)
-
Vec((4-x^2-2*x^3)/((1-x)*(1-x-x^2-x^3)) + O(x^40)) \\ Colin Barker, Feb 13 2016
-
T(a0, a1, maxn) = a=vector(maxn); a[1]=a0; a[2]=a1; for(n=3, maxn, a[n]=ceil(a[n-1]^2/a[n-2])-1); a
T(4, 8, 30) \\ Colin Barker, Feb 14 2016
Comments moved to formula, and typo in data fixed by
Colin Barker, Feb 13 2016
Comments