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-6 of 6 results.

A057889 Bijective bit-reverse of n: keep the trailing zeros in the binary expansion of n fixed, but reverse all the digits up to that point.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 12, 11, 14, 15, 16, 17, 18, 25, 20, 21, 26, 29, 24, 19, 22, 27, 28, 23, 30, 31, 32, 33, 34, 49, 36, 41, 50, 57, 40, 37, 42, 53, 52, 45, 58, 61, 48, 35, 38, 51, 44, 43, 54, 59, 56, 39, 46, 55, 60, 47, 62, 63, 64, 65, 66, 97, 68, 81, 98, 113
Offset: 0

Views

Author

Marc LeBrun, Sep 25 2000

Keywords

Comments

The original name was "Bit-reverse of n, including as many leading as trailing zeros." - Antti Karttunen, Dec 25 2024
A permutation of integers consisting only of fixed points and pairs. a(n)=n when n is a binary palindrome (including as many leading as trailing zeros), otherwise a(n)=A003010(n) (i.e. n has no axis of symmetry). A057890 gives the palindromes (fixed points, akin to A006995) while A057891 gives the "antidromes" (pairs). See also A280505.
This is multiplicative in domain GF(2)[X], i.e. with carryless binary arithmetic. A193231 is another such permutation of natural numbers. - Antti Karttunen, Dec 25 2024

Examples

			a(6)=6 because 0110 is a palindrome, but a(11)=13 because 1011 reverses into 1101.
		

Crossrefs

Cf. A030101, A000265, A006519, A006995, A057890, A057891, A280505, A280508, A331166 [= min(n,a(n))], A366378 [k for which a(k) = k (mod 3)], A369044 [= A014963(a(n))].
Similar permutations for other bases: A263273 (base-3), A264994 (base-4), A264995 (base-5), A264979 (base-9).
Other related (binary) permutations: A056539, A193231.
Compositions of this permutation with other binary (or other base-related) permutations: A264965, A264966, A265329, A265369, A379471, A379472.
Compositions with permutations involving prime factorization: A245450, A245453, A266402, A266404, A293448, A366275, A366276.
Other derived permutations: A246200 [= a(3*n)/3], A266351, A302027, A302028, A345201, A356331, A356332, A356759, A366389.
See also A235027 (which is not a permutation).

Programs

  • Mathematica
    Table[FromDigits[Reverse[IntegerDigits[n, 2]], 2]*2^IntegerExponent[n, 2], {n, 71}] (* Ivan Neretin, Jul 09 2015 *)
  • PARI
    A030101(n) = if(n<1,0,subst(Polrev(binary(n)),x,2));
    A057889(n) = if(!n,n,A030101(n/(2^valuation(n,2))) * (2^valuation(n, 2))); \\ Antti Karttunen, Dec 25 2024
  • Python
    def a(n):
        x = bin(n)[2:]
        y = x[::-1]
        return int(str(int(y))+(len(x) - len(str(int(y))))*'0', 2)
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 11 2017
    
  • Python
    def A057889(n): return int(bin(n>>(m:=(~n&n-1).bit_length()))[-1:1:-1],2)<Chai Wah Wu, Dec 25 2024
    

Formula

a(n) = A030101(A000265(n)) * A006519(n), with a(0)=0.

Extensions

Clarified the name with May 30 2016 comment from N. J. A. Sloane, and moved the old name to the comments - Antti Karttunen, Dec 25 2024

A280506 Nonpalindromic part of n in base 2 (with carryless GF(2)[X] factorization): a(n) = A280500(n,A280505(n)).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 13, 1, 1, 1, 1, 1, 19, 1, 1, 11, 13, 1, 25, 13, 1, 1, 11, 1, 1, 1, 1, 1, 13, 1, 37, 19, 11, 1, 41, 1, 25, 11, 1, 13, 47, 1, 11, 25, 1, 13, 19, 1, 55, 1, 13, 11, 59, 1, 61, 1, 1, 1, 1, 1, 67, 1, 69, 13, 61, 1, 1, 37, 13, 19, 59, 11, 25, 1, 81, 41, 11, 1, 1, 25, 87, 11, 55, 1, 91, 13, 1, 47, 19, 1, 97, 11, 1, 25, 13, 1, 103
Offset: 1

Views

Author

Antti Karttunen, Jan 09 2017

Keywords

Comments

a(n) = number obtained when the maximal base-2 palindromic divisor of n, A280505(n), is divided out of n with carryless GF(2)[X] factorization (see examples of A280500 for the explanation).
Apart from 1, all terms are present in A164861 (form their proper subset).

Crossrefs

Programs

Formula

a(n) = A280500(n,A280505(n)).
Other identities. For all n >= 1:
a(2n) = a(A000265(n)) = a(n).
A048720(a(n), A280505(n)) = n.

Extensions

Erroneous claim removed from comments by Antti Karttunen, May 13 2018

A327971 Bitwise XOR of trajectories of rule 30 and its mirror image, rule 86, when both are started from a lone 1 cell: a(n) = A110240(n) XOR A265281(n).

Original entry on oeis.org

0, 0, 10, 20, 130, 396, 2842, 4420, 38610, 124220, 684490, 1385044, 8891330, 26281036, 192525274, 269101060, 2454365330, 8588410876, 43860512138, 89059958420, 551714970626, 1663794165260, 12235920695450, 19683098342340, 164315052318034, 538162708968636, 2894532467106378, 6192136868790228, 37503903254935874, 114926395086966988, 814341599153559130
Offset: 0

Views

Author

Antti Karttunen, Oct 03 2019

Keywords

Comments

Each term is a binary palindrome when its trailing zeros (in base 2) are omitted, that is, a term of A057890.
Compare the binary string illustrations drawn for the first 1024 terms of this sequence and for A327976, which has almost the same definition.

Crossrefs

Cf. A003987, A030101, A057890, A110240, A265281, A280508, A328106 (binary weight of terms).
Cf. also A327972, A327973, A327976, A328103, A328104 for other such combinations.

Programs

Formula

a(n) = A110240(n) XOR A265281(n).
a(n) = A280508(A110240(n)) = A110240(n) XOR A030101(A110240(n)).
a(n) = A280508(A265281(n)) = A265281(n) XOR A030101(A265281(n)).
For n >= 1, a(n) = (1/2) * (A327973(n-1) XOR A327976(n-1)).

A328106 Binary weight of A327971: a(n) = A000120(A110240(n) XOR A030101(A110240(n))).

Original entry on oeis.org

0, 0, 2, 2, 2, 4, 6, 4, 8, 10, 10, 8, 12, 8, 18, 6, 12, 26, 16, 18, 14, 18, 20, 22, 22, 26, 26, 38, 30, 26, 36, 26, 28, 36, 28, 18, 28, 42, 36, 32, 34, 40, 44, 38, 40, 50, 48, 48, 50, 58, 46, 56, 48, 42, 54, 48, 56, 56, 46, 54, 48, 52, 60, 58, 78, 74, 64, 60, 66, 74, 74, 64, 80, 74, 80, 62, 92, 62, 80, 70, 68, 100, 90, 82, 80, 92
Offset: 0

Views

Author

Antti Karttunen, Oct 05 2019

Keywords

Comments

a(n) is the number of times the k-th cell from the left is different from the k-th cell from the right, at the generation n of Rule 30 1-D cellular automaton, when it is started from a single alive cell.
All terms are even.

Examples

			The evolution of one-dimensional cellular automaton rule 30 proceeds as follows, when started from a single alive (1) cell:
---------------------------------------------- a(n)
   0:              (1)                          0
   1:             1(1)1                         0
   2:            11(0)01                        2
   3:           110(1)111                       2
   4:          1100(1)0001                      2
   5:         11011(1)10111                     4
   6:        110010(0)001001                    6
   7:       1101111(0)0111111                   4
   8:      11001000(1)11000001                  8
   9:     110111101(1)001000111                10
  10:    1100100001(0)1111011001               10
  11:   11011110011(0)10000101111               8
  12:  110010001110(0)110011010001             12
  13: 1101111011001(1)1011100110111             8
When we count the times the k-th cell from the left is different from the k-th cell from the right, we obtain a(n). Note that the central cells (indicated with parentheses) do not affect the count, as the central cell is always equal to itself.
		

Crossrefs

Programs

Formula

a(n) = Sum_{i=0..2n} abs(A070950(n,i)-A070950(n,n-i)).

A280507 a(n) = n XOR A193231(n).

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 0, 0, 7, 7, 6, 6, 6, 6, 7, 7, 1, 1, 0, 0, 0, 0, 1, 1, 6, 6, 7, 7, 7, 7, 6, 6, 19, 19, 18, 18, 18, 18, 19, 19, 20, 20, 21, 21, 21, 21, 20, 20, 18, 18, 19, 19, 19, 19, 18, 18, 21, 21, 20, 20, 20, 20, 21, 21, 21, 21, 20, 20, 20, 20, 21, 21, 18, 18, 19, 19, 19, 19, 18, 18, 20, 20, 21, 21, 21, 21, 20, 20, 19, 19, 18, 18, 18, 18, 19, 19, 6, 6
Offset: 0

Views

Author

Antti Karttunen, Jan 09 2017

Keywords

Crossrefs

Cf. A118666 (positions of zeros).

Programs

Formula

a(n) = A003987(n,A193231(n)) = n XOR A193231(n).
Other identities. For all n >= 0:
a(A193231(n)) = a(n).

A280509 a(n) = A051064(A246200(n)); 3-adic valuation of A057889(3*n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 09 2017

Keywords

Crossrefs

Differs from A051064 for the first time at n=23, where a(23) = 4, while A051064(23) = 1.
Cf. also A265331.

Programs

Formula

a(n) = A007949(A057889(3*n)).
a(n) = A051064(A246200(n)).
Showing 1-6 of 6 results.