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 11-14 of 14 results.

A355340 a(0) = 0; for n >= 1, a(n) = a(n-1) XOR A001511(n), where XOR denotes bitwise exclusive-or (A003987) and A001511 is the binary ruler function.

Original entry on oeis.org

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

Views

Author

Peter Munn, Jun 29 2022

Keywords

Comments

Related to the Thue-Morse sequence, A010060, which gives the rightmost binary bit of each term. The next bit is given by the closely related A269723.
If we replace A001511(n) in the definition by A006519(n) = 2^(A001511(n)-1) we get Gray code (A003188).
Interesting symmetries of the sequence seem more apparent with the terms aligned in suitable periods, such as the arrangement in the example section.

Examples

			Initial terms arranged in periods of 16, with deliberate periodic spacing:
  0,1,3,2,  1,0,2,3,     7,6,4,5,  6,7,5,4,
  1,0,2,3,  0,1,3,2,     6,7,5,4,  7,6,4,5,
  3,2,0,1,  2,3,1,0,     4,5,7,6,  5,4,6,7,
  2,3,1,0,  3,2,0,1,     5,4,6,7,  4,5,7,6,
.
  1,0,2,3,  0,1,3,2,     6,7,5,4,  7,6,4,5,
  0,1,3,2,  1,0,2,3,     7,6,4,5,  6,7,5,4,
  2,3,1,0,  3,2,0,1,     5,4,6,7,  4,5,7,6,
  3,2,0,1,  2,3,1,0,     4,5,7,6,  5,4,6,7,
...
Note that when the arrangement is partitioned regularly into 2 X 2, 4 X 4 or 8 X 8 squares, the terms on any diagonal of a square share the same value. Note also the symmetry of the terms on the squares' circumferences.
		

Crossrefs

Comparable sequences: A010060, A261283, A269723.
Positions of: odd numbers: A000069, even numbers: A001969, previously unseen numbers: A253317 (apparently).

Programs

  • Mathematica
    Block[{k = 0}, NestList[BitXor[#, IntegerExponent[k += 2, 2]] &, 0, 100]] (* Paolo Xausa, May 29 2024 *)

Formula

A010060(n) = a(n) mod 2.
A269723(n) = floor(a(n)/2) mod 2.

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

A368531 Numbers whose binary indices are all powers of 3, where a binary index of n (row n of A048793) is any position of a 1 in its reversed binary expansion.

Original entry on oeis.org

0, 1, 4, 5, 256, 257, 260, 261, 67108864, 67108865, 67108868, 67108869, 67109120, 67109121, 67109124, 67109125, 1208925819614629174706176, 1208925819614629174706177, 1208925819614629174706180, 1208925819614629174706181, 1208925819614629174706432
Offset: 1

Views

Author

Gus Wiseman, Dec 29 2023

Keywords

Comments

For powers of 2 instead of 3 we have A253317.

Examples

			The terms together with their binary expansions and binary indices begin:
         0:                           0 ~ {}
         1:                           1 ~ {1}
         4:                         100 ~ {3}
         5:                         101 ~ {1,3}
       256:                   100000000 ~ {9}
       257:                   100000001 ~ {1,9}
       260:                   100000100 ~ {3,9}
       261:                   100000101 ~ {1,3,9}
  67108864: 100000000000000000000000000 ~ {27}
  67108865: 100000000000000000000000001 ~ {1,27}
  67108868: 100000000000000000000000100 ~ {3,27}
  67108869: 100000000000000000000000101 ~ {1,3,27}
  67109120: 100000000000000000100000000 ~ {9,27}
  67109121: 100000000000000000100000001 ~ {1,9,27}
  67109124: 100000000000000000100000100 ~ {3,9,27}
  67109125: 100000000000000000100000101 ~ {1,3,9,27}
		

Crossrefs

A000244 lists powers of 3.
A048793 lists binary indices, length A000120, sum A029931.
A070939 gives length of binary expansion.
A096111 gives product of binary indices.

Programs

  • Mathematica
    Select[Range[0,10000],IntegerQ[Log[3,Times@@Join@@Position[Reverse[IntegerDigits[#,2]],1]]]&]
    (* Second program *)
    {0}~Join~Array[FromDigits[Reverse@ ReplacePart[ConstantArray[0, Max[#]], Map[# -> 1 &, #]], 2] &[3^(Position[Reverse@ IntegerDigits[#, 2], 1][[;; , 1]] - 1)] &, 255] (* Michael De Vlieger, Dec 29 2023 *)

Formula

a(3^n) = 2^(3^n - 1).

A371290 Numbers whose product of binary indices is a prime power > 1.

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 9, 10, 11, 16, 17, 64, 65, 128, 129, 130, 131, 136, 137, 138, 139, 256, 257, 260, 261, 1024, 1025, 4096, 4097, 32768, 32769, 32770, 32771, 32776, 32777, 32778, 32779, 32896, 32897, 32898, 32899, 32904, 32905, 32906, 32907, 65536, 65537, 262144
Offset: 1

Views

Author

Gus Wiseman, Mar 27 2024

Keywords

Comments

A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793.

Examples

			The terms together with their binary expansions and binary indices begin:
       1:                   1 ~ {1}
       2:                  10 ~ {2}
       3:                  11 ~ {1,2}
       4:                 100 ~ {3}
       5:                 101 ~ {1,3}
       8:                1000 ~ {4}
       9:                1001 ~ {1,4}
      10:                1010 ~ {2,4}
      11:                1011 ~ {1,2,4}
      16:               10000 ~ {5}
      17:               10001 ~ {1,5}
      64:             1000000 ~ {7}
      65:             1000001 ~ {1,7}
     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}
     256:           100000000 ~ {9}
     257:           100000001 ~ {1,9}
     260:           100000100 ~ {3,9}
     261:           100000101 ~ {1,3,9}
    1024:         10000000000 ~ {11}
    1025:         10000000001 ~ {1,11}
    4096:       1000000000000 ~ {13}
    4097:       1000000000001 ~ {1,13}
   32768:    1000000000000000 ~ {16}
		

Crossrefs

For powers of 2 we have A253317.
For prime indices we have A320698.
For squarefree numbers instead of prime powers we have A371289.
A000040 lists prime numbers.
A000961 lists prime-powers.
A048793 lists binary indices, A000120 length, A272020 reverse, A029931 sum.
A070939 gives length of binary expansion.
A096111 gives product of binary indices.

Programs

  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    Select[Range[1000],#==1||PrimePowerQ[Times@@bpe[#]]&]
Previous Showing 11-14 of 14 results.