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 21-28 of 28 results.

A187786 Table read by rows, where n-th row contains all numbers having in binary representation as many zeros and ones as n.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jan 06 2013

Keywords

Comments

For k = 0..A090706(n)-1: A023416(T(n,k))=A023416(n); A000120(T(n,k))=A000120(n); A053644(n)<=T(n,k)<=A003817(n);
T(n,k) = n for some k;
A187769 contains all rows without repetitions.

Examples

			.  n  n-th row              binary                          row length
. --  --------------------- ------------------------------- ----------
.  0  {0}                   {0}                                      1
.  1  {1}                   {1}                                      1
.  2  {2}                   {10}                                     1
.  3  {3}                   {11}                                     1
.  4  {4}                   {100}                                    1
.  5  {5,6}                 {101,110}                                2
.  6  {5,6}                 {101,110}                                2
.  7  {7}                   {111}                                    1
.  8  {8}                   {1000}                                   1
.  9  {9,10,12}             {1001,1010,1100}                         3
. 10  {9,10,12}             {1001,1010,1100}                         3
. 11  {11,13,14}            {1011,1101,1110}                         3
. 12  {9,10,12}             {1001,1010,1100}                         3
. 13  {11,13,14}            {1011,1101,1110}                         3
. 14  {11,13,14}            {1011,1101,1110}                         3
. 15  {15}                  {1111}                                   1
. 16  {16}                  {10000}                                  1
. 17  {17,18,20,24}         {10001,10010,10100,11000}                4
. 18  {17,18,20,24}         {10001,10010,10100,11000}                4
. 19  {19,21,22,25,26,28}   {10011,10101,10110,11001,11010,11100}    6
. 20  {17,18,20,24}         {10001,10010,10100,11000}                4 .
		

Programs

  • Haskell
    import List (find)
    import Maybe (fromJust)
    a187786 n k = a187786_tabf !! n !! k
    a187786_row n = fromJust $ find (elem n) a187769_tabf
    a187786_tabf = map a187786_row [0..]

A265716 a(n) = n IMPL (2*n), where IMPL is the bitwise logical implication.

Original entry on oeis.org

0, 2, 5, 6, 11, 10, 13, 14, 23, 22, 21, 22, 27, 26, 29, 30, 47, 46, 45, 46, 43, 42, 45, 46, 55, 54, 53, 54, 59, 58, 61, 62, 95, 94, 93, 94, 91, 90, 93, 94, 87, 86, 85, 86, 91, 90, 93, 94, 111, 110, 109, 110, 107, 106, 109, 110, 119, 118, 117, 118, 123, 122
Offset: 0

Views

Author

Reinhard Zumkeller, Dec 15 2015

Keywords

Comments

The scatterplot exhibits fractal qualities. - Bill McEachen, Dec 27 2022

Examples

			.      2*21=42 | 101010                      2*6=12 | 1100
.           21 |  10101                           6 |  110
.   -----------+-------                   ----------+-----
.   21 IMPL 42 | 101010 -> a(21) = 42     6 IMPL 12 | 1101 -> a(6) = 13 .
		

Crossrefs

Programs

  • Haskell
    a265716 n = n `bimpl` (2 * n) where
       bimpl 0 0 = 0
       bimpl p q = 2 * bimpl p' q' + if u <= v then 1 else 0
                   where (p', u) = divMod p 2; (q', v) = divMod q 2
    
  • Maple
    A265716 := n -> Bits:-Implies(n, 2*n):
    seq(A265716(n), n=0..61); # Peter Luschny, Sep 23 2019
  • Mathematica
    IMPL[n_, k_] := If[n == 0, 0, BitOr[2^Length[IntegerDigits[k, 2]]-1-n, k]];
    a[n_] := n ~IMPL~ (2n);
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Nov 16 2021 *)
  • PARI
    a(n)=bitor(bitneg(n, exponent(n)+1), 2*n) \\ Charles R Greathouse IV, Jan 20 2023

Formula

a(n) = A265705(2*n,n): central terms of triangle A265705;
a(A247648(n)) = 2*A247648(n).
a(n)= bitor(A003817(n)-n, 2*n) (conjectured). - Bill McEachen, Dec 13 2021
2n <= a(n) <= 3n. - Charles R Greathouse IV, Jan 20 2023

A342700 For any number n with binary expansion (b(1), b(2), ..., b(k)), the binary expansion of a(n) is (1-floor((b(k)+b(1)+b(2))/2), 1-floor((b(1)+b(2)+b(3))/2), ..., 1-floor((b(k-1)+b(k)+b(1))/2)).

Original entry on oeis.org

0, 0, 2, 0, 7, 0, 0, 0, 15, 6, 10, 0, 3, 0, 0, 0, 31, 14, 30, 12, 23, 4, 16, 0, 7, 6, 2, 0, 3, 0, 0, 0, 63, 30, 62, 28, 63, 28, 56, 24, 47, 14, 42, 8, 35, 0, 32, 0, 15, 14, 14, 12, 7, 4, 0, 0, 7, 6, 2, 0, 3, 0, 0, 0, 127, 62, 126, 60, 127, 60, 120, 56, 127, 62
Offset: 0

Views

Author

Rémy Sigrist, Mar 18 2021

Keywords

Comments

This sequence is a variant of A342698; here the value of the k-th bit of a(n) is the less frequent value in the bit triple centered around the k-th bit of n.

Examples

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

Crossrefs

Cf. A003817, A020988 (fixed points), A342698.

Programs

  • PARI
    a(n) = my (w=#binary(n)); sum(k=0, w-1, ((bittest(n, (k-1)%w)+bittest(n, k%w)+bittest(n, (k+1)%w))<=1) * 2^k)

Formula

a(n) + A342698(n) = A003817(n).
a(n) = n iff n belongs to A020988.

A175039 Minimum number of integer-sided squares needed to tile an n-row staircase (a figure with n unit squares in the n-th row, and the leftmost squares of each row vertically aligned).

Original entry on oeis.org

1, 3, 3, 7, 6, 7, 7, 11, 12, 13, 12, 15, 14, 15, 15, 20, 20, 23, 22, 23, 24, 25, 24, 29, 28, 29, 28
Offset: 1

Views

Author

Cyril Zhang, Apr 04 2010

Keywords

Comments

a(n) >= n, since the rightmost squares in each row must be covered by distinct tiles.
a(n) = n iff n = 2^k - 1.
a(n) = n+1 iff n = 2^k - 2^m - 1.
a(2*k) <= 2*a(k) + 1, a(2*k+1) <= 2*a(k) + 1 for k >= 1. - Jinyuan Wang, Jul 17 2019
a(n) <= A003817(n). - Austin Shapiro, Dec 29 2022

Examples

			See link for diagrams of tilings.
		

Crossrefs

Solutions for a(n) = n: A000225. Solutions for a(n) = n+1: A030130, excluding 0.

A284630 a(1)=1, a(2)=2; for n > 1, a(n+1) = (a(n-1) mod n) + n.

Original entry on oeis.org

1, 2, 3, 5, 7, 5, 7, 12, 15, 12, 15, 12, 15, 25, 15, 25, 31, 25, 31, 25, 31, 25, 31, 25, 31, 25, 31, 52, 31, 52, 31, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 52, 63, 105, 63, 105, 63, 105, 63, 105, 63, 105, 63, 105, 127, 105, 127, 105, 127, 105, 127, 105, 127, 105, 127, 105, 127, 105, 127, 105
Offset: 1

Views

Author

Thomas Kerscher, Mar 31 2017

Keywords

Examples

			a(3) = a(1) (mod 2) + 2 = 3.
		

Crossrefs

Cf. A003817.

Programs

  • Maple
    A[1]:= 1: A[2]:= 2:
    for n from 3 to 200 do A[n]:= (A[n-2] mod (n-1)) + n-1 od:
    seq(A[n],n=1..200); # Robert Israel, Apr 04 2017
  • Mathematica
    a[n_] := a[n] = If[n < 3, n, Mod[a[n - 2], n - 1] + n - 1]; Array[a, 80] (* Michael De Vlieger, Apr 02 2017 *)
    nxt[{n_,a_,b_}]:={n+1,b,Mod[a,n]+n}; NestList[nxt,{2,1,2},100][[;;,2]] (* Harvey P. Dale, Jul 31 2023 *)
  • PARI
    a(n) = if (n<=2, n, (n-1) + a(n-2) % (n-1)); \\ Michel Marcus, Apr 02 2017

A339674 Irregular triangle T(n, k), n, k >= 0, read by rows; for any number m with runs in binary expansion (r_1, ..., r_j), let R(m) = {r_1 + ... + r_j, r_2 + ... + r_j, ..., r_j}; row n corresponds to the numbers k such that R(k) is included in R(n), in ascending order.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Feb 21 2021

Keywords

Comments

For any m > 0, R(m) contains the partial sums of the m-th row of A227736; by convention, R(0) = {}.
The underlying idea is to take some or all of the rightmost runs of a number, and possibly merge some of them.
For any n >= 0, the n-th row:
- has 2^A000120(A003188(n)) terms,
- has first term 0 and last term A003817(n),
- has n at position A090079(n),
- corresponds to the distinct terms in n-th row of table A341840.

Examples

			The triangle starts:
    0;
    0, 1;
    0, 1, 2, 3;
    0, 3;
    0, 3, 4, 7;
    0, 1, 2, 3, 4, 5, 6, 7;
    0, 1, 6, 7;
    0, 7;
    0, 7, 8, 15;
    0, 1, 6, 7, 8, 9, 14, 15;
    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15;
    0, 3, 4, 7, 8, 11, 12, 15;
    0, 3, 12, 15;
    0, 1, 2, 3, 12, 13, 14, 15;
    0, 1, 14, 15;
    0, 15;
    ...
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

T(n, 0) = 0.
T(n, A090079(n)) = n.
T(n, 2^A000120(A003188(n))-1) = A003817(n).

A378959 Sum, in base 10, of the permutations of the digits of n, written in base 2.

Original entry on oeis.org

0, 1, 3, 3, 7, 14, 14, 7, 15, 45, 45, 45, 45, 45, 45, 15, 31, 124, 124, 186, 124, 186, 186, 124, 124, 186, 186, 124, 186, 124, 124, 31, 63, 315, 315, 630, 315, 630, 630, 630, 315, 630, 630, 630, 630, 630, 630, 315, 315, 630, 630, 630, 630, 630, 630, 315, 630
Offset: 0

Views

Author

Paolo P. Lava, Dec 12 2024

Keywords

Comments

Fixed points are in A000225.

Examples

			a(5) = 14 because 5 in base 2 is 101 and the permutations of the digits are 101, 110, 011 that correspond to 5, 6, 3 and 5 + 6 + 3 = 14.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) local k, l;
          l:= convert(n, base, 2); k:= nops(l);
          binomial(k-1, add(i, i=l)-1)*(2^k-1)
        end:
    seq(a(n), n=0..56);  # Alois P. Heinz, Dec 12 2024
  • Mathematica
    A378959[n_] := (2^# - 1)*Binomial[# - 1, DigitCount[n, 2, 0]] & [BitLength[n]];
    Array[A378959, 100, 0] (* Paolo Xausa, Jan 29 2025 *)

Formula

a(n) = A003817(n) * A090706(n). - Alois P. Heinz, Dec 12 2024

A171230 a(n) = 0+1+2+...+n in lunar arithmetic in base 2 written in base 2.

Original entry on oeis.org

0, 1, 11, 11, 111, 111, 111, 111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 11111, 11111, 11111, 11111, 11111, 11111, 11111, 11111, 11111, 11111, 11111, 11111, 11111, 11111, 11111, 11111, 111111, 111111, 111111, 111111, 111111
Offset: 0

Views

Author

N. J. A. Sloane, Oct 02 2010

Keywords

Crossrefs

Cf. A003817.
Previous Showing 21-28 of 28 results.