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.

A253317 Indices in A261283 where records occur.

Original entry on oeis.org

0, 1, 2, 3, 8, 9, 10, 11, 128, 129, 130, 131, 136, 137, 138, 139, 32768, 32769, 32770, 32771, 32776, 32777, 32778, 32779, 32896, 32897, 32898, 32899, 32904, 32905, 32906, 32907, 2147483648, 2147483649, 2147483650, 2147483651, 2147483656, 2147483657
Offset: 1

Views

Author

Philippe Beaudoin, Dec 30 2014

Keywords

Comments

From Gus Wiseman, Dec 29 2023: (Start)
These are numbers whose binary indices are all powers of 2, where a binary index of n (row n of A048793) is any position of a 1 in its reversed binary expansion. For example, the terms together with their binary expansions and binary indices begin:
0: 0 ~ {}
1: 1 ~ {1}
2: 10 ~ {2}
3: 11 ~ {1,2}
8: 1000 ~ {4}
9: 1001 ~ {1,4}
10: 1010 ~ {2,4}
11: 1011 ~ {1,2,4}
128: 10000000 ~ {8}
129: 10000001 ~ {1,8}
130: 10000010 ~ {2,8}
131: 10000011 ~ {1,2,8}
136: 10001000 ~ {4,8}
137: 10001001 ~ {1,4,8}
138: 10001010 ~ {2,4,8}
139: 10001011 ~ {1,2,4,8}
For powers of 3 we have A368531.
(End)

Crossrefs

Cf. A053644 (most significant bit).
A048793 lists binary indices, length A000120, sum A029931.
A070939 gives length of binary expansion.
A096111 gives product of binary indices.

Programs

  • Maple
    a := proc(n) local k, A:
    A := [seq(0,i=1..n)]: A[1]:=0:
    for k from 1 to n-1 do
       A[k+1] := A[k-2^ilog2(k)+1]+2^(2^ilog2(k)-1): od:
    return A[n]: end proc: # Lorenzo Sauras Altuzarra, Dec 18 2019
    # second Maple program:
    a:= n-> (l-> add(l[i+1]*2^(2^i-1), i=0..nops(l)-1))(Bits[Split](n-1)):
    seq(a(n), n=1..38);  # Alois P. Heinz, Dec 13 2023
  • Mathematica
    Nest[Append[#1, #1[[-#2]] + 2^(#2 - 1)] & @@ {#, 2^(IntegerLength[Length[#], 2] - 1)} &, {0, 1}, 36] (* Michael De Vlieger, May 08 2020 *)
  • PARI
    a(n)={if(n<=1, 0, my(t=1<Andrew Howroyd, Dec 20 2019

Formula

a(1) = 0 and a(n) = a(n-A053644(n-1)) + 2^(A053644(n-1)-1). - Lorenzo Sauras Altuzarra, Dec 18 2019
a(n) = A358126(n-1) / 2. - Tilman Piesk, Dec 18 2022
a(2^n+1) = 2^(2^n-1) = A058891(n+1). - Gus Wiseman, Dec 29 2023
a(2^n) = A072639(n). - Gus Wiseman, Dec 29 2023
G.f.: 1/(1-x) * Sum_{k>=0} (2^(-1+2^k))*x^2^k/(1+x^2^k). - John Tyler Rascoe, May 22 2024

Extensions

Corrected reference in name from A253315 to A261283. - Tilman Piesk, Dec 18 2022

A261283 a(n) = bitwise XOR of all the bit numbers for the bits that are set in n, using number 1 for the LSB.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Aug 14 2015, following the original version A253315 by Philippe Beaudoin, Dec 30 2014

Keywords

Comments

If the least significant bit is numbered 0, then a(2n) = a(2n+1) if one uses the "natural" definition reading "...set in n": see A253315 for that version. To avoid the duplication, we chose here to start numbering the bits with 1 for the LSB; equivalently, we can start numbering the bits with 0 but use the definition "...bits set in 2n". In any case, a(n) = A253315(2n) = A253315(2n+1).
Since the XOR operation is associative, one can define XOR of an arbitrary number of terms in a recursive way, there is no ambiguity about the order in which the operations are performed.

Examples

			a(7) = a(4+2+1) = a(2^2+2^1+2^0) = (2+1) XOR (1+1) XOR (0+1) = 3 XOR 3 = 0.
a(12) = a(8+4) = a(2^3+2^2) = (3+1) XOR (2+1) = 4+3 = 7.
		

Crossrefs

Cf. A075926 (indices of 0's), A253315, A327041 (OR equivalent).

Programs

  • Mathematica
    A261283[n_] := If[n == 0, 0, BitXor @@ PositionIndex[Reverse[IntegerDigits[n, 2]]][1]]; Array[A261283, 100, 0] (* Paolo Xausa, May 29 2024 *)
  • PARI
    A261283(n,b=bittest(n,0))={for(i=1,#binary(n),bittest(n,i)&&b=bitxor(b,i+1));b}

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.)

A341242 Numbers whose binary representation encodes a subset S of the natural numbers such that the XOR of the binary representations of all s in S gives 0.

Original entry on oeis.org

0, 1, 14, 15, 50, 51, 60, 61, 84, 85, 90, 91, 102, 103, 104, 105, 150, 151, 152, 153, 164, 165, 170, 171, 194, 195, 204, 205, 240, 241, 254, 255, 770, 771, 780, 781, 816, 817, 830, 831, 854, 855, 856, 857, 868, 869, 874, 875, 916, 917, 922, 923, 934, 935, 936
Offset: 1

Views

Author

Marc A. A. van Leeuwen, Feb 07 2021

Keywords

Comments

The numbers for which the set S of positions of bits 1 in the binary representation, interpreted as a set of distinct-sized Nim heaps (including a possible uninteresting size 0 heap for the least significant bit) is losing for the player to move.
Viewing the list as a set of valid code words, every natural number N can be "corrected" to a valid code word by changing exactly one bit, in exactly one way. The position of that bit is found by computing for N the XOR of its raised-bit positions of the title (if the result is 0, then N is already valid but flipping the irrelevant bit 0 makes it valid again).
The "error correcting" interpretation, applied to 64-bit numbers interpreted as orientation of 64 coins, corresponds to a solution of the "coins on a chessboard" puzzle described in the Nick Berry's blog, and also mentioned at A253315.
Numbers 2*n and 2*n+1 for n = A075926(m).
Numbers m such that A253315(m) = 0. - Rémy Sigrist, Feb 09 2021

Crossrefs

Programs

  • Python
    def ok(n):
      xor, b = 0, (bin(n)[2:])[::-1]
      for i, c in enumerate(b):
        if c == '1': xor ^= i
      return xor == 0
    print([m for m in range(937) if ok(m)]) # Michael S. Branicky, Feb 07 2021

Formula

a(2*n+1) = 2*A075926(n), a(2*n+2) = 2*A075926(n) + 1 for any n >= 0. - Rémy Sigrist, Feb 09 2021
Showing 1-4 of 4 results.