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

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

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

A091255 Square array computed from gcd(P(x),P(y)) where P(x) and P(y) are polynomials with coefficients in {0,1} given by the binary expansions of x and y, and the polynomial calculation is done over GF(2), with the result converted back to a binary number, and then expressed in decimal. Array is symmetric, and is read by falling antidiagonals.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 03 2004

Keywords

Comments

Array is read by antidiagonals, with (x,y) = (1,1), (1,2), (2,1), (1,3), (2,2), (3,1), ...
Analogous to A003989.
"Coded in binary" means that a polynomial a(n)*X^n+...+a(0)*X^0 over GF(2) is represented by the binary number a(n)*2^n+...+a(0)*2^0 in Z (where a(k)=0 or 1).

Examples

			The top left 17 X 17 corner of the array:
      1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17
    +---------------------------------------------------------------
   1: 1, 1, 1, 1, 1, 1, 1, 1, 1,  1,  1,  1,  1,  1,  1,  1,  1, ...
   2: 1, 2, 1, 2, 1, 2, 1, 2, 1,  2,  1,  2,  1,  2,  1,  2,  1, ...
   3: 1, 1, 3, 1, 3, 3, 1, 1, 3,  3,  1,  3,  1,  1,  3,  1,  3, ...
   4: 1, 2, 1, 4, 1, 2, 1, 4, 1,  2,  1,  4,  1,  2,  1,  4,  1, ...
   5: 1, 1, 3, 1, 5, 3, 1, 1, 3,  5,  1,  3,  1,  1,  5,  1,  5, ...
   6: 1, 2, 3, 2, 3, 6, 1, 2, 3,  6,  1,  6,  1,  2,  3,  2,  3, ...
   7: 1, 1, 1, 1, 1, 1, 7, 1, 7,  1,  1,  1,  1,  7,  1,  1,  1, ...
   8: 1, 2, 1, 4, 1, 2, 1, 8, 1,  2,  1,  4,  1,  2,  1,  8,  1, ...
   9: 1, 1, 3, 1, 3, 3, 7, 1, 9,  3,  1,  3,  1,  7,  3,  1,  3, ...
  10: 1, 2, 3, 2, 5, 6, 1, 2, 3, 10,  1,  6,  1,  2,  5,  2,  5, ...
  11: 1, 1, 1, 1, 1, 1, 1, 1, 1,  1, 11,  1,  1,  1,  1,  1,  1, ...
  12: 1, 2, 3, 4, 3, 6, 1, 4, 3,  6,  1, 12,  1,  2,  3,  4,  3, ...
  13: 1, 1, 1, 1, 1, 1, 1, 1, 1,  1,  1,  1, 13,  1,  1,  1,  1, ...
  14: 1, 2, 1, 2, 1, 2, 7, 2, 7,  2,  1,  2,  1, 14,  1,  2,  1, ...
  15: 1, 1, 3, 1, 5, 3, 1, 1, 3,  5,  1,  3,  1,  1, 15,  1, 15, ...
  16: 1, 2, 1, 4, 1, 2, 1, 8, 1,  2,  1,  4,  1,  2,  1, 16,  1, ...
  17: 1, 1, 3, 1, 5, 3, 1, 1, 3,  5,  1,  3,  1,  1,  15, 1, 17, ...
  ...
3, which is "11" in binary, encodes polynomial X + 1, while 7 ("111" in binary) encodes polynomial X^2 + X + 1, whereas 9 ("1001" in binary), encodes polynomial X^3 + 1. Now (X + 1)(X^2 + X + 1) = (X^3 + 1) when the polynomials are multiplied over GF(2), or equally, when multiplication of integers 3 and 7 is done as a carryless base-2 product (A048720(3,7) = 9). Thus it follows that A(3,9) = A(9,3) = 3 and A(7,9) = A(9,7) = 7.
Furthermore, 5 ("101" in binary) encodes polynomial X^2 + 1 which is equal to (X + 1)(X + 1) in GF(2)[X], thus A(5,9) = A(9,5) = 3, as the irreducible polynomial (X + 1) is the only common factor for polynomials X^2 + 1 and X^3 + 1.
		

Crossrefs

Cf. also A327856 (the upper left triangular section of this array), A327857.

Programs

  • PARI
    A091255sq(a,b) = fromdigits(Vec(lift(gcd(Pol(binary(a))*Mod(1, 2),Pol(binary(b))*Mod(1, 2)))),2); \\ Antti Karttunen, Aug 12 2019

Formula

A(x,y) = A(y,x) = A(x, A003987(x,y)) = A(A003987(x,y), y), where A003987 gives the bitwise-XOR of its two arguments. - Antti Karttunen, Sep 28 2019

Extensions

Data section extended up to a(105), examples added by Antti Karttunen, Sep 28 2019

A280508 a(n) = n XOR A057889(n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 6, 0, 0, 0, 0, 0, 10, 0, 0, 12, 10, 0, 10, 12, 0, 0, 10, 0, 0, 0, 0, 0, 18, 0, 12, 20, 30, 0, 12, 0, 30, 24, 0, 20, 18, 0, 18, 20, 0, 24, 30, 0, 12, 0, 30, 20, 12, 0, 18, 0, 0, 0, 0, 0, 34, 0, 20, 36, 54, 0, 0, 24, 34, 40, 20, 60, 54, 0, 20, 24, 54, 0, 0, 60, 34, 48, 20, 0, 54, 40, 0, 36, 34, 0, 34, 36, 0, 40, 54, 0, 20, 48
Offset: 0

Views

Author

Antti Karttunen, Jan 09 2017

Keywords

Crossrefs

Cf. A057890 (positions of zeros).

Programs

Formula

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

A280501 "Blue kernel" of n: a(n) = A091255(n, A193231(n)).

Original entry on oeis.org

1, 1, 1, 1, 1, 6, 7, 1, 7, 6, 1, 6, 1, 7, 1, 1, 1, 18, 19, 20, 21, 1, 1, 6, 1, 1, 7, 7, 1, 6, 1, 1, 1, 6, 7, 18, 1, 19, 1, 20, 1, 21, 1, 1, 7, 6, 1, 6, 7, 1, 1, 1, 19, 18, 1, 7, 1, 6, 1, 20, 1, 1, 21, 1, 21, 6, 1, 20, 1, 7, 1, 18, 1, 1, 1, 19, 1, 6, 7, 20, 1, 1, 7, 21, 1, 6, 1, 1, 1, 18, 1, 6, 7, 1, 19, 6, 1, 7, 1, 1, 7, 6, 1, 1, 1, 106, 107, 108, 109, 1, 1, 7
Offset: 1

Views

Author

Antti Karttunen, Jan 09 2017

Keywords

Crossrefs

Programs

Formula

a(n) = A091255(n, A193231(n)).
Other identities. For all n >= 1:
a(A193231(n)) = a(n).
A048720(a(n), A280502(n)) = n.

A331166 a(n) = min(n, A057889(n)), where A057889 is bijective base-2 reverse.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 19, 22, 27, 28, 23, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 37, 42, 43, 44, 45, 46, 47, 48, 35, 38, 51, 44, 43, 54, 55, 56, 39, 46, 55, 60, 47, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 69, 74, 83, 84, 85, 86, 87, 88, 77, 90, 91, 92, 93, 94, 95, 96, 67, 70
Offset: 0

Views

Author

Antti Karttunen, Jan 12 2020

Keywords

Comments

There is a large number of sequences b, related to binary expansion of n (A007088), for which it holds that b(n) = b(a(n)) for all n >= 0 (or n >= 1). For example, we have:
For all i, j:
a(i) = a(j) => A002487(i) = A002487(j),
a(i) = a(j) => A005811(i) = A005811(j),
a(i) = a(j) => A286622(i) = A286622(j) => A000120(i) = A000120(j).
For all i, j > 0:
a(i) = a(j) => A007814(i) = A007814(j),
a(i) = a(j) => A280505(i) = A280505(j),
a(i) = a(j) => A305788(i) = A305788(j) => A091222(i) = A091222(j).

Crossrefs

Programs

Formula

a(n) = min(n, A057889(n)).

A280503 a(n) = A091255(n,A056539(n)).

Original entry on oeis.org

1, 2, 3, 2, 5, 2, 7, 2, 9, 10, 1, 12, 1, 2, 15, 2, 17, 2, 1, 2, 21, 2, 3, 4, 1, 2, 27, 4, 3, 2, 31, 2, 33, 6, 7, 18, 1, 38, 5, 6, 1, 42, 3, 2, 45, 6, 1, 12, 7, 2, 51, 52, 3, 18, 1, 56, 5, 6, 1, 12, 1, 2, 63, 2, 65, 2, 1, 2, 1, 2, 3, 2, 73, 2, 15, 2, 3, 2, 7, 2, 1, 2, 9, 2, 85, 2, 1, 2, 3, 2, 1, 2, 93, 2, 5, 4, 1, 2, 99, 4, 9, 2, 1, 4, 15, 2, 107, 4, 1, 2, 3, 8
Offset: 1

Views

Author

Antti Karttunen, Jan 09 2017

Keywords

Crossrefs

Programs

Formula

a(n) = A091255(n,A056539(n)).
Other identities. For all n >= 1:
a(A056539(n)) = a(n).
A048720(a(n), A280504(n)) = n.

A178226 Characteristic function of A154809 (numbers that are not binary palindromes).

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1
Offset: 0

Views

Author

Jeremy Gardiner, May 23 2010

Keywords

Comments

a(n)=1 if n is in A154809, a(n)=0 otherwise.
Identical to parity of A086757 (Smallest prime p such that n is a palindrome in base p representation)

Crossrefs

Programs

  • Mathematica
    Table[If[IntegerDigits[n,2]==Reverse[IntegerDigits[n,2]],0,1],{n,0,120}] (* Harvey P. Dale, Aug 07 2023 *)
  • PARI
    A178226(n) = (n!=subst(Polrev(binary(n)),x,2)); \\ Antti Karttunen, Dec 15 2017

Formula

a(n) = 1 - A178225(n). - Antti Karttunen, Dec 15 2017
Showing 1-8 of 8 results.