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-10 of 11 results. Next

A060565 Follow trajectory of 2n+1 in the '3x+1' problem until a lower number is reached; A060445 gives number of steps for this to happen. Sequence gives the first lower number that is reached.

Original entry on oeis.org

2, 4, 5, 7, 10, 10, 10, 13, 11, 16, 20, 19, 23, 22, 23, 25, 20, 28, 38, 31, 37, 34, 46, 37, 29, 40, 47, 43, 38, 46, 61, 49, 38, 52, 61, 55, 64, 58, 76, 61, 47, 64, 74, 67, 61, 70, 91, 73, 56, 76, 61, 79, 91, 82, 61, 85, 65, 88, 101, 91, 118, 94, 77, 97, 74, 100, 86, 103
Offset: 1

Views

Author

N. J. A. Sloane, Apr 12 2001

Keywords

Crossrefs

Cf. A060445.

Programs

  • Maple
    b:= proc(n, t) option remember; `if`(n b((2*n+1)$2):
    seq(a(n), n=1..80);  # Alois P. Heinz, Jan 22 2022
  • Mathematica
    b[n_, t_] := b[n, t] = If[nJean-François Alcover, Apr 25 2022, after Alois P. Heinz *)
  • PARI
    a(n) = my(N=2*n+1, m=N); while(m >= N, m = if (m%2, 3*m+1, m/2)); m; \\ Michel Marcus, Jan 22 2022

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Apr 13 2001

A006577 Number of halving and tripling steps to reach 1 in '3x+1' problem, or -1 if 1 is never reached.

Original entry on oeis.org

0, 1, 7, 2, 5, 8, 16, 3, 19, 6, 14, 9, 9, 17, 17, 4, 12, 20, 20, 7, 7, 15, 15, 10, 23, 10, 111, 18, 18, 18, 106, 5, 26, 13, 13, 21, 21, 21, 34, 8, 109, 8, 29, 16, 16, 16, 104, 11, 24, 24, 24, 11, 11, 112, 112, 19, 32, 19, 32, 19, 19, 107, 107, 6, 27, 27, 27, 14, 14, 14, 102, 22
Offset: 1

Views

Author

Keywords

Comments

The 3x+1 or Collatz problem is as follows: start with any number n. If n is even, divide it by 2, otherwise multiply it by 3 and add 1. Do we always reach 1? This is a famous unsolved problem. It is conjectured that the answer is yes.
It seems that about half of the terms satisfy a(i) = a(i+1). For example, up to 10000000, 4964705 terms satisfy this condition.
n is an element of row a(n) in triangle A127824. - Reinhard Zumkeller, Oct 03 2012
The number of terms that satisfy a(i) = a(i+1) for i being a power of ten from 10^1 through 10^10 are: 0, 31, 365, 4161, 45022, 477245, 4964705, 51242281, 526051204, 5378743993. - John Mason, Mar 02 2018
5 seems to be the only number whose value matches its total number of steps (checked to n <= 10^9). - Peter Woodward, Feb 15 2021

Examples

			a(5)=5 because the trajectory of 5 is (5,16,8,4,2,1).
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, E16.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

See A070165 for triangle giving trajectories of n = 1, 2, 3, ....

Programs

  • Haskell
    import Data.List (findIndex)
    import Data.Maybe (fromJust)
    a006577 n = fromJust $ findIndex (n `elem`) a127824_tabf
    -- Reinhard Zumkeller, Oct 04 2012, Aug 30 2012
    
  • Maple
    A006577 := proc(n)
            local a,traj ;
            a := 0 ;
            traj := n ;
            while traj > 1 do
                    if type(traj,'even') then
                            traj := traj/2 ;
                    else
                            traj := 3*traj+1 ;
                    end if;
                    a := a+1 ;
            end do:
            return a;
    end proc: # R. J. Mathar, Jul 08 2012
  • Mathematica
    f[n_] := Module[{a=n,k=0}, While[a!=1, k++; If[EvenQ[a], a=a/2, a=a*3+1]]; k]; Table[f[n],{n,4!}] (* Vladimir Joseph Stephan Orlovsky, Jan 08 2011 *)
    Table[Length[NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#!=1&]]-1,{n,80}] (* Harvey P. Dale, May 21 2012 *)
  • PARI
    a(n)=if(n<0,0,s=n; c=0; while(s>1,s=if(s%2,3*s+1,s/2); c++); c)
    
  • PARI
    step(n)=if(n%2,3*n+1,n/2);
    A006577(n)=if(n==1,0,A006577(step(n))+1); \\ Michael B. Porter, Jun 05 2010
    
  • Python
    def a(n):
        if n==1: return 0
        x=0
        while True:
            if n%2==0: n//=2
            else: n = 3*n + 1
            x+=1
            if n<2: break
        return x
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 05 2017
    
  • Python
    def A006577(n):
        ct = 0
        while n != 1: n = A006370(n); ct += 1
        return ct # Ya-Ping Lu, Feb 22 2024
    
  • R
    collatz<-function(n) ifelse(n==1,0,1+ifelse(n%%2==0,collatz(n/2),collatz(3*n+1))); sapply(1:72, collatz) # Christian N. K. Anderson, Oct 09 2024

Formula

a(n) = A006666(n) + A006667(n).
a(n) = A112695(n) + 2 for n > 2. - Reinhard Zumkeller, Apr 18 2008
a(n) = A008908(n) - 1. - L. Edson Jeffery, Jul 21 2014
a(n) = A135282(n) + A208981(n) (after Alonso del Arte's comment in A208981), if 1 is reached, otherwise a(n) = -1. - Omar E. Pol, Apr 10 2022
a(n) = 2*A007814(n + 1) + a(A085062(n)) + 1 for n > 1. - Wing-Yin Tang, Jan 06 2025

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Apr 27 2001
"Escape clause" added to definition by N. J. A. Sloane, Jun 06 2017

A075680 For odd numbers 2n-1, the minimum number of iterations of the reduced Collatz function R required to yield 1. The function R is defined as R(k) = (3k+1)/2^r, with r as large as possible.

Original entry on oeis.org

0, 2, 1, 5, 6, 4, 2, 5, 3, 6, 1, 4, 7, 41, 5, 39, 8, 3, 6, 11, 40, 9, 4, 38, 7, 7, 2, 41, 10, 10, 5, 39, 8, 8, 3, 37, 42, 3, 6, 11, 6, 40, 1, 9, 9, 33, 4, 38, 43, 7, 7, 31, 12, 36, 41, 24, 2, 10, 5, 10, 34, 15, 39, 15, 44, 8, 8, 13, 32, 13, 3, 37, 42, 42, 6, 3, 11, 30, 11, 18, 35, 6, 40, 23
Offset: 1

Views

Author

T. D. Noe, Sep 25 2002

Keywords

Comments

See A075677 for the function R applied to the odd numbers once. The 3x+1 conjecture asserts that a(n) is a finite number for all n. The function R applied to the odd numbers shows the essential behavior of the 3x+1 iterations.
Bisection of A006667. - T. D. Noe, Jun 01 2006

Examples

			a(4) = 5 because 7 is the fourth odd number and 5 iterations are needed: R(R(R(R(R(7)))))=1.
		

Crossrefs

Cf. A075677.
Cf. A075684 for the largest number attained during the iteration.
Cf. A000265.
Cf. A060445 which also counts intermediate even steps.
Cf. A173732.

Programs

  • Haskell
    a075680 n = snd $ until ((== 1) . fst)
                (\(x, i) -> (a000265 (3 * x + 1), i + 1)) (2 * n - 1, 0)
    -- Reinhard Zumkeller, Jan 08 2014
    
  • Mathematica
    nextOddK[n_] := Module[{m=3n+1}, While[EvenQ[m], m=m/2]; m]; (* assumes odd n *) Table[m=n; cnt=0; If[n>1, While[m=nextOddK[m]; cnt++; m!=1]]; cnt, {n, 1, 200, 2}]
  • PARI
    a(n)=my(s); n+=n-1; while(n>1, n+=n>>1+1; if(n%2==0, n>>=valuation(n,2)); s++); s \\ Charles R Greathouse IV, Dec 22 2021
  • Perl
    sub a {
      my $v = 2 * shift() - 1;
      my $c = 0;
      until (1 == $v) {
        $v = 3 * $v + 1;
        $v /= 2 until ($v & 1);
        $c += 1;
      }
      return $c;
    } # Ruud H.G. van Tol, Nov 16 2021
    

Formula

a(n) = a(A173732(n-1) + 1) + 1 for n >= 2. - Alan Michael Gómez Calderón, Apr 10 2025

A074473 Dropping time for the 3x+1 problem: for n >= 2, number of iteration that first becomes smaller than the initial value if Collatz-function (A006370) is iterated starting at n; a(1)=1 by convention.

Original entry on oeis.org

1, 2, 7, 2, 4, 2, 12, 2, 4, 2, 9, 2, 4, 2, 12, 2, 4, 2, 7, 2, 4, 2, 9, 2, 4, 2, 97, 2, 4, 2, 92, 2, 4, 2, 7, 2, 4, 2, 14, 2, 4, 2, 9, 2, 4, 2, 89, 2, 4, 2, 7, 2, 4, 2, 9, 2, 4, 2, 12, 2, 4, 2, 89, 2, 4, 2, 7, 2, 4, 2, 84, 2, 4, 2, 9, 2, 4, 2, 14, 2, 4, 2, 7, 2, 4, 2, 9, 2, 4, 2, 74, 2, 4, 2, 14, 2, 4, 2, 7
Offset: 1

Views

Author

Labos Elemer, Sep 19 2002

Keywords

Comments

Here we call the starting value iteration number 1, although usually the count is started at 0, which would subtract 1 from the values for n >= 2 - see A060445, A102419.

Examples

			n=2k: then a(2k)=2 because the second iterate is k<n=2k, the first iterate below 2k; n=4k+1, k>1: the list = {4k+1, 12k+4, 6k+2, 3k+1, ...} i.e. the 4th term is always the first below initial value, so a(4k+1)=4;
n=15: the list={15, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1} and 12th term is first sinks below iv=15, so a(15)=12; relatively larger values occur at n=4k+3.
n=3: the list is {3, 10, 5, 16, 8, 4, 2, 1, ..}, the 7th term is 2, which is the first smaller than 3, so a(3)=7.
		

Crossrefs

Programs

  • Mathematica
    nextx[x_Integer] := If[OddQ@x, 3x + 1, x/2]; f[1] = 1; f[n_] := Length@ NestWhileList[nextx, n, # >= n &]; Array[f, 83] (* Bobby R. Treat (drbob(at)bigfoot.com), Sep 16 2006 *)
  • PARI
    A074473(n) = if (n<3, n,  my(N=n, x=1); while (1, if (n%2==0, n/=2, n = 3*n + 1); x++; if (nMichel Marcus, Aug 15 2025
  • Python
    def a(n):
        if n<3: return n
        N=n
        x=1
        while True:
            if n%2==0: n/=2
            else: n = 3*n + 1
            x+=1
            if nIndranil Ghosh, Apr 15 2017
    

Extensions

Edited by N. J. A. Sloane, Sep 15 2006

A060412 In the '3x+1' problem, these values for the starting value set new records for the "dropping time", number of steps to reach a lower value than the start.

Original entry on oeis.org

2, 3, 7, 27, 703, 10087, 35655, 270271, 362343, 381727, 626331, 1027431, 1126015, 8088063, 13421671, 20638335, 26716671, 56924955, 63728127, 217740015, 1200991791, 1827397567, 2788008987, 12235060455
Offset: 1

Views

Author

N. J. A. Sloane, Apr 06 2001; b-file added Nov 27 2007

Keywords

Comments

The (3x+1)/2 steps and the halving steps are counted. - Don Reble, May 13 2006
Where records occur in A102419 (could be prefixed by an initial 1). - N. J. A. Sloane, Oct 20 2012

Examples

			See A102419.
		

Crossrefs

A060413 gives associated "dropping times", A060414 the maximal values and A060415 the steps at which the maxima occur. See also A217934.

Programs

  • Mathematica
    dcoll[n_]:=Length[NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#>=n&]]; t={max=2}; Do[If[(y=dcoll[n])>max,max=y; AppendTo[t,n]],{n,3,1130000,4}]; t (* Jayanta Basu, May 28 2013 *)

A122458 "Dropping time" of the reduced Collatz iteration starting with 2n+1.

Original entry on oeis.org

0, 2, 1, 4, 1, 3, 1, 4, 1, 2, 1, 3, 1, 37, 1, 35, 1, 2, 1, 5, 1, 3, 1, 34, 1, 2, 1, 3, 1, 4, 1, 34, 1, 2, 1, 32, 1, 3, 1, 5, 1, 2, 1, 3, 1, 28, 1, 5, 1, 2, 1, 26, 1, 3, 1, 19, 1, 2, 1, 3, 1, 5, 1, 9, 1, 2, 1, 4, 1, 3, 1, 4, 1, 2, 1, 3, 1, 25, 1, 13, 1, 2, 1, 18, 1, 3, 1, 5, 1, 2, 1, 3, 1, 4, 1, 8, 1, 2, 1, 5
Offset: 0

Views

Author

T. D. Noe, Sep 08 2006

Keywords

Comments

We count only the 3x+1 steps of the usual Collatz iteration. We stop counting when the iteration produces a number less than the initial 2n+1. For a fixed dropping time k, let N(k)=A100982(k) and P(k)=2^(A020914(k)-1). There are exactly N(k) odd numbers less than P(k) with dropping time k. Moreover, the sequence is periodic: if d is one of the N(k) odd numbers, then k=a(d)=a(d+i*P(k)) for all i>=0. This periodicity makes it easy to compute the average dropping time of the reduced Collatz iteration: Sum_{k>0} k*N(k)/P(k) = 3.492651852186... (A122791).

Examples

			a(3)=4 because, starting with 7, the iteration produces 11,17,13,5 and the last term is less than 7.
n = 13: the fr trajectory for 2*13+1 = 27 is 41, 31, 47, 71, 107, 161, 121, 91, 137, 103, 155, 233, 175, 263, 395, 593, 445, 167, 251, 377, 283, 425, 319, 479, 719, 1079, 1619, 2429, 911, 1367, 2051, 3077, 577, 433, 325, 61, 23, 35, 53, 5, 1 with 41 terms (without 27), hence fr^[37] = 23 < 27  and  a(13) = 37. - _Wolfdieter Lang_, Feb 20 2019
		

References

  • Victor Klee and Stan Wagon, Old and New Unsolved Problems in Plane Geometry and Number Theory, Mathematical Association of America (1991) pp. 225-229, 308-309. [called on p. 225 stopping time for 2n+1 and the function C(2*n+1) = A075677(n+1), n >= 0. - Wolfdieter Lang, Feb 20 2019]

Crossrefs

Cf. A000265, A060445, A075677 (one step of the reduced Collatz iteration), A075680.
Cf. A087113 (indices of 1's), A017077 (indices of 2's), A122791 (limit mean).

Programs

  • Mathematica
    nextOddK[n_]:=Module[{m=3n+1}, While[EvenQ[m], m=m/2]; m]; dt[n_]:=Module[{m=n, cnt=0}, If[n>1, While[m=nextOddK[m]; cnt++; m>n]]; cnt]; Table[dt[n],{n,1,301,2}]

Formula

a(n) is the least k for which fr^[k](n) < 2*n + 1, for n >= 1 and k >= 1, where fr(n) = A075677(n+1) = A000265(3*n+2). No k satisfies this for n = 0: a(0) := 0 by convention. The dropping time a(n) is finite, for n >= 1, if the Collatz conjecture is true. - Wolfdieter Lang, Feb 20 2019
a(1+i*8) = 2, for i>=0, because A100982(2) = 1 is odd, and A020914(2) = 4 gives P(2) = 2^(4-1) = 8. - Ruud H.G. van Tol, Dec 19 2021

A122437 Allowable values of the "dropping time" of the Collatz (3x+1) iteration.

Original entry on oeis.org

1, 3, 6, 8, 11, 13, 16, 19, 21, 24, 26, 29, 32, 34, 37, 39, 42, 44, 47, 50, 52, 55, 57, 60, 63, 65, 68, 70, 73, 75, 78, 81, 83, 86, 88, 91, 94, 96, 99, 101, 104, 106, 109, 112, 114, 117, 119, 122, 125, 127, 130, 132, 135, 138, 140, 143, 145, 148, 150, 153, 156, 158, 161
Offset: 1

Views

Author

T. D. Noe, Sep 06 2006

Keywords

Comments

Only these numbers appear in A060445, which tabulates the "dropping time" of odd numbers. Note that all even numbers have a "dropping time" of 1.
a(n) is also the number of binary digits of 6^(n-1); for example, a(4)=8 since 6^(4-1)=216 in binary is 11011000, an 8-digit number. - Julio Cesar de la Yncera, Mar 28 2009
A positive integer (x) is an allowable value if and only if (x-1)/(1+log(2)/log(3)) - floor(x/(1+log(2)/log(3))) is not negative. - K. Spage, Oct 22 2009
Here the word "allowable" means that it is necessary for a sequence of iterates starting from odd value m to arrive at a value x = f^{floor(1+n+n*log(3)/log(2))}(m) < m, where n gives the number of odds in such a sequence including m, to have undergone precisely floor(1+n+n*log(3)/log(2)) iterations of f, where f(2*m)=m, f(2*m+1)=6*m+4. However, the formula for a(n+1) does not fully account for the order of odds and evens in such a sequence because it does not account for the effects of the "+1". Thus it is unknown whether it maximizes the value x for all values m. For example, fix m = 1 and the "+1" is enough to give the trivial cycle. So it is possible that for some m we have f^{floor(1+n+n*log(3)/log(2))}(m) >= m. - Jeffrey R. Goodwin, Aug 24 2011
The indices of the powers of 3 in A006899. - Ruud H.G. van Tol, Nov 02 2022

Crossrefs

Cf. A022921 (number of 2^m between 3^n and 3^(n+1)), A122442 (least k having dropping time a(n)).
Cf. A006899.

Programs

Formula

a(1) = 1, a(n+1) = a(n) + A022921(n-1) + 1.
a(n+1) = floor(1 + n + n*log(3)/log(2)). - T. D. Noe, Sep 08 2006
a(n) = floor((1 + log(2)/log(3))*A020914(n-1)). - K. Spage, Oct 22 2009
a(n) = A020914(n-1) + n - 1. - K. Spage, Oct 23 2009 [corrected by Ruud H.G. van Tol, Nov 03 2022]
a(n) = a(n-1)+2 if 3^(n-1) < 2^(a(n-1)+2-(n-1)); a(n) = a(n-1)+3 otherwise. - V. Barbera, Aug 12 2025

Extensions

Comment corrected and edited by Jon E. Schoenfield, Feb 27 2014

A102419 "Dropping time" in 3x+1 problem starting at n (number of steps to reach a lower number than starting value); a(1) = 0 by convention. Also called glide(n).

Original entry on oeis.org

0, 1, 6, 1, 3, 1, 11, 1, 3, 1, 8, 1, 3, 1, 11, 1, 3, 1, 6, 1, 3, 1, 8, 1, 3, 1, 96, 1, 3, 1, 91, 1, 3, 1, 6, 1, 3, 1, 13, 1, 3, 1, 8, 1, 3, 1, 88, 1, 3, 1, 6, 1, 3, 1, 8, 1, 3, 1, 11, 1, 3, 1, 88, 1, 3, 1, 6, 1, 3, 1, 83, 1, 3, 1, 8, 1, 3, 1, 13, 1, 3, 1, 6, 1, 3, 1, 8, 1, 3, 1, 73, 1, 3, 1, 13, 1, 3, 1, 6
Offset: 1

Views

Author

N. J. A. Sloane, Sep 15 2006

Keywords

Examples

			1: 0 steps
2 1: 1 step
3 10 5 16 8 4 2 1: 6 steps (before it drops below n)
4 2 1: 1 step
5 16 8 4 2 1: 3 steps
6 3 ...: 1 step
7 22 11 34 17 52 26 13 40 20 10 5 ...: 11 steps
...
Records: 0.1.6.11.96.132...171... (A217934)
at.......1.2.3..7.27.703.10087... (A060412)
		

Crossrefs

For records see A060412, A217934. - N. J. A. Sloane, Oct 20 2012

Programs

  • Mathematica
    Prepend[Table[Length[NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#>=n&]],{n,2,99}],1]-1 (* Jayanta Basu, May 28 2013 *)
  • Python
    def a(n):
        if n<3: return n - 1
        N=n
        x=0
        while True:
            if n%2==0: n//=2
            else: n = 3*n + 1
            x+=1
            if nIndranil Ghosh, Apr 22 2017

Formula

a(2n) = 1; a(2n+1) = A060445(n).
a(n) = A074473(n)-1 for n>1.
a(n) = floor(A126241(n)*(1+log(2)/log(3))). - K. Spage, Oct 22 2009

A177789 Irregular triangle read by rows in which row n gives the congruences (mod 2^A020914(n)) satisfied by the numbers having dropping time A122437(n+1) in the Collatz (3x+1) iteration.

Original entry on oeis.org

0, 1, 3, 11, 23, 7, 15, 59, 39, 79, 95, 123, 175, 199, 219, 287, 347, 367, 423, 507, 575, 583, 735, 815, 923, 975, 999, 231, 383, 463, 615, 879, 935, 1019, 1087, 1231, 1435, 1647, 1703, 1787, 1823, 1855, 2031, 2203, 2239, 2351, 2587, 2591, 2907, 2975, 3119
Offset: 0

Views

Author

T. D. Noe, May 13 2010

Keywords

Comments

The dropping time is the number of Collatz iterations required to reach a lower number than starting value. Garner mentions these congruences. The first term in row n is A122442(n+1) for n > 1. The length of row n is A100982(n).
The triangle means:
numbers 0 (mod 2) and > 0 have dropping time 1;
numbers 1 (mod 4) and > 1 have dropping time 3;
numbers 3 (mod 16) have dropping time 6;
numbers 11, 23 (mod 32) have dropping time 8;
numbers 7, 15, 59 (mod 128) have dropping time 11;
numbers 39, 79, 95, 123, 175, 199, 219 (mod 256) have dropping time 13.
Theorem: a(n) can be evaluated using a directed rooted tree produced by a precise algorithm. Each node of this tree is given by a unique Diophantine equation whose only positive solutions are the integers with a finite stopping time. The algorithm generates (in a three step loop) the parity vectors which define the Diophantine equations. The two directions of the construction principle gives the tree a triangular form which extends ever more downwards with each column. There exist explicit arithmetic relationships between the parent and child vertices. As a consequence, a(n) can be generated algorithmically. The algorithm also generates A100982. - Mike Winkler, Sep 12 2017

Examples

			Triangle begins:
   0;
   1;
   3;
  11,  23;
   7,  15,  59;
  39,  79,  95, 123, 175, 199, 219;
  ...
From _Mike Winkler_, Sep 12 2017: (Start)
The beginning of the directed rooted tree produced by the algorithm of the Theorem. The triangular form can be seen clearly. The way the tree structure is sorting a(n), respectively the residue classes, mirrors the explicit arithmetic relationships mentioned in the Theorem.
3 (mod 2^4) -- 11 (mod 2^5) -- 59 (mod 2^7) -- 123 (mod 2^8) --
                    |                                |
                    |                          219 (mod 2^8) --
                    |
                    |
               23 (mod 2^5) --- 7 (mod 2^7) -- 199 (mod 2^8) --
                                    |                |
                                    |           39 (mod 2^8) --
                                    |
                                    |
                               15 (mod 2^7) --- 79 (mod 2^8) --
                                                     |
                                               175 (mod 2^8) --
                                                     |
                                                95 (mod 2^8) --
(End)
		

Crossrefs

Cf. A060445 (dropping time of odd numbers), A100982.

Programs

  • Mathematica
    DroppingTime[n_] := Module[{m=n, k=0}, If[n>1, While[m>=n, k++; If[EvenQ[m], m=m/2, m=3*m+1]]]; k]; dt=Floor[1+Range[0,20]*Log[2,6]]; e=Floor[1+Range[0,20]*Log[2,3]]; Join[{0,1}, Flatten[Table[Select[Range[3,2^e[[n]],2], DroppingTime[ # ]==dt[[n]] &], {n,2,8}]]]
  • PARI
    /* algorithm for generating the parity vectors of the Theorem, the tree structure is given by the three STEP's */
    {k=3; Log32=log(3)/log(2); limit=14; /*or limit>14*/ T=matrix(limit,60000); xn=3; /*initial tuple for n=1*/ A=[]; for(i=1, 2, A=concat(A,i)); A[1]=1; A[2]=1; T[1,1]=A; for(n=2, limit, print("n="n); Sigma=floor(1+(n+1)*Log32); d=floor(n*Log32)-floor((n-1)*Log32); Kappa=floor(n*Log32); Kappa2=floor((n-1)*Log32);r=1; v=1; until(w==0, A=[]; for(i=1, Kappa2+1, A=concat(A,i)); A=T[n-1,v]; B=[]; for(i=1, Kappa+1, B=concat(B,i)); for(i=1, Kappa2+1, B[i]=A[i]); /* STEP 1 */ if(d==1, B[k]=1; T[n,r]=B; r++; v++); if(d==2, B[k]=0; B[k+1]=1; T[n,r]=B; r++; v++); /* STEP 2 */ if(B[Kappa]==0, for(j=1, Kappa-n, B[Kappa+1-j]=B[Kappa+2-j]; B[Kappa+2-j]=0; T[n,r]=B; r++; if(B[Kappa-j]==1, break(1)))); /* STEP 3 */ w=0; for(i=n+2, Kappa+1, w=w+B[i]));k=k+d; p=1; h2=3; for(i=1, r-1, h=0; B=T[n,i]; until(B[h]==0, h++); if(h>h2, p=1; h2++; print); print(T[n,i]"  "p"  "i); p++); print)} \\ Mike Winkler, Sep 12 2017
    
  • PARI
    row(n) = if (n < 2, [n], my(v = vector(2^(A020914(n)-1), k, 2*k-1)); apply(x->2*x-1, Vec(select(x->(x == 1+A122437(n+1)), apply(A074473, v), 1)))); \\ Michel Marcus, Aug 15 2025
    
  • PARI
    row(n)={if(n<1, [0], my(r=[1], d=[2], km=2); for(i=1, n-1, my(temp1=[], temp2=[], c=if(3^(i+1)<2^(km+1),1,2)); for(j=1, #d, temp1=concat(temp1, vector(d[j]-1, m, 3*r[j]+2^(km-d[j]+m))); temp2=concat(temp2, vector(d[j]-1, m, d[j]-m+c))); km=km+c; r=temp1; d=temp2; ); vecsort(apply(x->((-x)*lift(Mod(1/3^n, 2^km)))%2^km, r)))} \\ V. Barbera, Aug 15 2025

A217934 Records in A102419.

Original entry on oeis.org

0, 1, 6, 11, 96, 132, 171, 220, 267, 269, 282, 287, 298, 365, 401, 468, 476, 486, 502, 613, 644, 649, 706, 729, 892, 897, 988, 1122, 1161, 1177, 1187, 1445, 1471, 1575, 1614, 1639
Offset: 1

Views

Author

N. J. A. Sloane, Oct 20 2012

Keywords

Comments

If the "1" is omitted, also records in A060445.

Examples

			See A102419.
		

Crossrefs

Showing 1-10 of 11 results. Next