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

A033496 Numbers m that are the largest number in their Collatz (3x+1) trajectory.

Original entry on oeis.org

1, 2, 4, 8, 16, 20, 24, 32, 40, 48, 52, 56, 64, 68, 72, 80, 84, 88, 96, 100, 104, 112, 116, 128, 132, 136, 144, 148, 152, 160, 168, 176, 180, 184, 192, 196, 200, 208, 212, 224, 228, 232, 240, 244, 256, 260, 264, 272, 276, 280, 288, 296, 304, 308, 312, 320, 324
Offset: 1

Views

Author

Keywords

Comments

Or, possible peak values in 3x+1 trajectories: 1,2 and m=16k+4,16k+8,16k but not for all k; those 4k numbers [like m=16k+12 and others] which cannot be such peaks are listed in A087252.
Possible values of A025586(m) in increasing order. See A275109 (number of times each value of a(n) occurs in A025586). - Jaroslav Krizek, Jul 17 2016

Examples

			These peak values occur in 1, 3, 6, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 21, 22, 27, 30, 39, 44, 71, 75, 1579 [3x+1]-iteration trajectories started with different initial values. This list most probably is incomplete.
From _Hartmut F. W. Hoft_, Jun 24 2016: (Start)
Let n be the maximum in some Collatz trajectory and let F(n), the initial fan of n, be the set of all initial values less than or equal to n whose Collatz trajectories lead to n as their maximum. Then the size of F(n) never equals 2, 4, 5, 7 or 10 (see the link).
Conjecture: Every number k > 10 occurs as the size of F(n) for some n.
Fans F(n) of size k, for all 10 < k < 355, exist for 4 <= n <= 50,000,000. The largest fan in this range, F(41163712), has size 7450.
(End)
		

Crossrefs

Cf. A095384 (contains a definition of Collatz[]).

Programs

  • Haskell
    a033496 n = a033496_list !! (n-1)
    a033496_list = 1 : filter f [2, 4 ..] where
       f x = x == maximum (takeWhile (/= 1) $ iterate a006370 x)
    -- Reinhard Zumkeller, Oct 22 2015
    
  • Magma
    Set(Sort([Max([k eq 1 select n else IsOdd(Self(k-1)) and not IsOne(Self(k-1)) select 3*Self(k-1)+1 else Self(k-1) div 2: k in [1..5*n]]): n in [1..2^10] | Max([k eq 1 select n else IsOdd(Self(k-1)) and not IsOne(Self(k-1)) select 3*Self(k-1)+1 else Self(k-1) div 2: k in [1..5*n]]) le 2^10])) // Jaroslav Krizek, Jul 17 2016
    
  • Mathematica
    Collatz[a0_Integer, maxits_:1000] := NestWhileList[If[EvenQ[ # ], #/2, 3# + 1] &, a0, Unequal[ #, 1, -1, -10, -34] &, 1, maxits]; (* Collatz[n] function definition by Eric Weisstein *)
    Select[Range[324], Max[Collatz[#]] == # &] (* T. D. Noe, Feb 28 2013 *)
  • Python
    def a(n):
        if n<2: return [1]
        l=[n, ]
        while True:
            if n%2==0: n//=2
            else: n = 3*n + 1
            if n not in l:
                l.append(n)
                if n<2: break
            else: break
        return l
    print([n for n in range(1, 501) if max(a(n)) == n]) # Indranil Ghosh, Apr 14 2017

Formula

A008908(a(n)) = A159999(a(n)). - Reinhard Zumkeller, May 04 2009
Max(A070165(a(n),k): k=1..A008908(a(n))) = A070165(a(n),1) = a(n). - Reinhard Zumkeller, Oct 22 2015

A095381 Initial values for 3x+1 trajectories in which the largest term arising in the iteration is a power of 2.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 21, 32, 42, 64, 85, 128, 151, 170, 201, 227, 256, 302, 341, 402, 454, 512, 604, 682, 804, 908, 1024, 1365, 2048, 2730, 4096, 5461, 8192, 10922, 14563, 16384, 19417, 21845, 29126, 32768, 38834, 43690, 58252, 65536, 87381
Offset: 1

Views

Author

Labos Elemer, Jun 14 2004

Keywords

Comments

Clearly the sequence is infinite and a(n) < 2^n. - Charles R Greathouse IV, May 25 2016

Crossrefs

Programs

  • C
    // Valid below A006884(47) = 12327829503 on 64-bit machines.
    static long is (unsigned long n) {
      unsigned long r = n;
      n >>= __builtin_ctzl(n); // gcc builtin for A007814
      while (n > 1) {
        n = 3*n + 1;
        if (n > r) r = n;
        n >>= __builtin_ctzl(n);
      }
      return !(r & (r-1));
    } // Charles R Greathouse IV, May 25 2016
  • Haskell
    a095381 n = a095381_list !! (n-1)
    a095381_list = map (+ 1) $ elemIndices 1 $ map a209229 a025586_list
    -- Reinhard Zumkeller, Apr 30 2013
    
  • Mathematica
    Coll[n_]:=NestWhileList[If[EvenQ[#],#/2,3*#+1] &,n,#>1&];t={};Do[x = Max[Coll[n]];If[IntegerQ[Log[2,x]],AppendTo[t,n]],{n,90000}];t (* Jayanta Basu, Apr 28 2013 *)
  • PARI
    is(n)=my(r=n); while(n>2, if(n%2, n=3*n+1; if(n>r, r=n)); n>>=1); r>>valuation(r,2)==1 \\ Charles R Greathouse IV, May 25 2016
    

Formula

A025586(a(n)) = 2^j for some j.

A095384 Number of different initial values for 3x+1 trajectories started with initial values not exceeding 2^n and in which the peak values are also not larger than 2^n.

Original entry on oeis.org

1, 2, 3, 4, 10, 13, 33, 55, 112, 181, 352, 580, 1072, 2127, 6792, 13067, 25906, 51447, 104575, 208149, 415921, 833109, 1661341, 3328124, 6648354, 13283680, 26533708, 53083687, 106166631, 212243709, 424564626, 848967377, 1698139390, 3396064464, 6791623786
Offset: 0

Views

Author

Labos Elemer, Jun 14 2004

Keywords

Examples

			n=4: between iv={1,2,...,16} {2,8}U{3,5,6,10,12,16} provides peak values smaller than or equal with 16, so a(4) = 10 = A087256(4)+4
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=1, 1,
          max(n, b(`if`(n::even, n/2, 3*n+1))))
        end:
    a:= proc(n) option remember; local t; t:=2^n;
          add(`if`(b(i)<=t, 1, 0), i=1..t)
        end:
    seq(a(n), n=0..20);  # Alois P. Heinz, Sep 26 2024
  • Mathematica
    c[x_]:=c[x]=(1-Mod[x, 2])*(x/2)+Mod[x, 2]*(3*x+1);c[1]=1; fpl[x_]:=FixedPointList[c, x]; {$RecursionLimit=1000;m=0}; Table[Print[{xm-1, m}];m=0; Do[If[ !Greater[Max[fpl[n]], 2^xm], m=m+1], {n, 1, 2^xm}], {xm, 1, 30}]
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Table[Length[Select[Range[x=2^n], Max[Collatz[#]] <= x &]], {n,0,10}] (* T. D. Noe, Apr 29 2013 *)

Extensions

a(21)-a(32) from Donovan Johnson, Feb 02 2011
a(0) from T. D. Noe, Apr 29 2013
a(33)-a(34) from Donovan Johnson, Jun 05 2013

A105730 Number of different initial values for 3x+1 trajectories in which the largest term appearing in the iteration is 2^(6n+4).

Original entry on oeis.org

6, 12, 8, 6, 13, 8, 6, 9, 11, 6, 21, 8, 6, 78, 8, 6, 9, 13, 6, 15, 8, 6, 16, 8, 6, 9, 20, 6, 12, 8, 6, 13, 8, 6, 9, 11, 6, 14, 8, 6, 32, 8, 6, 9, 32, 6, 23, 8, 6, 24, 8, 6, 9, 14, 6, 12, 8, 6, 13, 8, 6, 9, 11, 6, 14, 8, 6, 19, 8, 6, 9, 13, 6, 80, 8, 6, 29, 8, 6, 9, 18, 6, 12, 8, 6, 13, 8, 6, 9, 11
Offset: 0

Views

Author

David Wasserman, Apr 18 2005

Keywords

Comments

From Hartmut F. W. Hoft, Jun 24 2016: (Start)
The sequence has the quasiperiod 6, x, 8, 6, y, 8, 6, 9, z of length 9 starting at index 0 where x, y, z > 10; in addition, a(3*9*n+1) = 12, a(3*9*n+4) = 13 and a(3*9*n+8) = 11 for all n>=0; proof by induction (see this link) as in the link in A087256 based on the modular identities in the link in A033496.
Conjecture: All numbers greater than 10 appear in the sequence (see also A033496 and A233293). (End)

Examples

			a(1) = 12, i.e. the number of initial values for 2^10, since 804 -> 402 -> 201 -> 604 -> 302 -> 151 -> 454 -> 227 -> 682 -> 341 -> 1024 and 908 -> (454 -> ... -> 1024) are the two maximal trajectories containing all 12 initial values. a(8) = 11 since 2^(6*8+4) has 11 different initial values for Collatz trajectories leading to it. - _Hartmut F. W. Hoft_, Jun 24 2016
		

Crossrefs

Programs

  • Mathematica
    trajectory[start_] := NestWhileList[If[OddQ[#], 3#+1, #/2]&, start, #!=1&]
    fanSize[max_] := Module[{active={max}, fan={}, current}, While[active!={}, current=First[active];active=Rest[active]; AppendTo[fan, current]; If[2*current<=max, AppendTo[active, 2*current]]; If[Mod[current, 3]==1 && OddQ[(current-1)/3] && current>4, AppendTo[active, (current-1)/3]]]; Length[fan]]/;max==Max[trajectory[max]]
    a105730[low_, high_] := Map[fanSize[2^(6#+4)]&, Range[low, high]]
    a105730[0,89] (* Hartmut F. W. Hoft, Jun 24 2016 *)

Formula

a(n) = A087256(6n+4).

A095382 Exponents of power of 2 of the largest terms arising in the 3x+1 iterations started with terms of A095381.

Original entry on oeis.org

0, 1, 4, 2, 4, 4, 3, 4, 4, 4, 6, 5, 6, 6, 8, 7, 10, 8, 10, 10, 8, 10, 10, 10, 10, 9, 10, 10, 10, 10, 10, 12, 11, 12, 12, 14, 13, 14, 16, 14, 16, 16, 16, 15, 16, 16, 16, 16, 18, 17, 18, 18, 20, 19, 20, 22, 20, 22, 22, 21, 22, 22, 22
Offset: 1

Views

Author

Labos Elemer, Jun 14 2004

Keywords

Crossrefs

Formula

a[n]=Log[2, A025586[A095381(n)]]

A095383 Number of different initial values for 3x+1 trajectories started with initial values not exceeding 2^n and in which the peak values are larger than 2^n.

Original entry on oeis.org

0, 1, 4, 6, 19, 31, 73, 144, 331, 672, 1468, 3024, 6065, 9592, 19701, 39630, 79625, 157569, 316139, 632655, 1264043, 2532963, 5060484, 10128862, 20270752, 40575156, 81134041, 162268825, 324627203, 649177198, 1298516271, 2596827906
Offset: 1

Views

Author

Labos Elemer, Jun 14 2004

Keywords

Examples

			n=4: between iv={1,2,...,16} {7,9,11,13,14,15} provides
peak values larger than 16, so a[4]=6.
		

Crossrefs

Programs

  • Mathematica
    c[x_]:=c[x]=(1-Mod[x, 2])*(x/2)+Mod[x, 2]*(3*x+1);c[1]=1; fpl[x_]:=FixedPointList[c, x]; {$RecursionLimit=1000;m=0}; Table[Print[{xm-1, m}];m=0; Do[If[Greater[Max[fpl[n]], 2^xm], m=m+1], {n, 1, 2^xm}], {xm, 1, 30}]

Extensions

a(22)-a(32) from Donovan Johnson, Feb 02 2011
Showing 1-6 of 6 results.