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.

A254117 Permutation of natural numbers: a(n) = A254104(A249746(1+n)-1).

Original entry on oeis.org

1, 2, 3, 6, 5, 4, 10, 7, 11, 21, 9, 31, 16, 15, 23, 27, 63, 13, 43, 8, 19, 53, 14, 37, 45, 47, 95, 26, 22, 17, 511, 127, 12, 91, 39, 18, 85, 62, 29, 2047, 30, 38, 111, 20, 54, 75, 42, 55, 157, 35, 46, 174, 25, 79, 24, 59, 77, 303, 123, 94, 78, 167, 87, 223, 61, 103, 699, 191, 41, 107, 183, 125, 431, 28, 71, 84, 60, 93, 110, 767, 51
Offset: 1

Views

Author

Antti Karttunen, Feb 05 2015

Keywords

Crossrefs

Inverse: A254118.
Other related permutations: A249746, A254104, A254115.

Programs

  • Python
    from sympy import factorint, nextprime
    from operator import mul
    def a048673(n):
        f = factorint(n)
        return 1 if n==1 else (1 + reduce(mul, [nextprime(i)**f[i] for i in f]))/2
    def a254104(n):
        if n==0: return 0
        if n%3==0: return 1 + 2*a254104(2*n/3 - 1)
        elif n%3==1: return 1 + 2*a254104(2*(n - 1)/3)
        else: return 2*a254104((n - 2)/3 + 1)
    def a254115(n): return a254104(a048673(n))
    def a(n): return (a254115(2*n + 1) - 1)/2 # Indranil Ghosh, Jun 06 2017

Formula

a(n) = A254104(A249746(1+n)-1).
a(n) = (A254115((2*n)+1)-1) / 2. [Obtained also from the odd bisection of A254115.]