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

A246200 Self-inverse permutation of natural numbers: a(n) = A057889(3*n) / 3.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 19, 14, 15, 16, 17, 18, 13, 20, 21, 22, 27, 24, 35, 38, 23, 28, 39, 30, 31, 32, 33, 34, 25, 36, 41, 26, 29, 40, 37, 42, 43, 44, 75, 54, 59, 48, 67, 70, 51, 76, 83, 46, 55, 56, 71, 78, 47, 60, 79, 62, 63, 64, 65, 66, 49, 68, 81, 50, 57, 72, 73, 82, 45, 52, 77, 58, 61, 80, 69
Offset: 0

Views

Author

Antti Karttunen, Aug 27 2014

Keywords

Comments

In binary system, 3 ("11" in binary), has a similar shortcut rule for divisibility as eleven has in decimal system. This rule doesn't depend on which end of the number representation it is applied from, thus, if we reverse the number 3*n with "balanced bit-reverse" (A057889), the result should still be divisible by 3. Moreover, because the reversing operation is itself a self-inverse involution, and the prime factorization of any natural number is unique, we get a self-inverse permutation of nonnegative integers when we divide the bit-reversed result with 3.

Crossrefs

Programs

  • Python
    def a057889(n):
        x=bin(n)[2:]
        y=x[::-1]
        return int(str(int(y))+(len(x) - len(str(int(y))))*'0', 2)
    def a(n): return a057889(3*n)//3
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 11 2017
  • Scheme
    (define (A246200 n) (/ (A057889 (* 3 n)) 3))
    

Formula

a(n) = A057889(3*n) / 3.

A264980 Base-3 reversal of 2^n: a(n) = A030102(A000079(n)).

Original entry on oeis.org

1, 2, 4, 8, 16, 64, 32, 184, 352, 704, 1408, 1880, 2824, 14032, 10328, 56128, 100576, 145784, 189472, 370304, 731752, 4388248, 2924096, 11175712, 15965704, 31930448, 63861880, 383165344, 255439712, 1021772344, 510875648, 2550188248, 5619691648, 9689861048, 17830350904, 79068724264, 34109913224, 192259976368, 133338241880
Offset: 0

Views

Author

Antti Karttunen, Dec 05 2015

Keywords

Examples

			2^5 = 32 in base 3 = "1012" (= A007089(32)) as 1*27 + 1*3 + 2*1 = 32. 2^6 = 64 in base 3 = "2101" as 2*27 + 1*9 + 1*1 = 64. "1012" reversed is "2101" and vice versa, thus a(5) = 64 and a(6) = 32.
		

Crossrefs

Leftmost column of A265345.
Cf. also A036215.

Programs

  • PARI
    base(n) = {my(a=[n%3]); while(0Altug Alkan, Dec 29 2015

Formula

a(n) = A030102(A000079(n)) = A263273(A000079(n)).
a(0) = 1, for n >= 1, a(n) = A265342(a(n-1)).

A036214 Bit-reversing masks for 2*n bits.

Original entry on oeis.org

0, 18, 4740, 17966088, 1136090292240, 1171507928472027168, 19496308761789043518734400, 5212738348288268369644435170918528, 22344471816287582119092726913736555148345600, 1533995044405866391626076022957811770200509055768723968
Offset: 0

Views

Author

Keywords

References

  • R. Schroeppel: DECsystem-10/20 Processor Reference Manual AA-H391A-TK, Chapter 2, User Operations, section 2.15: Programming Examples: Reversing Order of Digits.

Crossrefs

Programs

  • Mathematica
    Table[2^n*(2^(2*n^2 + 3*n + 1) + 2^(2*n^2 + 2*n) - 2^(3*n + 1) - 1)/(2^(2*n + 1) - 1), {n, 0, 10}] (* Wesley Ivan Hurt, Jun 10 2024 *)
  • PARI
    A036214(n) = 2^n * ( 2^(2*n^2+3*n+1) + 2^(2*n^2+2*n) - 2^(3*n+1) - 1 ) / (2^(2*n+1) - 1); \\ Antti Karttunen, Jan 14 2024

Formula

a(n) = 2^n * ( 2^(2*n^2+3*n+1) + 2^(2*n^2+2*n) - 2^(3*n+1) - 1 ) / (2^(2*n+1) - 1).
log(a(n)) ~ log(4) * n ^ 2. - Bill McEachen, Jul 13 2024
Showing 1-3 of 3 results.