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

A175488 Triangle read by rows: T(n,m) = the largest positive integer that, when written in binary, occurs as a substring both in binary m and in binary n.

Original entry on oeis.org

1, 1, 2, 1, 1, 3, 1, 2, 1, 4, 1, 2, 1, 2, 5, 1, 2, 3, 2, 2, 6, 1, 1, 3, 1, 1, 3, 7, 1, 2, 1, 4, 2, 2, 1, 8, 1, 2, 1, 4, 2, 2, 1, 4, 9, 1, 2, 1, 2, 5, 2, 1, 2, 2, 10, 1, 2, 3, 2, 5, 3, 3, 2, 2, 5, 11, 1, 2, 3, 4, 2, 6, 3, 4, 4, 2, 3, 12, 1, 2, 3, 2, 5, 6, 3, 2, 2, 5, 5, 6, 13, 1, 2, 3, 2, 2, 6, 7, 2, 2, 2, 3, 6, 6, 14
Offset: 1

Views

Author

Leroy Quet, May 28 2010

Keywords

Examples

			Triangle begins:
  1;
  1, 2;
  1, 1, 3;
  1, 2, 1, 4;
  1, 2, 1, 2, 5;
  1, 2, 3, 2, 2, 6;
  ...
		

Crossrefs

Programs

  • Maple
    f:= proc(n,m) local s,R,i;
      for s from ilog2(m)+1 to 1 by -1 do
        R:= {seq(floor(n/2^i) mod 2^s,i=0 .. ilog2(n)+1-s)}
          intersect {seq(floor(m/2^i) mod 2^s,i=0 .. ilog2(m)+1-s)};
        if R <> {} then return max(R) fi
      od
    end proc:
    for n from 1 to 15 do
      seq(f(n,m),m=1..n)
    od; # Robert Israel, Jan 20 2025

Formula

T(2^k * n + j, n) = n for 0 <= j < 2^k. - Robert Israel, Jan 21 2025

Extensions

Keyword:tabl added and sequences extended by R. J. Mathar, Sep 28 2010

A175491 a(1)=1. a(n+1) = Sum_{k=1..n} a(b(k,n)), where b(k,n) is the largest positive integer that, when written in binary, occurs as a substring in both binary k and binary n.

Original entry on oeis.org

1, 1, 2, 4, 7, 11, 17, 25, 35, 49, 64, 89, 122, 174, 235, 286, 334, 407, 473, 581, 690, 824, 976, 1206, 1449, 1811, 2183, 2718, 3306, 4173, 5070, 5659, 6071, 6769, 7279, 8137, 8716, 9765, 10587, 11907, 12940, 14631, 15649, 17600, 19231, 21729, 24004, 27228
Offset: 1

Views

Author

Leroy Quet, May 28 2010

Keywords

Examples

			a(6)=11 because 5=(101)2 and
for k=1=(1)2 CS (1)2 and a(1)=1
for k=2=(10)2 CS (10)2=2 and a(2)=1
for k=3=(11)2 CS (1)2 and a(1)=1
for k=4=(100)2 CS (10)2=2 and a(2)=1
for k=5=(101)2 CS (101)2=5 and a(5)=7
and the sum of these 5 terms is 11.
(CS stands for "largest common substring is").
		

Crossrefs

Programs

  • PARI
    See Links section.

Extensions

More terms from Lars Blomberg, Feb 25 2016

A331803 a(n) is the largest positive integer occurring, when written in binary, as a substring in both binary n and binary n+1.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 3, 1, 4, 2, 5, 3, 6, 6, 7, 1, 8, 4, 9, 4, 10, 5, 11, 3, 12, 6, 13, 6, 14, 14, 15, 1, 16, 8, 17, 4, 18, 9, 19, 4, 20, 10, 21, 11, 22, 11, 23, 3, 24, 12, 25, 6, 26, 13, 27, 7, 28, 14, 29, 14, 30, 30, 31, 1, 32, 16, 33, 8, 34, 17, 35, 8, 36, 18
Offset: 0

Views

Author

Rémy Sigrist, Jan 26 2020

Keywords

Comments

We set a(0) = 0 by convention.

Examples

			The first terms, alongside the binary representations of n, n+1 and a(n), are:
  n   a(n)  bin(n)  bin(n+1)  bin(a(n))
  --  ----  ------  --------  ---------
   0     0       0         1          0
   1     1       1        10          1
   2     1      10        11          1
   3     1      11       100          1
   4     2     100       101         10
   5     2     101       110         10
   6     3     110       111         11
   7     1     111      1000          1
   8     4    1000      1001        100
   9     2    1001      1010         10
  10     5    1010      1011        101
		

Crossrefs

Cf. A175466.

Programs

  • PARI
    sub(n) = { my (b=binary(n), s=[0]); for (i=1, #b, if (b[i], for (j=i, #b, s=setunion(s, Set(fromdigits(b[i..j], 2)))))); return (s) }
    a(n) = my (i=setintersect(sub(n), sub(n+1))); i[#i]

Formula

a(n) = A175466(n, n+1) for any n > 0.
a(2*n) = n.
a(2^k-1) = 1 for any k > 0.

A331804 a(n) is the largest positive integer occurring, when written in binary, as a substring in both binary n and its reversal (A030101(n)).

Original entry on oeis.org

0, 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 5, 3, 5, 7, 15, 1, 17, 9, 9, 5, 21, 6, 7, 3, 9, 5, 27, 7, 7, 15, 31, 1, 33, 17, 17, 9, 9, 9, 9, 5, 9, 21, 21, 6, 45, 14, 15, 3, 17, 9, 51, 5, 21, 27, 27, 7, 9, 7, 27, 15, 15, 31, 63, 1, 65, 33, 33, 17, 17, 17, 17, 9, 73, 10, 9
Offset: 0

Views

Author

Rémy Sigrist, Jan 26 2020

Keywords

Comments

We set a(0) = 0 by convention.
a(7479) = 29 ("11101" in binary) is the first term that does not belong to A057890.

Examples

			The first terms, alongside the binary representations of n and of a(n), are:
  n   a(n)  bin(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     1       1          1
   2     1      10          1
   3     3      11         11
   4     1     100          1
   5     5     101        101
   6     3     110         11
   7     7     111        111
   8     1    1000          1
   9     9    1001       1001
  10     5    1010        101
  11     5    1011        101
  12     3    1100         11
		

Crossrefs

Programs

  • PARI
    sub(n) = { my (b=binary(n), s=[0]); for (i=1, #b, if (b[i], for (j=i, #b, s=setunion(s, Set(fromdigits(b[i..j], 2)))))); return (s) }
    a(n) = my (i=setintersect(sub(n), sub(fromdigits(Vecrev(binary(n)),2)))); i[#i]

Formula

a(n) = A175466(n, A030101(n)) for any n > 0.
a(n) <= n with equality iff n is a binary palindrome (A006995).

A363164 Square array A(n, k), n, k >= 0, read by antidiagonals; A(n, k) is the greatest nonnegative number whose binary digits appear in order but not necessarily as consecutive digits in the binary expansions of n and k.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jul 07 2023

Keywords

Examples

			Table A(n, k) begins:
  n\k | 0  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15
  ----+-----------------------------------------------------
    0 | 0  0  0  0  0  0  0  0  0  0   0   0   0   0   0   0
    1 | 0  1  1  1  1  1  1  1  1  1   1   1   1   1   1   1
    2 | 0  1  2  1  2  2  2  1  2  2   2   2   2   2   2   1
    3 | 0  1  1  3  1  3  3  3  1  3   3   3   3   3   3   3
    4 | 0  1  2  1  4  2  2  1  4  4   4   2   4   2   2   1
    5 | 0  1  2  3  2  5  3  3  2  5   5   5   3   5   3   3
    6 | 0  1  2  3  2  3  6  3  2  3   6   3   6   6   6   3
    7 | 0  1  1  3  1  3  3  7  1  3   3   7   3   7   7   7
    8 | 0  1  2  1  4  2  2  1  8  4   4   2   4   2   2   1
    9 | 0  1  2  3  4  5  3  3  4  9   5   5   4   5   3   3
   10 | 0  1  2  3  4  5  6  3  4  5  10   5   6   6   6   3
   11 | 0  1  2  3  2  5  3  7  2  5   5  11   3   7   7   7
   12 | 0  1  2  3  4  3  6  3  4  4   6   3  12   6   6   3
   13 | 0  1  2  3  2  5  6  7  2  5   6   7   6  13   7   7
   14 | 0  1  2  3  2  3  6  7  2  3   6   7   6   7  14   7
   15 | 0  1  1  3  1  3  3  7  1  3   3   7   3   7   7  15
		

Crossrefs

See A175466 for a similar sequence.
Cf. A301983.

Programs

  • PARI
    A(n, k) = { my (sn = [0], bn = binary(n), sk = [0], bk = binary(k)); for (i = 1, #bn, sn = setunion(sn, [2*v+bn[i]|v<-sn])); for (i = 1, #bk, sk = setunion(sk, [2*v+bk[i]|v<-sk])); vecmax(setintersect(sn, sk)); }

Formula

A(n, k) = A(k, n).
A(n, 0) = 0.
A(n, 1) = 1 for any n > 0.
A(n, n) = n.
Showing 1-5 of 5 results.