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.

User: P. Michael Hutchins

P. Michael Hutchins's wiki page.

P. Michael Hutchins has authored 3 sequences.

A328147 a(n) = A025586(n)/4 for n>=3.

Original entry on oeis.org

4, 1, 4, 4, 13, 2, 13, 4, 13, 4, 10, 13, 40, 4, 13, 13, 22, 5, 16, 13, 40, 6, 22, 10, 2308, 13, 22, 40, 2308, 8, 25, 13, 40, 13, 28, 22, 76, 10, 2308, 16, 49, 13, 34, 40, 2308, 12, 37, 22, 58, 13, 40, 2308, 2308, 14, 49, 22, 76, 40, 46, 2308, 2308, 16, 49, 25, 76, 17, 52, 40, 2308, 18, 2308, 28, 85, 22, 58, 76, 202, 20, 61, 2308, 2308, 21, 64, 49, 148, 22, 76, 34, 2308, 40, 70, 2308, 2308, 24, 2308, 37, 112
Offset: 3

Author

P. Michael Hutchins, Oct 22 2019

Keywords

Comments

This sequence factors out the 4 that all of the terms of A025586 for n>2 are divisible by.

Examples

			For n=3, the Collatz sequence is 3,10,5,16,8,4,2,1. The largest term is 16, so a(3) = 16/4 = 4.
		

Crossrefs

Cf. A025586.

Programs

  • Python
    def a(n):
        if n<3: return 0
        l=[n, ]
        while True:
            if n%2==0: n/=2
            else: n = 3*n + 1
            if not n in l:
                l+=[n, ]
                if n<2: break
            else: break
        return max(l)/4

Extensions

a(1)-a(2) removed from data by Michel Marcus, Nov 02 2020

A305151 a(n) = (2n+1) - A294673(n), the amount by which A294673 is less than the maximum possible for n.

Original entry on oeis.org

0, 0, 0, 3, 0, 0, 4, 10, 5, 7, 14, 0, 17, 7, 0, 25, 0, 0, 17, 0, 0, 15, 33, 11, 34, 0, 0, 19, 13, 35, 41, 56, 0, 31, 0, 11, 31, 60, 57, 27, 0, 0, 76, 27, 0, 31, 53, 0, 85, 0, 17, 37, 0, 79, 91, 74, 0, 85, 25, 0, 40, 87, 100, 119, 93, 0, 111, 0, 117, 109, 94, 83, 97, 31, 17, 51, 102, 0
Offset: 0

Author

P. Michael Hutchins, May 26 2018

Keywords

Comments

Motivation: A294673(n), which is always <= 2n+1, equals n in most cases. This sequence abstracts out that commonality to leave a cleaner signal.

Crossrefs

Cf. A294673.

Programs

  • PARI
    a(n) = (2*n+1) - znorder(Mod(if(n%2, 2, -2), 4*n+3)); \\ Michel Marcus, May 26 2018

A294673 Order of the "inside-out" permutation on 2n+1 letters.

Original entry on oeis.org

1, 3, 5, 4, 9, 11, 9, 5, 12, 12, 7, 23, 8, 20, 29, 6, 33, 35, 20, 39, 41, 28, 12, 36, 15, 51, 53, 36, 44, 24, 20, 7, 65, 36, 69, 60, 42, 15, 20, 52, 81, 83, 9, 60, 89, 60, 40, 95, 12, 99, 84, 66, 105, 28, 18, 37, 113, 30, 92, 119, 81, 36, 25, 8, 36, 131, 22, 135, 20, 30, 47, 60, 48, 116, 132, 100, 51, 155
Offset: 0

Author

P. Michael Hutchins, Nov 06 2017

Keywords

Comments

The "inside-out" permutation (closely related to the Mongean shuffle, see A019567) sends (t_1, t_2, ..., t_{2n+1}) to (t_{n+1}, t_{n+2}, t_{n}, t_{n+3}, t_{n-1}, ..., t_1). For n = 0, 1, 2, 3, this is (1), (2,3,1), (3,4,2,5,1), (4,5,3,6,2,7,1), whose orders are respectively 1,3,5,4.
This is the odd bisection of A238371 and also the odd bisection of A003558 (see Joseph L. Wetherell's comment below).

Examples

			For n=2: Iterating the "inside-out" permutation of a string of length 2n+1=5:
12345
34251
25413
41532
53124
12345
...
which has order a(2) = 5.
		

Crossrefs

Programs

  • Magma
    f:=func;
    [f(n): n in [0..100]]; // Joseph L. Wetherell, Nov 12 2017
    
  • Magma
    [Order(Integers(4*n+3)!-2*(-1)^n): n in [0..100]]; // Joseph L. Wetherell, Nov 15 2017
  • Maple
    f:= proc(n)
      ilcm(op(map(nops,convert(map(op, [[n+1],seq([n+1+i,n+1-i],i=1..n)]),disjcyc))))
    end proc:
    map(f, [$0..100]); # Robert Israel, Nov 09 2017
  • Mathematica
    a[n_] := MultiplicativeOrder[-2(-1)^n, 4n+3];
    a /@ Range[0, 100] (* Jean-François Alcover, Apr 07 2020 *)
  • PARI
    Follow(s,f)={my(t=f(s),k=1); while(t>s, k++; t=f(t)); if(s==t, k, 0)}
    CyclePoly(n,x)={my(p=0); for(i=1, 2*n+1, my(l=Follow(i, j->n+1+(-1)^j*ceil((j-1)/2) )); if(l,p+=x^l)); p}
    a(n)={my(p=CyclePoly(n,x), m=1); for(i=1,poldegree(p),if(polcoeff(p,i), m=lcm(m,i))); m} \\ Andrew Howroyd, Nov 08 2017
    
  • PARI
    a(n)=znorder(Mod(if(n%2,2,-2),4*n+3)) \\ See Wetherell formula; Charles R Greathouse IV, Nov 15 2017
    

Formula

The permutation sends i (1 <= i <= 2n+1) to p(i) = n + 1 + f(i), where f(i) = (-1)^i*ceiling((i-1)/2).
a(n) = minimal k>0 such that p^k() = p^0().
a((A163778(n)-1)/2) = A163778(n). - Andrew Howroyd, Nov 11 2017.
From Joseph L. Wetherell, Nov 14 2017: (Start)
a(n) is equal to the order of multiplication-by-2 acting on the set of nonzero elements in (Z/(4n+3)Z), modulo the action of +-1. To be precise, identify i=1,2,...,2*n+1 with the odd representatives J=1,3,...,4*n+1 of this set, via the map J = 2*i-1. It is not hard to show that the induced permutation on the set of J values is given on integer representatives by J -> (4*n+3+J)/2 if i=(J+1)/2 is even and J -> (4*n+3-J)/2 if i=(J+1)/2 is odd. It follows that this induces the permutation J -> +-J/2 (mod 4*n+3), from which we immediately see that the order is as stated.
Note that the order of 2 acting on (Z/(4n+3)Z)/{+-1} is the same as the order of either 2 or -2 acting on (Z/(4n+3)Z), depending on which of these is a quadratic residue modulo 4n+3. Thus an equivalent (and often easier) way to compute a(n) is as the order of -2*(-1)^n acting on (Z/(4n+3)Z).
Among other things, the lower and upper bounds log_2(n) + 2 < a(n) <= 2*n+1 follow immediately.
(End)
It appears that the upper bound a(n) = 2n+1 occurs iff 2n+1 belongs to A163778 or equivalently iff n belongs to A294434. This almost (but not quite) follows from the above comments by Andrew Howroyd and Joseph L. Wetherell. - N. J. A. Sloane, Nov 16 2017