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.

A303077 a(1) = 1, and for n > 1, a(n) is the greatest prime number whose binary digits appear in order but not necessarily as consecutive digits in the binary representation of n.

Original entry on oeis.org

1, 2, 3, 2, 5, 3, 7, 2, 5, 5, 11, 3, 13, 7, 7, 2, 17, 5, 19, 5, 13, 11, 23, 3, 13, 13, 13, 7, 29, 7, 31, 2, 17, 17, 19, 5, 37, 19, 23, 5, 41, 13, 43, 11, 29, 23, 47, 3, 17, 13, 19, 13, 53, 13, 31, 7, 29, 29, 59, 7, 61, 31, 31, 2, 17, 17, 67, 17, 37, 19, 71, 5
Offset: 1

Views

Author

Rémy Sigrist, Apr 18 2018

Keywords

Comments

This sequence has similarities with A078833; there binary digits have to be consecutive, here not.
For n > 1, a(n) is the greatest prime number appearing in the n-th row of A301983.

Examples

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

Crossrefs

Programs

  • PARI
    a(n) = my (s=Set(1), b=binary(n)); for (i=2, #b, s=setunion(s, Set(apply(k->2*k+b[i], s)))); vecmax(select(k->k==1 || isprime(k), s))

Formula

a(2*n) = a(n) for any n > 1.
a(n) = n iff n is not composite.
a(n) = 2 iff n = 2^k for some k > 0.
a(n) >= A078833(n).

A301984 a(n) is the greatest positive number k such that the binary digits of any number in the interval 1..k appear in order but not necessarily as consecutive digits in the binary representation of n.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 30 2018

Keywords

Comments

Equivalently, a(n) is the greatest positive number k such that A301983(n, k) = k.
Apparently, the k-th record value is A089633(k), and the first term with this value has index A048678(A089633(k)).

Examples

			The 13th row of A301983 is: 1, 2, 3, 5, 6, 7, 13; all numbers in the range 1..3 appear in this row, but the number 4 is missing; hence a(13) = 3.
		

Crossrefs

Programs

  • PARI
    a(n) = my (b=binary(n), s=Set(1)); for (i=2, #b, s = setunion(s, Set(apply(v -> 2*v+b[i], s)))); for (u=1, oo, if (!setsearch(s,u), return (u-1)))

Formula

a(n) <= A301977(n).
a(2*n) >= a(n).
a(2*n + 1) >= a(n) (with strict inequality if a(n) is even).
a(n) = 1 iff n is positive and belongs to A000225.

A332030 a(n) is the product of the distinct positive numbers whose binary digits appear in order, but not necessarily as consecutive digits, in the binary representation of n.

Original entry on oeis.org

1, 1, 2, 3, 8, 30, 36, 21, 64, 1080, 7200, 2310, 1728, 16380, 3528, 315, 1024, 146880, 9331200, 1580040, 13824000, 1362160800, 170755200, 796950, 331776, 176904000, 2861913600, 72972900, 4741632, 99754200, 1587600, 9765, 32768, 77552640, 86294937600
Offset: 0

Views

Author

Rémy Sigrist, Feb 05 2020

Keywords

Comments

This sequence is a variant of A165153.
For n > 0, a(n) is the product of the terms of the n-th row of A301983.

Examples

			For n = 9:
- the binary representation of 9 is "1001",
- the following positive binary strings appear in it: "1", "10", "11", "100", "101" and "1001",
- they correspond to: 1, 2, 3, 4, 5 and 9,
- so a(9) = 1 * 2 * 3 * 4 * 5 * 9 = 1080.
		

Crossrefs

Cf. A005329, A006125, A165153, A301983, A328379 (additive variant).

Programs

  • PARI
    a(n) = my (b=binary(n), s=[0]); for (i=1, #b, s=setunion(s, apply(m -> 2*m+b[i], s))); vecprod(s[2..#s])

Formula

a(n) >= A165153(n).
a(2^k) = A006125(k+1) for any k >= 0.
a(2^k-1) = A005329(k) for any k >= 0.

A360296 a(1) = 1, and for any n > 1, a(n) is the sum of the terms of the sequence at indices k < n whose binary digits appear in order but not necessarily as consecutive digits in the binary representation of n.

Original entry on oeis.org

1, 1, 1, 2, 3, 3, 2, 4, 8, 11, 8, 8, 11, 8, 4, 8, 20, 34, 26, 34, 51, 40, 20, 20, 40, 51, 34, 26, 34, 20, 8, 16, 48, 96, 76, 118, 186, 152, 76, 96, 208, 281, 186, 152, 208, 124, 48, 48, 124, 208, 152, 186, 281, 208, 96, 76, 152, 186, 118, 76, 96, 48, 16, 32
Offset: 1

Views

Author

Rémy Sigrist, Feb 02 2023

Keywords

Comments

This sequence is a variant of A165418.

Examples

			The first terms, alongside the corresponding k's, are:
  n   a(n)  k's
  --  ----  ------------------
   1     1  N/A
   2     1  {1}
   3     1  {1}
   4     2  {1, 2}
   5     3  {1, 2, 3}
   6     3  {1, 2, 3}
   7     2  {1, 3}
   8     4  {1, 2, 4}
   9     8  {1, 2, 3, 4, 5}
  10    11  {1, 2, 3, 4, 5, 6}
  11     8  {1, 2, 3, 5, 7}
  12     8  {1, 2, 3, 4, 6}
  13    11  {1, 2, 3, 5, 6, 7}
  14     8  {1, 2, 3, 6, 7}
  15     4  {1, 3, 7}
  16     8  {1, 2, 4, 8}
		

Crossrefs

Programs

  • PARI
    { for (n=1, #a=vector(64), print1 (a[n]=if (n==1, 1, s = [1]; b = binary(n); for (k=2, #b, s = setunion(s, apply(v -> 2*v+b[k], s))); sum(k=1, #s-1, a[s[k]]);)", ")) }

Formula

a(n) = Sum_{k = 1..A301977(n-1)} a(A301983(n, k)) for any n > 1.
a(2^k) = 2^(k-1) for any k > 0.
a(2^k-1) = 2^(k-2) for any k > 1.
a(n) >= A165418(n).

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.