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

A090996 Number of leading 1's in binary expansion of n.

Original entry on oeis.org

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, 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, 3, 4, 4, 5, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2
Offset: 0

Views

Author

Benoit Cloitre, Feb 29 2004

Keywords

Comments

Mirror of triangle A065120. See example. - Omar E. Pol, Oct 17 2013
a(n) is also the least part in the integer partition having viabin number n. The viabin number of an integer partition is defined in the following way. Consider the southeast border of the Ferrers board of the integer partition and consider the binary number obtained by replacing each east step with 1 and each north step, except the last one, with 0. The corresponding decimal form is, by definition, the viabin number of the given integer partition. "Viabin" is coined from "via binary". For example, consider the integer partition [2,2,2,1]. The southeast border of its Ferrers board yields 10100, leading to the viabin number 20. - Emeric Deutsch, Jul 24 2017

Examples

			In binary : 14=1110 and there are 3 leading 1's, so a(14)=3.
From _Omar E. Pol_, Oct 17 2013: (Start)
Written as an irregular triangle with row lengths A011782 the sequence begins:
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;
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,3,4,4,5,6;
Right border gives A001477. Row sums give A000225.
(End)
		

Crossrefs

a(n) = A007814(1+A030101(n)).

Programs

  • Maple
    a := proc(n) if type(log[2](n+1), integer) then log[2](n+1) else a(floor((1/2)*n)) end if end proc: seq(a(n), n = 0 .. 200); # Emeric Deutsch, Jul 24 2017
    # second Maple program:
    b:= proc(n, t) `if`(n=0, t,
          b(iquo(n, 2, 'm'), m*(t+1)))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..127);  # Alois P. Heinz, Mar 06 2023
  • Mathematica
    Join[{0},Table[Length@First@Split@IntegerDigits[n,2],{n,30}]] (* Birkas Gyorgy, Mar 09 2011 *) (* adapted by Vincenzo Librandi, Dec 23 2016 *)
  • PARI
    a(n) = if(n==0, 0); b=binary(n+1); if(hammingweight(b) == 1, #b-1, a(n\2)) \\ David A. Corneth, Jul 24 2017
    
  • PARI
    a(n) = if(n==0, 0); my(b = binary(n), r = #b); for(i=2, #b, if(!b[i], return(i-1))); r \\ David A. Corneth, Jul 24 2017

Formula

a(2^k-1)=k; a(A004754(k))=1; a(A004758(k))=2.
a(2^k-1)=k; for any other n, a(n) = a(floor(n/2)).
a(n) = f(n, 0) with f(n, x) = if n < 2 then n + x else f([n/2], (x+1)*(n mod 2)). - Reinhard Zumkeller, Feb 02 2007
Conjecture: a(n) = w(n+1)*(w(n+1)-w(n)+1) - w(2^(w(n+1)+1)-n-1) for n>0, where w(n) = floor(log_2(n)), that is, A000523(n). - Velin Yanev, Dec 21 2016
a(n) = A360189(n-1,floor(log_2(n))). - Alois P. Heinz, Mar 06 2023

Extensions

Edited and corrected by Franklin T. Adams-Watters, Apr 08 2006
Sequence had accidentally been shifted left by one step, which was corrected and term a(0)=0 added by Antti Karttunen, Jan 01 2007

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

A279408 Triangle read by rows: T(n,m) (n>=m>=1) = domination number for kings' graph on an n X m toroidal board.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 2, 2, 2, 4, 4, 2, 2, 2, 4, 4, 4, 3, 3, 3, 5, 5, 6, 7, 3, 3, 3, 6, 6, 6, 8, 8, 3, 3, 3, 6, 6, 6, 9, 9, 9, 4, 4, 4, 7, 7, 8, 10, 11, 12, 14, 4, 4, 4, 8, 8, 8, 11, 11, 12, 15, 15, 4, 4, 4, 8, 8, 8, 12, 12, 12, 16, 16, 16, 5, 5, 5, 9, 9, 10, 13, 14, 15, 18, 19, 20, 22
Offset: 1

Views

Author

Andrey Zabolotskiy, Dec 16 2016

Keywords

Comments

That is, the minimal number of kings needed to cover an n X m toroidal chessboard so that every square has a king on it, is under attack by a king, or both.
For the usual non-toroidal case, the formula is ceiling(m/3)*ceiling(n/3).

Examples

			T(7,7)=7 can be reached by:
...K...
......K
..K....
.....K.
.K.....
....K..
K......
		

References

  • John J. Watkins, Across the Board: The Mathematics of Chessboard Problem, Princeton University Press, 2004, pages 144-149.

Crossrefs

Programs

  • Mathematica
    Flatten[Table[Ceiling[Max[m Ceiling[n/3], n Ceiling[m/3]]/3],{n, 1, 13}, {m, 1, n}]] (* Indranil Ghosh, Mar 09 2017 *)
  • PARI
    T(n,m) = ceil(max(m*ceil(n/3), n*ceil(m/3))/3)
    for(n=1,20,for(m=1,n, print1(T(n,m)", "))) \\ Charles R Greathouse IV, Dec 16 2016

Formula

T(n,m) = ceiling(max(m*ceiling(n/3), n*ceiling(m/3))/3).

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
Showing 1-4 of 4 results.