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

A254115 Permutation of natural numbers: a(n) = A254104(A048673(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 13, 10, 11, 12, 9, 14, 21, 16, 15, 26, 23, 20, 43, 22, 19, 24, 63, 18, 33, 28, 31, 42, 47, 32, 55, 30, 127, 52, 27, 46, 87, 40, 17, 86, 39, 44, 107, 38, 29, 48, 75, 126, 91, 36, 95, 66, 191, 56, 53, 62, 45, 84, 35, 94, 1023, 64, 255, 110, 25, 60, 183, 254, 79, 104, 37, 54, 171, 92, 125, 174, 59, 80, 4095, 34, 61, 172, 77, 78
Offset: 1

Views

Author

Antti Karttunen, Feb 04 2015

Keywords

Crossrefs

Inverse: A254116.
Fixed points: A254099.
Related permutations: A048673, A254104, A254117.

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 a(n): return a254104(a048673(n)) # Indranil Ghosh, Jun 06 2017

Formula

a(n) = A254104(A048673(n)).
Other identities. For all n >= 1:
a(n) = a(2n)/2. [Even bisection halved gives back the sequence itself.]
A254117(n) = (a((2*n)+1) - 1)/2. [Likewise, the odd bisection induces A254117.]

A254118 Permutation of natural numbers: a(n) = A249745(1+A254103(n)) - 1.

Original entry on oeis.org

1, 2, 3, 6, 5, 4, 8, 20, 11, 7, 9, 33, 18, 23, 14, 13, 30, 36, 21, 44, 10, 29, 15, 55, 53, 28, 16, 74, 39, 41, 12, 179, 90, 96, 50, 114, 24, 42, 35, 92, 69, 47, 19, 86, 25, 51, 26, 236, 153, 110, 81, 101, 22, 45, 48, 221, 113, 119, 56, 77, 65, 38, 17, 546, 182
Offset: 1

Views

Author

Antti Karttunen, Feb 05 2015

Keywords

Crossrefs

Inverse: A254117.
Other related permutations: A254116, A249745, A254103 (compare to the scatterplot of this one).
Cf. A254120 (= a(2^n)).

Programs

  • PARI
    default(primelimit, 2^30);
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A064216(n) = A064989((2*n)-1);
    A254103(n) = { if(0==n,0,if(!(n%2),(3*A254103(n/2))-1,(3*(1+A254103((n-1)/2)))\2)); };
    A254116(n) = A064216(A254103(n));
    A254118(n) = (A254116(n+n+1)-1)/2;
    for(n=1, 8191, write("b254118.txt", n, " ", A254118(n)));
    (Scheme, two versions)
    (define (A254118 n) (+ -1 (A249745 (+ 1 (A254103 n)))))
    (define (A254118 n) (/ (+ -1 (A254116 (+ 1 n n))) 2))
    
  • Python
    from sympy import factorint, prevprime, floor
    from operator import mul
    from functools import reduce
    def a064216(n):
        f=factorint(2*n - 1)
        return 1 if n==1 else reduce(mul, [prevprime(i)**f[i] for i in f])
    def a254103(n):
        if n==0: return 0
        if n%2==0: return 3*a254103(n//2) - 1
        else: return floor((3*(1 + a254103((n - 1)/2)))//2)
    def a254116(n): return a064216(a254103(n))
    def a(n): return (a254116(2*n + 1) - 1)//2
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 06 2017

Formula

a(n) = A249745(1+A254103(n)) - 1.
a(n) = (A254116((2*n)+1)-1) / 2. [Obtained also from the odd bisection of A254116.]
Showing 1-2 of 2 results.