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 11-17 of 17 results.

A228347 Triangle of regions and compositions of the positive integers (see Comments lines for definition).

Original entry on oeis.org

1, 1, 2, 0, 0, 1, 1, 1, 2, 3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Omar E. Pol, Aug 26 2013

Keywords

Comments

Triangle read by rows in which row n lists A129760(n) zeros followed by the A006519(n) elements of the row A001511(n) of triangle A090996, n >= 1.
The equivalent sequence for partitions is A186114.

Examples

			----------------------------------------------------------
.             Diagram                Triangle
Compositions    of            of compositions (rows)
of 5          regions          and regions (columns)
----------------------------------------------------------
.            _ _ _ _ _
5           |_        |                                 5
1+4         |_|_      |                               1 4
2+3         |_  |     |                             2 0 3
1+1+3       |_|_|_    |                           1 1 0 3
3+2         |_    |   |                         3 0 0 0 2
1+2+2       |_|_  |   |                       1 2 0 0 0 2
2+1+2       |_  | |   |                     2 0 1 0 0 0 2
1+1+1+2     |_|_|_|_  |                   1 1 0 1 0 0 0 2
4+1         |_      | |                 4 0 0 0 0 0 0 0 1
1+3+1       |_|_    | |               1 3 0 0 0 0 0 0 0 1
2+2+1       |_  |   | |             2 0 2 0 0 0 0 0 0 0 1
1+1+2+1     |_|_|_  | |           1 1 0 2 0 0 0 0 0 0 0 1
3+1+1       |_    | | |         3 0 0 0 1 0 0 0 0 0 0 0 1
1+2+1+1     |_|_  | | |       1 2 0 0 0 1 0 0 0 0 0 0 0 1
2+1+1+1     |_  | | | |     2 0 1 0 0 0 1 0 0 0 0 0 0 0 1
1+1+1+1+1   |_|_|_|_|_|   1 1 0 1 0 0 0 1 0 0 0 0 0 0 0 1
.
For the positive integer k consider the first 2^(k-1) rows of triangle, as shown below. The positive terms of the n-th row are the parts of the n-th region of the diagram of regions of the set of compositions of k. The positive terms of the n-th column are the parts of the n-th composition of k, with compositions in colexicographic order.
Triangle begins:
1;
1,2;
0,0,1;
1,1,2,3;
0,0,0,0,1;
0,0,0,0,1,2;
0,0,0,0,0,0,1;
1,1,1,1,2,2,3,4;
0,0,0,0,0,0,0,0,1;
0,0,0,0,0,0,0,0,1,2;
0,0,0,0,0,0,0,0,0,0,1;
0,0,0,0,0,0,0,0,1,1,2,3;
0,0,0,0,0,0,0,0,0,0,0,0,1;
0,0,0,0,0,0,0,0,0,0,0,0,1,2;
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1;
1,1,1,1,1,1,1,1,2,2,2,2,3,3,4,5;
...
		

Crossrefs

Mirror of A228348. Column 1 is A036987. Also column 1 gives A209229, n >= 1. Right border gives A001511. Positive terms give A228349.

A279210 Length of second run of 1's in binary expansion of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 2, 0, 1, 0, 0, 0, 1, 1, 2, 1, 1, 2, 3, 0, 1, 1, 2, 0, 1, 0, 0, 0, 1, 1, 2, 1, 1, 2, 3, 1, 1, 1, 1, 2, 2, 3, 4, 0, 1, 1, 2, 1, 1, 2, 3, 0, 1, 1, 2, 0, 1, 0, 0, 0, 1, 1, 2, 1, 1, 2, 3, 1, 1, 1, 1, 2, 2, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 5, 0, 1, 1, 2, 1
Offset: 0

Views

Author

N. J. A. Sloane, Dec 22 2016

Keywords

Examples

			46 = 101110_2 so a(46) = 3.
		

Crossrefs

Programs

  • Mathematica
    Table[First[Map[Length, Rest@ DeleteCases[#, w_ /; First@ w == 0] &@ Split@ IntegerDigits[n, 2]] /. {} -> {0}], {n, 100}] (* Michael De Vlieger, Dec 23 2016 *)

Formula

a(2*n) = a(n). - David A. Corneth, Oct 12 2018

Extensions

More terms from Michael De Vlieger, Dec 23 2016

A373183 Irregular table T(n, k), n >= 0, k > 0, read by rows with row polynomials R(n, x) such that R(2n+1, x) = x*R(n, x) for n >= 0, R(2n, x) = x*(R(n, x+1) - R(n, x)) for n > 0 with R(0, x) = x.

Original entry on oeis.org

1, 0, 1, 1, 2, 0, 0, 1, 3, 4, 0, 1, 2, 1, 3, 3, 0, 0, 0, 1, 7, 8, 0, 3, 4, 3, 8, 6, 0, 0, 1, 2, 7, 15, 9, 0, 1, 3, 3, 1, 4, 6, 4, 0, 0, 0, 0, 1, 15, 16, 0, 7, 8, 7, 18, 12, 0, 0, 3, 4, 17, 34, 18, 0, 3, 8, 6, 3, 11, 15, 8, 0, 0, 0, 1, 2, 31, 57, 27, 0, 7, 15
Offset: 0

Views

Author

Mikhail Kurkov, May 27 2024

Keywords

Comments

Row n length is A000120(n) + 1.

Examples

			Irregular table begins:
  1;
  0,  1;
  1,  2;
  0,  0, 1;
  3,  4;
  0,  1, 2;
  1,  3, 3;
  0,  0, 0, 1;
  7,  8;
  0,  3, 4;
  3,  8, 6
  0,  0, 1, 2
  7, 15, 9;
  0,  1, 3, 3;
  1,  4, 6, 4;
  0,  0, 0, 0, 1;
		

Crossrefs

Programs

  • PARI
    row(n) = my(x = 'x, A = x); forstep(i=if(n == 0, -1, logint(n, 2)), 0, -1, A = if(bittest(n, i), x*A, x*(subst(A, x, x+1) - A))); Vecrev(A/x)

Formula

Conjectured formulas: (Start)
R(2n, x) = R(n, x) + R(n - 2^f(n), x) + R(2n - 2^f(n), x) where f(n) = A007814(n) (see A329369).
b(2^m*n + q) = Sum_{i=A001511(n+1)..A000120(n)+1} T(n, i)*b(2^m*(2^(i-1)-1) + q) for n >= 0, m >= 0, q >= 0 where b(n) = A329369(n). Note that this formula is recursive for n != 2^k - 1.
R(n, x) = c(n, x)
where c(2^k - 1, x) = x^(k+1) for k >= 0,
c(n, x) = Sum_{i=0..s(n)} p(n, s(n)-i)*Sum_{j=0..i} (s(n)-j+1)^A279209(n)*binomial(i, j)*(-1)^j,
p(n, k) = Sum_{i=0..k} c(t(n) + (2^i - 1)*A062383(t(n)), x)*L(s(n), k, i) for 0 <= k < s(n) with p(n, s(n)) = c(t(n) + (2^s(n) - 1)*A062383(t(n)), x),
s(n) = A090996(n), t(n) = A087734(n),
L(n, k, m) are some integer coefficients defined for n > 0, 0 <= k < n, 0 <= m <= k that can be represented as W(n-m, k-m, m+1)
and where W(n, k, m) = (k+m)*W(n-1, k, m) + (n-k)*W(n-1, k-1, m) + [m > 1]*W(n, k, m-1) for 0 <= k < n, m > 0 with W(0, 0, m) = 1, W(n, k, m) = 0 for n < 0 or k < 0.
In particular, W(n, k, 1) = A173018(n, k), W(n, k, 2) = A062253(n, k), W(n, k, 3) = A062254(n, k) and W(n, k, 4) = A062255(n, k).
Here s(n), t(n) and A279209(n) are unique integer sequences such that n can be represented as t(n) + (2^s(n) - 1)*A062383(t(n))*2^A279209(n) where t(n) is minimal. (End)
Conjectures from Mikhail Kurkov, Jun 19 2024: (Start)
T(n, k) = d(n, 1, A000120(n) - k + 2) where d(n, m, k) = (m+1)^g(n)*d(h(n), m+1, k) - m^(g(n)+1)*d(h(n), m, k-1) for n > 0, m > 0, k > 0 with d(n, m, 0) = 0 for n >= 0, m > 0, d(0, m, k) = [k <= m]*abs(Stirling1(m, m-k+1)) for m > 0, k > 0, g(n) = A290255(n) and where h(n) = A053645(n). In particular, d(n, 1, 1) = A341392(n).
Sum_{i=A001511(n+1)..wt(n)+k} d(n, k, wt(n)-i+k+1)*A329369(2^m*(2^(i-1)-1) + q) = k!*A357990(2^m*n + q, k) for n >= 0, k > 0, m >= 0, q >= 0 where wt(n) = A000120(n).
If we change R(0, x) to Product_{i=0..m-1} (x+i), then for resulting irregular table U(n, k, m) we have U(n, k, m) = d(n, m, A000120(n) - k + m + 1).
T(n, k) = (-1)^(wt(n)-k+1)*Sum_{i=1..wt(n)-k+3} Stirling1(wt(n)-i+3, k+1)*A358612(n, wt(n)-i+3) for n >= 0, k > 0 where wt(n) = A000120(n). (End)
Conjecture: T(2^m*(2k+1), q) = (-1)^(wt(k)-q)*Sum_{i=q..wt(k)+2} Stirling1(i,q)*A358612(k,i)*i^m for m >= 0, k >= 0, q > 0 where wt(n) = A000120(n). - Mikhail Kurkov, Jan 17 2025

A336963 Left-rotate run-lengths of consecutive equal digits in binary representation of n.

Original entry on oeis.org

0, 1, 2, 3, 6, 5, 4, 7, 14, 13, 10, 9, 12, 11, 8, 15, 30, 29, 26, 25, 22, 21, 18, 17, 28, 27, 20, 19, 24, 23, 16, 31, 62, 61, 58, 57, 54, 53, 50, 49, 46, 45, 42, 41, 38, 37, 34, 33, 60, 59, 52, 51, 44, 43, 36, 35, 56, 55, 40, 39, 48, 47, 32, 63, 126, 125, 122
Offset: 0

Views

Author

Rémy Sigrist, Aug 09 2020

Keywords

Comments

This sequence is a permutation of the nonnegative integers, with inverse A336962.

Examples

			The first terms, in decimal and in binary, are:
  n   a(n)  bin(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     1       1          1
   2     2      10         10
   3     3      11         11
   4     6     100        110
   5     5     101        101
   6     4     110        100
   7     7     111        111
   8    14    1000       1110
   9    13    1001       1101
  10    10    1010       1010
  11     9    1011       1001
  12    12    1100       1100
  13    11    1101       1011
  14     8    1110       1000
  15    15    1111       1111
		

Crossrefs

Programs

  • PARI
    toruns(n) = { my (r=[]); while (n, my (v=valuation(n+n%2,2)); n\=2^v; r=concat(v,r)); r }
    fromruns(r) = { my (v=0); for (k=1, #r, v=(v+k%2)*2^r[k]-k%2); v }
    a(n) = { my (r=toruns(n)); fromruns(vector(#r, k, r[1+k%#r])) }

Formula

a(n) = n iff n = 0 or n belongs to A140690.

A341746 If the runs in the binary expansion of n are (r_1, ..., r_k), then the runs in the binary expansion of a(n) are (r_1 + ... + r_k, r_1, ..., r_{k-1}).

Original entry on oeis.org

1, 6, 3, 14, 29, 28, 7, 30, 123, 122, 61, 60, 121, 120, 15, 62, 503, 502, 251, 250, 501, 500, 125, 124, 499, 498, 249, 248, 497, 496, 31, 126, 2031, 2030, 1015, 1014, 2029, 2028, 507, 506, 2027, 2026, 1013, 1012, 2025, 2024, 253, 252, 2023, 2022, 1011, 1010
Offset: 1

Views

Author

Rémy Sigrist, Feb 18 2021

Keywords

Comments

This sequence is related to A341694 (see Formula section).
All terms are distinct.
If a(n) > n, then a(n) does not appear in A341699.

Examples

			The first terms, in decimal and in binary, are:
  n   a(n)  bin(n)  bin(a(n))
  --  ----  ------  ---------
   1     1       1          1
   2     6      10        110
   3     3      11         11
   4    14     100       1110
   5    29     101      11101
   6    28     110      11100
   7     7     111        111
   8    30    1000      11110
   9   123    1001    1111011
  10   122    1010    1111010
  11    61    1011     111101
  12    60    1100     111100
  13   121    1101    1111001
  14   120    1110    1111000
  15    15    1111       1111
		

Crossrefs

Programs

  • PARI
    toruns(n) = { my (r=[]); while (n, my (v=valuation(n+n%2, 2)); n\=2^v; r=concat(v, r)); r }
    fromruns(r) = { my (v=0); for (k=1, #r, v=(v+k%2)*2^r[k]-k%2); v }
    a(n) = { my (r=toruns(n)); fromruns(concat(vecsum(r), r[1..#r-1])) }

Formula

A341694(a(n), k) = A341694(n, k+1).
a(n) = n iff n belongs to A126646.
A090996(a(n)) = A070939(n).
A090996(a(n)) > A070939(a(n)) / 2.
A005811(a(n)) = A005811(n).

A309736 a(1) = 1, and for any n > 1, a(n) is the least k > 0 such that the binary representation of n^k starts with "10".

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 3, 1, 1, 1, 1, 2, 2, 3, 5, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 5, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 4, 5, 6, 10, 19, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Rémy Sigrist, Aug 14 2019

Keywords

Comments

The sequence is well defined; for any n > 0:
- if n is a power of 2, then a(n) = 1,
- if n is not a power of 2, then log_2(n) is irrational,
hence the function k -> frac(k * log_2(n)) is dense in the interval [0, 1]
according to Weyl's criterion,
so for some k > 0, k*log_2(n) = m + 1 + e where m is a positive integer
and 0 <= e < log_2(3) - 1 < 1,
- hence 2 * 2^m <= n^k < 3 * 2^m and a(n) <= k, QED.

Examples

			For n = 7:
- the first powers of 7, in decimal as well as in binary, are:
    k  7^k  bin(7^k)
    -  ---  ---------
    1    7        111
    2   49     110001
    3  343  101010111
- hence a(7) = 3.
		

Crossrefs

Programs

  • PARI
    a(n) = { my (nk=n); for (k=1, oo, if (binary(2*nk)[2]==0, return (k), nk *= n)) }

Formula

a(n) = 1 iff n belongs to A004754.
a(2*n) = a(n).
A090996(n^a(n)) = 1.

A385892 In the sequence of run lengths of binary indices of each positive integer (A245563), remove all duplicate rows after the first and take the last term of each remaining row.

Original entry on oeis.org

1, 2, 1, 3, 1, 2, 4, 1, 1, 2, 3, 5, 1, 1, 1, 2, 2, 3, 4, 6, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5, 7, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 6, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 5, 5, 6, 7
Offset: 1

Views

Author

Gus Wiseman, Jul 18 2025

Keywords

Comments

A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793.

Examples

			The binary indices of 53 are {1,3,5,6}, with maximal runs ((1),(3),(5,6)), with lengths (1,1,2), which is the 16th row of A385817, so a(16) = 2.
		

Crossrefs

In the following references, "before" is short for "before removing duplicate rows".
Positions of firsts appearances appear to be A000071.
Without the removals we have A090996.
For sum instead of last we have A200648, before A000120.
For length instead of last we have A200650+1, before A069010 = A037800+1.
Last term of row n of A385817 (ranks A385818, before A385889), first A083368.
A245563 gives run lengths of binary indices, see A245562, A246029, A328592.
A384877 gives anti-run lengths of binary indices, A385816.

Programs

  • Mathematica
    Last/@DeleteDuplicates[Table[Length/@Split[Join@@Position[Reverse[IntegerDigits[n,2]],1],#2==#1+1&],{n,100}]]
Previous Showing 11-17 of 17 results.