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.

Previous Showing 11-20 of 24 results. Next

A261690 a(1) = 1; for n>1, a(n) is the smallest number not already present which is entailed by the rules (i) k present => 3*k+1 present; (ii) 2*k present => k present.

Original entry on oeis.org

1, 4, 2, 7, 13, 22, 11, 34, 17, 40, 20, 10, 5, 16, 8, 25, 31, 49, 52, 26, 61, 67, 76, 38, 19, 58, 29, 79, 88, 44, 94, 47, 103, 115, 121, 133, 142, 71, 148, 74, 37, 112, 56, 28, 14, 43, 85, 130, 65, 157, 169, 175, 184, 92, 46, 23, 70, 35, 106, 53, 139, 160, 80
Offset: 1

Views

Author

Vladimir Shevelev, Aug 28 2015

Keywords

Comments

An analog of A109732 such that the statement 'the sequence is a permutation of the positive integers not divisible by 3' is equivalent to the (3*n+1)-conjecture for numbers not divisible by 3.
On Aug 29 2015, Max Alekseyev noted that, while the (3*n+1)-conjecture indeed implies that the sequence is a permutation of the positive integers not divisible by 3, the opposite statement is an open question. The author cannot yet prove this, so his previous comment is only a conjecture.
In connection with this, consider the following conjecture which could be called the (n-1)/3-conjecture. Let n be any number not divisible by 3. If n==1 (mod 3) and (n-1)/3 is not divisible by 3, then set n_1 = (n-1)/3. Otherwise set n_1 = 2*n. Conjecture. There exists an iteration n_m = 1. Does the (n-1)/3-conjecture imply the (3*n+1)-conjecture?
Example: 19->38->76->25->8->16->5->10->20->40->13->4->1.

Crossrefs

A033958 In the '3x+1' problem, these values for the starting value set new records for number of steps to reach 1.

Original entry on oeis.org

1, 3, 7, 9, 25, 27, 73, 97, 129, 171, 231, 313, 327, 703, 871, 1161, 2463, 2919, 3711, 6171, 10971, 13255, 17647, 23529, 26623, 34239, 35655, 52527, 77031, 106239, 142587, 156159, 216367, 230631, 410011, 511935, 626331, 837799, 1117065, 1501353, 1723519, 2298025, 3064033
Offset: 1

Views

Author

Keywords

Comments

Only the 3x+1 steps, not the halving steps, are counted.

References

  • D. R. Hofstadter, Goedel, Escher, Bach: an Eternal Golden Braid, Random House, 1980, p. 400.
  • G. T. Leavens and M. Vermeulen, 3x+1 search problems, Computers and Mathematics with Applications, 24 (1992), 79-99.

Crossrefs

Programs

  • Haskell
    a033958 n = a033958_list !! (n-1)
    -- For definition of a033958_list: see A033959.
    -- Reinhard Zumkeller, Jan 08 2014
  • Mathematica
    f[ nn_ ] := Module[ {c, n}, c = 0; n = nn; While[ n != 1, If[ Mod[ n, 2 ] == 0, n /= 2, n = 3*n + 1; c++ ] ]; Return[ c ] ] maxx = -1; For[ n = 1, n <= 10^8, n++, Module[ {val}, val = f[ n ]; If[ val > maxx, maxx = val; Print[ n, " ", val ] ] ] ] (* Winston C. Yang (winston(AT)cs.wisc.edu), Aug 27 2000 *)

Formula

Positions of records in A006667. - Sean A. Irvine, Jul 22 2020

Extensions

More terms from Jud McCranie, Jan 26 2000
Corrected with Mathematica code by Winston C. Yang (winston(AT)cs.wisc.edu), Aug 27 2000
a(40)-a(43) from Charles R Greathouse IV, Oct 07 2013

A075684 For odd numbers 2n-1, the maximum number produced by iterating the reduced Collatz function R defined as R(k) = (3k+1)/2^r, with r as large as possible.

Original entry on oeis.org

1, 5, 5, 17, 17, 17, 13, 53, 17, 29, 21, 53, 29, 3077, 29, 3077, 33, 53, 37, 101, 3077, 65, 45, 3077, 49, 77, 53, 3077, 65, 101, 61, 3077, 65, 101, 69, 3077, 3077, 113, 77, 269, 81, 3077, 85, 197, 101, 3077, 93, 3077, 3077, 149, 101, 3077, 269, 3077, 3077, 3077
Offset: 1

Views

Author

T. D. Noe, Sep 25 2002

Keywords

Comments

See A075677 for the function R applied to the odd numbers once. See A075680 for the number of iterations required to yield 1. Sequence A006884, with the number 2 removed, gives the odd numbers that produce new record maxima. The maxima of the current sequence are related to A006885: if m is a maximum of the usual Collatz iteration, then (m-1)/3 is the maximum for the reduced Collatz iteration.

Examples

			a(4) = 17 because 7 is the fourth odd number and 17 is the largest number in the iteration: R(7)=11, R(11)=17, R(17)=13, R(13)=5, R(5)=1.
		

Crossrefs

Programs

  • Mathematica
    nextOddK[n_] := Module[{m=3n+1}, While[EvenQ[m], m=m/2]; m]; (* assumes odd n *) Table[m=n; maxK=n; If[n>1, While[m=nextOddK[m]; maxK=Max[m, maxK]; m!=1]]; maxK, {n, 1, 200, 2}]

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

A033959 Record number of steps to reach 1 in '3x+1' problem, corresponding to starting values in A033958.

Original entry on oeis.org

0, 2, 5, 6, 7, 41, 42, 43, 44, 45, 46, 47, 52, 62, 65, 66, 76, 79, 87, 96, 98, 101, 102, 103, 113, 114, 119, 125, 129, 130, 138, 141, 142, 164, 166, 174, 189, 195, 196, 197, 207, 208, 209, 217, 222, 228, 248, 256, 257, 258, 263, 278, 357, 358, 359, 362, 370
Offset: 1

Views

Author

Keywords

Comments

Only the 3x+1 steps, not the halving steps, are counted.

References

  • D. R. Hofstadter, Goedel, Escher, Bach: an Eternal Golden Braid, Random House, 1980, p. 400.
  • G. T. Leavens and M. Vermeulen, 3x+1 search problems, Computers and Mathematics with Applications, 24 (1992), 79-99.

Crossrefs

Programs

  • Haskell
    a033959 n = a033959_list !! (n-1)
    (a033959_list, a033958_list) = unzip $ (0, 1) : f 1 1 where
       f i x | y > x     = (y, 2 * i - 1) : f (i + 1) y
             | otherwise = f (i + 1) x
             where y = a075680 i
    -- Reinhard Zumkeller, Jan 08 2014
  • Maple
    A033959 := proc(n) local a,L; L := 0; a := n; while a <> 1 do if a mod 2 = 0 then a := a/2; else a := 3*a+1; L := L+1; fi; od: RETURN(L); end;
  • Mathematica
    f[ nn_ ] := Module[ {c, n}, c = 0; n = nn; While[ n != 1, If[ Mod[ n, 2 ] == 0, n /= 2, n = 3*n + 1; c++ ] ]; Return[ c ] ] maxx = -1; For[ n = 1, n <= 10^8, n++, Module[ {val}, val = f[ n ]; If[ val > maxx, maxx = val; Print[ n, " ", val ] ] ] ]

Extensions

More terms from Winston C. Yang (winston(AT)cs.wisc.edu), Aug 27 2000
More terms from Larry Reeves (larryr(AT)acm.org), Sep 27 2000
Offset corrected by Reinhard Zumkeller, Jan 08 2014

A025587 '3x+1' record-setters (blowup factor).

Original entry on oeis.org

1, 3, 7, 15, 27, 703, 1819, 4255, 4591, 9663, 26623, 60975, 77671, 113383, 159487, 1212415, 2684647, 3041127, 3873535, 4637979, 5656191, 6416623, 6631675, 19638399, 80049391, 210964383, 319804831, 1410123943, 70141259775, 77566362559
Offset: 0

Views

Author

Keywords

Comments

This sequence uses the highest even number reached, which will always be a power of 2 larger than A295163. - Howard A. Landman, Nov 20 2017
A proper subsequence of A006884. - Robert G. Wilson v, Dec 23 2017
Let m be the maximum value in row n of A070165. This sequence is the record transform of the sequence m/n for n >= 1. - Michael De Vlieger, Mar 13 2018

Crossrefs

Cf. A295163 for maximum odd number reached, and A061523 for blowup factors.

Programs

  • C
    // First column is this sequence.
    // Second column is the maximum (even) N reached.
    // Third column is A061523, the ratio of those.
    // NOTE: This could be made faster by special-casing 1,
    // starting at 3, and incrementing by 4, since all terms except 1
    // are congruent to 3 (mod 4).
    #include    
    long long    i=1, n, max_n;
    long double    max_ratio=1.0, ratio;
    int main()
    {
        while(1)
        {
            n = i;
            max_n = n;
            while (n > i) // Can stop as soon as we drop below start.
            {
                n = 3*n + 1;
                max_n = (n > max_n) ? n : max_n;
                while (!(n&1))
                {
                    n >>= 1;
                }
             }
            ratio = (double) max_n / (double) i;
            if (ratio > max_ratio)
            {
                max_ratio = ratio;
                printf("%lld\t%lld\t%Lf\n", i, max_n, max_ratio);
            }
            i += 2;
        }
    }
    // Howard A. Landman, Nov 14 2017
  • Mathematica
    With[{s = Array[Max@ NestWhileList[If[EvenQ@#, #/2, 3 # + 1] &, #, # > 1 &]/# &, 2^18]}, Map[FirstPosition[s, #][[1]] &, Union@ FoldList[Max, s]]] (* Michael De Vlieger, Mar 13 2018 *)

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), May 03 2001
a(27) from Jud McCranie, Apr 23 2012
a(26) corrected (was missing least significant digit) by Howard A. Landman, Nov 14 2017

A222291 Least number whose Collatz (3x+1) trajectory has a number greater than 10^n.

Original entry on oeis.org

1, 3, 15, 27, 255, 703, 1819, 9663, 26623, 77671, 159487, 1212415, 4637979, 6631675, 19638399, 80049391, 319804831, 319804831, 319804831, 8528817511, 59436135663, 231913730799, 272025660543, 871673828443, 3716509988199, 3716509988199, 3716509988199
Offset: 0

Views

Author

T. D. Noe, Feb 19 2013

Keywords

Crossrefs

Cf. A006884 (3x+1 records), A222292 (base-2 version).
Cf. A224538.

A222292 Least number whose Collatz 3x+1 trajectory contains a number >= 2^n.

Original entry on oeis.org

1, 2, 3, 3, 3, 7, 15, 15, 27, 27, 27, 27, 27, 27, 447, 447, 703, 703, 1819, 1819, 1819, 4255, 4255, 9663, 9663, 20895, 26623, 60975, 60975, 60975, 77671, 113383, 159487, 159487, 159487, 665215, 1042431, 1212415, 2684647, 3041127, 4637979, 5656191, 6416623
Offset: 0

Views

Author

T. D. Noe, Feb 19 2013

Keywords

Comments

Are the unique values a subset of A006884? - Ralf Stephan, May 27 2013
This sequence is important for the computation of Collatz numbers. It shows that using 32-bit integers, only numbers less than 159487 can have their Collatz trajectory computed.

Crossrefs

Cf. A025586, A222291 (base-10 version).
Cf. A095384.

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 i, t; t:=2^n;
          for i while b(i)Alois P. Heinz, Sep 25 2024

Extensions

a(1) corrected by Kevin Ge, Sep 25 2024

A224538 Number of numbers k such that all terms of the Collatz (3x+1) iteration of k are <= 10^n.

Original entry on oeis.org

1, 4, 49, 340, 4235, 39706, 397068, 3970918, 39523168, 395436300, 3953296865
Offset: 0

Views

Author

T. D. Noe, Apr 24 2013

Keywords

Examples

			For n = 1, the four k are 1, 2, 4, and 8.
		

Crossrefs

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Table[Length[Select[Range[10^n], Max[Collatz[#]] <= 10^n &]], {n, 0, 5}]

Extensions

a(10) from Donovan Johnson, Jun 05 2013
Previous Showing 11-20 of 24 results. Next