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.

A254120 a(n) = A254118(2^n).

Original entry on oeis.org

1, 2, 6, 20, 13, 179, 546, 762, 1816, 14750, 41855, 130334, 184744, 854072, 3087888, 10703601, 15578299, 96694224, 108119693, 514354272, 1569052954, 7807991046, 23534408763, 39516990609, 76222439041, 402903897267, 1860094976924, 5552186457189, 6550591089598
Offset: 0

Views

Author

Antti Karttunen, Feb 05 2015

Keywords

Crossrefs

Programs

  • PARI
    for(n=0, 128, write("b254120.txt", n, " ", A254118(2^n))); \\ Needs also code from A254118.

Formula

a(n) = A254118(2^n) = A254118(A000079(n)).

A254116 Permutation of natural numbers: a(n) = A064216(A254103(n)).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 13, 10, 11, 12, 9, 14, 17, 16, 41, 26, 23, 20, 15, 22, 19, 24, 67, 18, 37, 28, 47, 34, 29, 32, 27, 82, 61, 52, 73, 46, 43, 40, 89, 30, 21, 44, 59, 38, 31, 48, 111, 134, 107, 36, 57, 74, 33, 56, 149, 94, 79, 68, 83, 58, 25, 64, 359, 54, 181, 164, 193, 122, 101, 104, 229, 146, 49, 92, 85, 86, 71, 80, 185, 178, 139, 60, 95, 42, 39
Offset: 1

Views

Author

Antti Karttunen, Feb 04 2015

Keywords

Crossrefs

Inverse: A254115.
Fixed points: A254099.
Related permutations: A064216, A254103, A254118.

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));
    for(n=1, 8192, write("b254116.txt", n, " ", A254116(n)));
    
  • Python
    from sympy import factorint, prevprime, floor
    from operator import mul
    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 a(n): return a064216(a254103(n)) # Indranil Ghosh, Jun 06 2017
  • Scheme
    (define (A254116 n) (A064216 (A254103 n)))
    

Formula

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

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