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.

A284571 Permutation of natural numbers: a(1) = 1, a(A005117(1+n)) = 2*a(n), a(A065642(1+n)) = 1 + 2*a(n).

Original entry on oeis.org

1, 2, 4, 3, 8, 6, 16, 9, 5, 12, 32, 17, 18, 10, 24, 33, 64, 65, 34, 11, 36, 20, 48, 129, 7, 66, 19, 37, 128, 130, 68, 49, 22, 72, 40, 97, 96, 258, 14, 69, 132, 38, 74, 73, 21, 256, 260, 81, 13, 29, 136, 15, 98, 521, 44, 39, 144, 80, 194, 257, 192, 516, 23, 137, 28, 138, 264, 45, 76, 148, 146, 197, 42, 512, 147, 193, 520, 162, 26, 27
Offset: 1

Views

Author

Antti Karttunen, Apr 17 2017

Keywords

Crossrefs

Inverse: A284572.
Similar or related permutations: A243343, A243345, A277695, A285111.

Programs

  • Python
    from operator import mul
    from sympy import primefactors
    from sympy.ntheory.factor_ import core
    def a007947(n): return 1 if n<2 else reduce(mul, primefactors(n))
    def a285328(n):
        if core(n) == n: return 1
        k=n - 1
        while k>0:
            if a007947(k) == a007947(n): return k
            else: k-=1
    def a013928(n): return sum(1 for i in range(1, n) if core(i) == i)
    def a(n):
        if n==1: return 1
        if core(n)==n: return 2*a(a013928(n))
        else: return 1 + 2*a(a285328(n) - 1)
    [a(n) for n in range(1, 121)] # Indranil Ghosh, Apr 17 2017

Formula

a(1) = 1, for n > 1, if A008683(n) <> 0 [when n is squarefree], a(n) = 2*a(A013928(n)), otherwise a(n) = 1 + 2*a(A285328(n)-1).