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-30 of 33 results. Next

A335702 A sequence connected with Rado’s explicit description of the Erdős-Rényi countable random graph.

Original entry on oeis.org

0, 1, 2, 4, 5, 8, 12, 16, 17, 18, 24, 32, 34, 40, 48, 50, 56, 64, 65, 72, 80, 81, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 257, 258, 260, 261, 272, 273, 274, 288, 290, 304, 306, 320, 321, 336
Offset: 1

Views

Author

N. J. A. Sloane, Aug 13 2020

Keywords

Comments

It would be nice to have an explicit definition.

Crossrefs

Cf. A133457.

Programs

  • PARI
    S(n) = { my (s=[], i); while (n, i=valuation(n,2); s=concat(s,i); n-=2^i); s }
    is(n) = my (s=S(n), z=if (#s, Set(concat(apply(S, s))), [])); setintersect(s, z)==[] \\ Rémy Sigrist, Aug 14 2020

Extensions

More terms from Rémy Sigrist, Aug 14 2020

A358126 Replace 2^k in binary expansion of n with 2^(2^k).

Original entry on oeis.org

0, 2, 4, 6, 16, 18, 20, 22, 256, 258, 260, 262, 272, 274, 276, 278, 65536, 65538, 65540, 65542, 65552, 65554, 65556, 65558, 65792, 65794, 65796, 65798, 65808, 65810, 65812, 65814, 4294967296, 4294967298, 4294967300
Offset: 0

Views

Author

Tilman Piesk, Oct 30 2022

Keywords

Comments

Sums of distinct terms of A001146.
The name "ballooned integers" is proposed for this sequence.
a(n) is the index of the first occurrence of n in A253315.

Examples

			Let    n   =     25  =  1 +   8 +    16  =     2^0  +    2^3  +    2^4.
Then a(n)  =  65794  =  2 + 256 + 65536  =  2^(2^0) + 2^(2^3) + 2^(2^4).
The binary indices of n are {0, 3, 4}. Those of a(n) are {1, 8, 16}.
		

Crossrefs

Programs

  • Maple
    a := proc(n) select(d -> d[2] <> 0, ListTools:-Enumerate(convert(n,base,2))):
    add(2^(2^(%[j][1] - 1)), j = 1..nops(%)) end: seq(a(n), n = 0..34); # Peter Luschny, Oct 31 2022
  • Mathematica
    a[n_] := Total[2^(2^Range[If[n == 0, 1, IntegerLength[n,2]] - 1, 0, -1]) * IntegerDigits[n, 2]]; Array[a, 35, 0] (* Amiram Eldar, Oct 31 2022 *)
  • PARI
    a(n) = my(d=Vecrev(digits(n,2))); for (k=1, #d, d[k] *= 2^(2^(k-1))); vecsum(d); \\ Michel Marcus, Oct 31 2022
  • Python
    def a(n):
        binary_string = "{0:b}".format(n)[::-1]  # little-endian
        result = 0
        for i, binary_digit in enumerate(binary_string):
            if binary_digit == '1':
                result += 1 << (1 << i)  # 2 ** (2 ** i)
        return result
    

Formula

If n = Sum_{i=0..k} 2^s_i, then a(n) = Sum_{i=0..k} 2^(2^s_i).
a(n) = 2 * A253317(n+1).
a(2^n-1) = A060803(n-1) for n >= 1.
a(2^n) = A001146(n).
A197819[m, a(n)] = A228539[m, n]. (Compare link about Boolean Walsh functions.)

A306754 The bottom entry in the difference table of the positions of the ones in the binary representation of n.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Mar 08 2019

Keywords

Comments

By convention, a(0) = 0.
For any n > 0:
- let (b_1, b_2, ..., b_h) be the positions of the ones in the binary representation of n,
- h = A000120(n) and 0 <= b_1 < b_2 < ... < b_h,
- n = Sum_{k = 1..h} 2^b_k,
- a(n) is the unique value remaining after taking successively the first differences of (b_1, ..., b_h) h-1 times.

Examples

			For n = 59:
- the binary representation of 59 is "111011",
- so h = 5 and b_1 = 0, b_2 = 1, b_3 = 3, b_4 = 4, b_5 = 5,
- the corresponding difference table is:
        0   1   3   4   5
          1   2   1   1
            1  -1   0
             -2   1
                3
- hence a(59) = 3.
		

Crossrefs

See A306607 for a similar sequence.

Programs

  • PARI
    a(n) = { my (h=hammingweight(n), o=0, v=0); forstep (k=h-1, 0, -1, my (w=valuation(n, 2)); o += w; v += (-1)^k * binomial(h-1, k) * o; o++; n\=2^(1+w)); v };

Formula

a(2^k) = k for any k >= 0.
a(2^k-1) = [k=2].
a(2*n) = a(n) + A209229(n).

A336434 Square array read by descending antidiagonals T(n,k): In the binary expansion of n, reverse the order of the bits in the same position as the active bits in A057716(k).

Original entry on oeis.org

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

Views

Author

Davis Smith, Jul 21 2020

Keywords

Comments

T(n,k) is the swapping of the positions of the bits in n according to the active bits in K, where K = A057716(k). The bit in the same position as the first active bit in K switches positions with the bit in the same position as the last active bit in K, the bit in the same position as the second active bit in K switches with the one in the same as the second to last position, and so on until all have swapped (without repeating).
Any sequence, f, of the form "reverse the order of the a-th, b-th, ... and z-th bits in n" can be expressed as f(n) = T(n,k), where A057716(k) = 2^a + 2^b + ... 2^z. As a result, this operation combines 1 or more bit-swapping operations, which could be useful for bit-manipulation in computer programming.

Examples

			The binary expansion of 18 is 10010_2 and the active bits in the binary expansion of A057716(22) = 27 = 11011_2 are 0, 1, 3, and 4. So, to get T(18,22), we swap the 0th and 4th bits and then the 1st and 3rd bits, which gives us T(18,22) = 9.
Square array T(n,k) begins:
  \k   1   2   3   4   5   6   7   8   9  10 ...
  n\
   1|  2   4   1   4   8   1   8   1   8   1 ...
   2|  1   2   4   2   2   8   2   2   2   8 ...
   3|  3   6   5   6  10   9  10   3  10   9 ...
   4|  4   1   2   1   4   4   4   8   4   4 ...
   5|  6   5   3   5  12   5  12   9  12   5 ...
   6|  5   3   6   3   6  12   6  10   6  12 ...
   7|  7   7   7   7  14  13  14  11  14  13 ...
   8|  8   8   8   8   1   2   1   4   1   2 ...
   9| 10  12   9  12   9   3   9   5   9   3 ...
  10|  9  10  12  10   3  10   3   6   3  10 ...
		

Crossrefs

Programs

  • PARI
    A336434(n,k)={my(K=k+#binary(k+#binary(k)), P=select(Z->bittest(K,Z),[0..#binary(K)-1]), Q1=P[1..floor(#P/2)],Q2=Vecrev(P)[1..floor(#P/2)], Sum=vecsum(apply(p->if(bittest(n,Q1[p])!=bittest(n,Q2[p]), bitor(shift(1,Q1[p]),shift(1,Q2[p]))), [1..floor(#P/2)])));bitxor(n,Sum)}

Formula

T(n,k) = A003987(n, Sum_{m=1..floor(M/2)} A003987(A030308(n,A133457(K,m)), A030308(n,A133457(K,M - (m - 1))))* (2^A133457(K,m) + 2^A133457(K,M - (m - 1)))), where K = A057716(k) and M = A000120(A057716(k)).
When A057716(k) = 2^A070939(n) - 1, T(n,k) = A030101(n).
When A057716(k) = 2^(A070939(n) - 1) - 1, T(n,k) = A059893(n).

A336533 Lexicographically earliest sequence of positive terms such that for any n > 0, n = Sum_{k >= 0} b(k)*a(k+1) where Sum_{k >= 0} b(k)*2^k is the binary expansion of a(n).

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 23, 26, 27, 29, 30, 31, 47, 55, 58, 59, 61, 62, 63, 93, 94, 95, 111, 119, 122, 123, 125, 126, 127, 191, 221, 222, 223, 239, 247, 250, 251, 253, 254, 255, 382, 383, 447, 477, 478, 479, 495, 503, 506, 507, 509, 510, 511, 767
Offset: 1

Views

Author

Rémy Sigrist, Sep 26 2020

Keywords

Comments

In other words, the binary expansion of the n-th term encodes a partition of n into distinct terms of the sequence.
This sequence is complete (as any integer can be written as a sum of distinct terms of this sequence).

Examples

			The first terms, alongside their binary representation and the corresponding partition of n, are:
  n   a(n)  bin(a(n))  Partition of n
  --  ----  ---------  -------------------------
   1     1          1  a(1)
   2     2         10  a(2)
   3     3         11  a(2) + a(1)
   4     5        101  a(3) + a(1)
   5     6        110  a(3) + a(2)
   6     7        111  a(3) + a(2) + a(1)
   7    10       1010  a(4) + a(2)
   8    11       1011  a(4) + a(2) + a(1)
   9    13       1101  a(4) + a(3) + a(1)
  10    14       1110  a(4) + a(3) + a(2)
  11    15       1111  a(4) + a(3) + a(2) + a(1)
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

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

A351289 Square array read by descending antidiagonals: A(n,k) is the smallest m such that the base-n expansion of m contains the base-n expansions of the k-th row of A048793 as substrings.

Original entry on oeis.org

1, 2, 1, 2, 2, 1, 3, 5, 2, 1, 3, 3, 6, 2, 1, 6, 3, 3, 7, 2, 1, 6, 11, 7, 3, 8, 2, 1, 4, 11, 11, 8, 3, 9, 2, 1, 4, 4, 27, 13, 9, 3, 10, 2, 1, 4, 4, 4, 38, 15, 10, 3, 11, 2, 1, 4, 14, 4, 4, 51, 17, 11, 3, 12, 2, 1, 12, 14, 18, 9, 4, 66, 19, 12, 3, 13, 2, 1, 12, 12, 18, 14, 10, 4, 83, 21, 13, 3, 14, 2, 1
Offset: 2

Views

Author

Davis Smith, Feb 06 2022

Keywords

Comments

A(n,k) is the least m such that m contains the base-n expansions of the active bits (plus 1) in k as substrings.
The Shortest Superstring Problem is, given a set of strings, S, to find the shortest string which contains each element of S as a substring. All possible solutions to this problem are contained in this array. The values of k represent the set of strings (where the active bits represent the strings in base n). The value of k for non-numeral strings (or numeral strings with an initial 0) is generated by mapping each character to a unique value 1 through n, converting from base n+1, subtracting 1 from each, raising 2 to the power of each and then summing the result. A(n+1,k) in base n+1 is the shortest superstring. The value of k for numeral strings in base n (without initial 0's) is generated by just raising 2 to the power of the value of each and then summing the result. A(n,k) in base n is the shortest superstring.

Examples

			The binary expansion of 7 is 111. This means that the base-n expansions of the 7th column will contain the base-n expansions of 1, 2, and 3 as substrings. So A(6,7) = 123_6 (as that is the arrangement of those digits with the lowest value) and 123_6 = 51_10.
For another example, the binary expansion of 10 is 1010, so the 10th column will contain the base-n expansions of 2 and 4 as substrings. So A(7,10) = 24_7 (as that's the arrangement with the lowest value) and 24_7 = 18_10. Also, frequently, two or more of the substrings will overlap. For example, A(2,7) = 110_2 = 6 as the final digit of 11_2 is the same as the first digit of 10_2 and 1 is a substring of both of those.
The square array begins:
  n\k| 1   2   3   4   5   6   7   8   9  10 ...
  ===+==========================================
   2 | 1   2   2   3   3   6   6   4   4   4 ...
   3 | 1   2   5   3   3  11  11   4   4  14 ...
   4 | 1   2   6   3   7  11  27   4   4  18 ...
   5 | 1   2   7   3   8  13  38   4   9  14 ...
   6 | 1   2   8   3   9  15  51   4  10  16 ...
   7 | 1   2   9   3  10  17  66   4  11  18 ...
   8 | 1   2  10   3  11  19  83   4  12  20 ...
   9 | 1   2  11   3  12  21 102   4  13  22 ...
  10 | 1   2  12   3  13  23 123   4  14  24 ...
  11 | 1   2  13   3  14  25 146   4  15  26 ...
  ..
		

Crossrefs

Programs

  • PARI
    A351289(n,k)=if(hammingweight(k)==1,return(logint(k,2)+1), my(OverSumBase(X)=fold((x,y)->my(B1=digits(x,n),B2=digits(y,n),b=select(z->B1[#B1-(z-1)..#B1]==B2[1..z],[1..min(#B1,#B2)]));fromdigits(concat(B1,B2[if(#b,vecmax(b)+1,1)..#B2]),n),Vec(X)), K=select(z->bittest(k,z-1),[1..logint(k,2)+1]), V=apply(x->my(X=if(x,digits(x,n),[0]));setbinop((y,z)->fromdigits(X[y..z],n),[1..#X]),K), W=select(X->my(L=List(V));listpop(L,setsearch(K,X));!setsearch(Set(concat(L)),X),K), P1); if(#W==1, return(W[1]), vecmax(K)P,P1=P),P1=P));print(P1);return(P1)))

Formula

A(n,2^k) = k + 1.
A(n,2^k - 1) = A350510(n,k).
A(2,2^k - 1) = A056744(k).
For n > A070939(k), A(n,k) = Sum_{i=1..A000120(k)} A048793(k,i)*n^(A000120(k) - i).

A356354 a(n) is the least k such that the sets of positions of 1's in the binary expansions of n and k are similar.

Original entry on oeis.org

0, 1, 1, 3, 1, 3, 3, 7, 1, 3, 3, 11, 3, 11, 7, 15, 1, 3, 3, 19, 3, 7, 11, 23, 3, 19, 11, 27, 7, 23, 15, 31, 1, 3, 3, 35, 3, 37, 19, 39, 3, 37, 7, 43, 11, 45, 23, 47, 3, 35, 19, 51, 11, 43, 27, 55, 7, 39, 23, 55, 15, 47, 31, 63, 1, 3, 3, 67, 3, 11, 35, 71, 3, 7
Offset: 0

Views

Author

Rémy Sigrist, Oct 15 2022

Keywords

Comments

Let s(n) be the set of terms in the n-th row of A133457 (with s(0) = {}).
a(n) is the least k such that s(n) is the image of s(k) under some nonconstant linear function.

Examples

			The first terms, alongside their binary expansions, 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     3     101         11
   6     3     110         11
   7     7     111        111
   8     1    1000          1
   9     3    1001         11
  10     3    1010         11
  11    11    1011       1011
  12     3    1100         11
  13    11    1101       1011
  14     7    1110        111
  15    15    1111       1111
  16     1   10000          1
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

A000120(a(n)) = A000120(n).
a(a(n)) = a(n).
a(2*n) = a(n).
a(A030101(n)) = a(n).
a(n) = 1 iff n is a power of 2.
a(n) = 3 iff n belongs to A018900.
a(2^k - 1) = 2^k - 1 for any k >= 0.

A359527 Nonnegative numbers k such that if 2^i and 2^j appear in the binary expansion of k, then 2^(i OR j) also appears in the binary expansion of k (where OR denotes the bitwise OR operator).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 32, 33, 34, 35, 48, 49, 50, 51, 64, 65, 68, 69, 80, 81, 84, 85, 128, 129, 130, 131, 132, 133, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 152, 153, 160, 161, 162, 163, 164, 165, 168, 169, 170, 171
Offset: 1

Views

Author

Rémy Sigrist, Jan 04 2023

Keywords

Comments

Equivalently, numbers whose binary expansions encode union-closed finite sets of finite sets of nonnegative integers:
- the encoding is based on a double application of A133457,
- for example: 11 -> {0, 1, 3} -> {{}, {0}, {0, 1}},
- a union-closed set f satisfies: for any i and j in f, the union of i and j belongs to f.
For any k >= 0, 2*k belongs to the sequence iff 2*k+1 belongs to the sequence.
This sequence has similarities with A190939; here we consider the bitwise OR operator, there the bitwise XOR operator.
This sequence is infinite as it contains the powers of 2.

Examples

			The first terms, alongside the corresponding union-closed sets, are:
  n     a(n)   Union-closed set
  ----  -----  ----------------------
     1      0  {}
     2      1  {{}}
     3      2  {{0}}
     4      3  {{}, {0}}
     5      4  {{1}}
     6      5  {{}, {1}}
     7      8  {{0, 1}}
     8      9  {{}, {0, 1}}
     9     10  {{0}, {0, 1}}
    10     11  {{}, {0}, {0, 1}}
    11     12  {{1}, {0, 1}}
    12     13  {{}, {1}, {0, 1}}
    13     14  {{0}, {1}, {0, 1}}
    14     15  {{}, {0}, {1}, {0, 1}}
    15     16  {{2}}
    16     17  {{}, {2}}
    17     32  {{0, 2}}
		

Crossrefs

Cf. A133457, A190939 (XOR analog), A359528 (AND analog).

Programs

  • PARI
    is(n) = { my (b=vector(hammingweight(n))); for (i=1, #b, n -= 2^b[i] = valuation(n,2)); setbinop(bitor, b)==b }

A359528 Nonnegative numbers k such that if 2^i and 2^j appear in the binary expansion of k, then 2^(i AND j) also appears in the binary expansion of k (where AND denotes the bitwise AND operator).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 19, 21, 23, 25, 27, 29, 31, 32, 33, 34, 35, 37, 39, 42, 43, 47, 48, 49, 51, 53, 55, 59, 63, 64, 65, 67, 68, 69, 71, 76, 77, 79, 80, 81, 83, 85, 87, 93, 95, 112, 113, 115, 117, 119, 127, 128, 129, 130, 131
Offset: 1

Views

Author

Rémy Sigrist, Jan 04 2023

Keywords

Comments

Equivalently, numbers whose binary expansions encode intersection-closed finite sets of finite sets of nonnegative integers:
- the encoding is based on a double application of A133457,
- for example: 11 -> {0, 1, 3} -> {{}, {0}, {0, 1}},
- an intersection-closed set f satisfies: for any i and j in f, the intersection of i and j belongs to f.
For any k >= 0, if 2*k belongs to the sequence then 2*k+1 belongs to the sequence.
This sequence has similarities with A190939; here we consider the bitwise AND operator, there the bitwise XOR operator.
This sequence is infinite as it contains the powers of 2.

Examples

			The first terms, alongside the corresponding intersection-closed sets, are:
  n     a(n)   Intersection-closed set
  ----  -----  -----------------------
     0      0  {}
     1      1  {{}}
     2      2  {{0}}
     3      3  {{}, {0}}
     4      4  {{1}}
     5      5  {{}, {1}}
     6      7  {{}, {0}, {1}}
     7      8  {{0, 1}}
     8      9  {{}, {0, 1}}
     9     10  {{0}, {0, 1}}
    10     11  {{}, {0}, {0, 1}}
    11     12  {{1}, {0, 1}}
    12     13  {{}, {1}, {0, 1}}
    13     15  {{}, {0}, {1}, {0, 1}}
    14     16  {{2}}
    15     17  {{}, {2}}
    16     19  {{}, {0}, {2}}
    17     21  {{}, {1}, {2}}
		

Crossrefs

Cf. A133457, A190939 (XOR analog), A359527 (OR analog).

Programs

  • PARI
    is(n) = { my (b=vector(hammingweight(n))); for (i=1, #b, n -= 2^b[i] = valuation(n,2)); setbinop(bitand, b)==b }

A365143 Proper dimension of the polyomino with code A365142(n).

Original entry on oeis.org

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

Views

Author

Pontus von Brömssen, Aug 25 2023

Keywords

Comments

Can be read as an irregular triangle, whose n-th row contains A005519(n) terms. The first term of the n-th row is A000720(n). The number of times d occurs in the n-th row is A049430(n,d).

Examples

			As an irregular triangle:
  0;
  1;
  2, 1;
  2, 3, 2, 2, 2, 3, 1;
  3, 2, 3, 3, 4, 4, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 2, 3, 2, 2, 2, 3, 3, 4, 1, 2;
  ...
For the 4th row, the seven 4-cell polyominoes, with codes 15, 23, 39, 43, 46, 51, 139 (4th row of A365142), are the L-tetromino, the properly 3-dimensional nonchiral tetracube, the square tetromino, the T-tetromino, the S-tetromino, the properly 3-dimensional chiral tetracube, and the straight tetromino, with proper dimensions 2, 3, 2, 2, 2, 3, 1, respectively.
		

Crossrefs

Formula

a(n) = max_{1<=i<=m} A061395(e_i+1), where A365142(n) = Sum_{1<=i<=m} 2^e_i and e_1 < ... < e_m != 0 (i.e., (e_1, ..., e_m) is the A365142(n)-th row of A133457).
Previous Showing 21-30 of 33 results. Next