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 41-50 of 58 results. Next

A220071 Difference between number of halving steps and number of tripling steps needed to reach 1 in '3x+1' problem.

Original entry on oeis.org

0, 1, 3, 2, 3, 4, 6, 3, 7, 4, 6, 5, 5, 7, 7, 4, 6, 8, 8, 5, 5, 7, 7, 6, 9, 6, 29, 8, 8, 8, 28, 5, 10, 7, 7, 9, 9, 9, 12, 6, 29, 6, 11, 8, 8, 8, 28, 7, 10, 10, 10, 7, 7, 30, 30, 9, 12, 9, 12, 9, 9, 29, 29, 6, 11, 11, 11, 8, 8, 8, 28, 10, 31, 10, 8, 10, 10, 13
Offset: 1

Views

Author

Jayanta Basu, Feb 19 2013

Keywords

Comments

This sequence can also be defined as: a(1) = 0; thereafter a(2*k) = a(k) + 1, a(2*k+1) = a(6*k+4) - 1. - Gionata Neri, Jul 17 2016

Crossrefs

Programs

Formula

a(n) = A006666(n) - A006667(n).
a(n) = a(A085062(n)) + 1 for n >= 2. - Alan Michael Gómez Calderón, Jan 26 2025

Extensions

More terms from Alois P. Heinz, Feb 19 2013

A248037 Numbers n such that the ratio of tripling steps to halving steps in the Collatz (3x+1) trajectory of n is greater than all previous ratios.

Original entry on oeis.org

2, 3, 7, 9, 27, 230631, 626331, 837799, 1723519, 3732423, 5649499, 6649279, 8400511, 63728127, 3743559068799, 100759293214567, 104899295810901231
Offset: 1

Views

Author

Derek Orr, Sep 29 2014

Keywords

Comments

Equivalently, numbers n such that A006667(n)/A064433(n) > A006667(m)/A064433(m) for all 0 < m < n.
A006667(n) is the number of tripling steps in the Collatz (3x+1) problem and A064433(n) is the number of halving steps in the Collatz (3x+1) problem.
It is crucial to make A006667(n) the numerator as it can be zero when n = 2^k for some k > 0.
a(n) is odd for all n > 1.
The corresponding ratios are:
0.0000000000000000000000000000... (2)
0.4000000000000000000000000000... (3)
0.4545454545454545454545454545... (7)
0.4615384615384615384615384615... (9)
0.5857142857142857142857142857... (27)
0.5899280575539568345323741007... (230631)
0.5924764890282131661442006269... (626331)
0.5927051671732522796352583586... (837799)
0.5931232091690544412607449856... (1723519)
0.5935828877005347593582887700... (3732423)
0.5937500000000000000000000000... (5649499)
0.5961538461538461538461538461... (6649279)
0.5967365967365967365967365967... (8400511)
0.6030405405405405405405405405... (63728127)
0.6035196687370600414078674948... (3743559068799)
If we define a "tripling step" to also include a "halving step" afterwards (since 3*n+1 converts an odd number n into an even number, so a halving step will always follow), the ratios are still maximum at the a(n) values. However, the ratios themselves are different. The corresponding ratios in this case are:
0.000000000000000000000000000... (2)
0.666666666666666666666666666... (3)
0.833333333333333333333333333... (7)
0.857142857142857142857142857... (9)
1.413793103448275862068965517... (27)
1.438596491228070175438596491... (230631)
1.453846153846153846153846153... (626331)
1.455223880597014925373134328... (837799)
1.457746478873239436619718309... (1723519)
1.460526315789473684210526315... (3732423)
1.461538461538461538461538461... (5649499)
1.476190476190476190476190476... (6649279)
1.479768786127167630057803468... (8400511)
1.519148936170212765957446808... (63728127)
1.656946826758147512864493997... (3743559068799)
From Jon E. Schoenfield, Nov 21 2015: (Start)
Let T and H be the number of tripling steps and halving steps, respectively, in the entire Collatz (3x+1) trajectory of a number n. Since each tripling step increases the value by a factor greater than 3, and each halving step decreases it by a factor of exactly 2, we have n * 3^T / 2^H < 1, from which T/H < log(2)/log(3) - log_3(n)/H, so the ratio T/H cannot exceed log(2)/log(3) = 0.6309297535...
It seems likely that the present sequence is a subsequence of A006877 (which consists of values n whose trajectories are of record length). Taking as values of n the terms from the b-file for A006877, and generating their trajectories to obtain the corresponding values of H(n), it does not seem clear whether log_3(n)/H(n) is converging toward zero or toward some positive limit, perhaps around 0.020 (which would mean T/H < log(2)/log(3) - 0.020, i.e., T/H < 0.611).
The known terms n in A006877 at which log_3(n)/H(n) reaches a record low coincide almost exactly with the known terms of this sequence, the only exception thus far being a(11) = A006877(52) = 5649499, at which log_3(n)/H(n) is only slightly larger than it is at a(10) = A006877(51) = 3732423 (0.03685302 vs. 0.03682956). Given the values of log_3(n)/H(n) for the remaining known terms in A006877, it seems likely that
a(16) = A006877(110) = 100759293214567
and that a(17) exceeds A006877(130), which is 46785696846401151.
(End)
Note that a(17)=104899295810901231 has now been found by Eric Roosendaal's distributed project (see link below). - Dmitry Kamenetsky, Sep 23 2016
For n>=14, a(n) must be 7, 15, 27, or 31 (mod 32). This is because all other values provably have a ratio of tripling to halving steps of less than 0.6 (see program by Irvine and Consiglio Jr.). - Dmitry Kamenetsky, Sep 24 2016

Crossrefs

Programs

  • PARI
    Tratio(n)=c=0; d=0; while(n!=1,if(n==Mod(0,2),n=n/2;d++); if(n==Mod(1,2)&&n!=1,n=3*n+1;c++));c/d
    print1(2,", "); n=2; p=Tratio(2); while(n,t=Tratio(n+1); if(p>=t,n+=2); if(p
    				

Extensions

Corrected and extended by Sean A. Irvine, Derek Orr, and David Consiglio, Jr., Nov 23 2015
a(16) from David Consiglio, Jr. and Sean A. Irvine, Nov 26 2015
a(17) added by Dmitry Kamenetsky, Sep 23 2016

A304174 Decimal expansion of 2^61/(3^32*993), the conjectured maximal residue in the Collatz 3x+1 problem.

Original entry on oeis.org

1, 2, 5, 3, 1, 4, 2, 1, 4, 4, 3, 9, 5, 0, 6, 8, 0, 5, 0, 1, 6, 5, 4, 9, 5, 2, 9, 7, 8, 3, 9, 0, 4, 6, 1, 4, 2, 4, 8, 6, 1, 5, 3, 6, 5, 9, 7, 3, 9, 6, 5, 1, 3, 6, 9, 2, 7, 6, 3, 0, 4, 6, 5, 5, 5, 7, 3, 6, 7, 5, 8, 6, 4, 8, 9, 7, 4, 7, 8, 3, 0, 0, 8, 7, 8, 4, 0, 1, 1, 2, 8, 5, 4, 9, 9, 7, 5, 3, 1, 3, 5, 3, 6, 7, 7, 4, 7, 9, 1, 5, 6, 1, 6, 0, 2, 5, 5, 1, 8, 5, 9, 2, 4, 3, 8, 4, 5, 7, 7, 8
Offset: 1

Views

Author

M. F. Hasler (following an idea of Michel Lagneau), May 07 2018

Keywords

Comments

The residue of n in the 3x+1 problem is defined as the ratio 2^h(n)/(3^t(n)*n), where h = A006666 is the number of halving steps, and t = A006667 is the number of tripling steps. It is conjectured that n = 993 yields the highest possible residue. See e.g. the Roosendaal page, and A127789 for indices of record residues.

Examples

			res(993) = 1.253142144395068050165495297839461424861536597396513692763...
		

Crossrefs

Cf. A006370 (Collatz map), A014682 (condensed version), A127789 (indices of record residues).
Cf. A006666 (halving steps), A006667 (tripling steps), A006577 (total).

Programs

  • Mathematica
    First[RealDigits[2^61/(3^32*993), 10, 100]] (* Paolo Xausa, Mar 10 2024 *)
  • PARI
    2^61/(3^32*993.) \\ Or, to find this value experimentally:
    (c(n,c=[0,0])=while(n>1,bittest(n,0)&&c[1]++&&(n=n*3+1)&&next;n\=2;c[2]++);c); m=1;for(n=1,oo,m<<(t=c(n))[2]>n*3^t[1]||next;m=n*3^t[1]/2^t[2];printf("res(%d) = %f\n",n,1./m )) \\ M. F. Hasler, May 07 2018

Formula

res(993) = 2^61/(3^32*993).

A380244 The Collatz (or 3x+1) trajectory starting at a(n) contains exactly n odd integers and a(n) is the n-th number with this property.

Original entry on oeis.org

1, 10, 12, 68, 45, 30, 72, 101, 134, 179, 237, 314, 422, 551, 723, 509, 1282, 887, 1170, 1535, 2021, 1509, 1899, 2412, 1780, 2217, 3170, 3867, 2819, 3728, 2511, 3155, 3972, 2802, 3578, 2623, 3444, 4302, 3087, 3968, 2690, 1806, 2336, 1593, 2084, 2757, 1884, 2477
Offset: 1

Views

Author

Alois P. Heinz, Jan 17 2025

Keywords

Examples

			a(2) = 10 is the second integer (after 5) having exactly two odd integers in the Collatz trajectory: 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1.
		

Crossrefs

Main diagonal of A354236.

Programs

  • Maple
    b:= proc(n) option remember; irem(n, 2, 'r')+
          `if`(n=1, 0, b(`if`(n::odd, 3*n+1, r)))
        end:
    A:= proc() local h, p, q; p, q:= proc() [] end, 0;
          proc(n, k)
            if k=1 then return 2^(n-1) fi;
            while nops(p(k)) A(n$2):
    seq(a(n), n=1..48);

Formula

A078719(a(n)) = n.

A220182 Number of changes of parity in the Collatz trajectory of n.

Original entry on oeis.org

0, 1, 4, 1, 2, 5, 10, 1, 12, 3, 8, 5, 4, 11, 10, 1, 6, 13, 12, 3, 2, 9, 8, 5, 14, 5, 82, 11, 10, 11, 78, 1, 16, 7, 6, 13, 12, 13, 22, 3, 80, 3, 18, 9, 8, 9, 76, 5, 14, 15, 14, 5, 4, 83, 82, 11, 20, 11, 20, 11, 10, 79, 78, 1, 16, 17, 16, 7, 6, 7, 74, 13, 84, 13
Offset: 1

Views

Author

Jayanta Basu, Feb 20 2013

Keywords

Comments

For n < 10^10, if n <> 27, f(n) is finite, f(n) < 3n + 1. If n = 27 = 3^3, f(n) = 82 = 81 + 1 = 3^4 + 1 = 3n + 1. I conjecture that for any n <> 27, f(n) is finite, f(n) < 3n + 1. - Sergey Pavlov, Jun 02 2019. Note that this conjecture is stronger than the Collatz conjecture. - Andrey Zabolotskiy, Jun 13 2019

Examples

			For n=5, Collatz trajectory for 5 is: 5,16,8,4,2,1; hence the number of transitions between odd and even parity is a(5)=2.
Similarly for n=11, Collatz trajectory gives 11,34,17,52,26,13,40,20,10,5,16,8,4,2,1; implies that a(11)=8.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, E16

Crossrefs

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; parity[n_] := If[OddQ[n], 1, 0]; Table[p = parity /@ Collatz[n]; If[OddQ[n], 2*Total[p] - 2, 2*Total[p] - 1], {n, 100}] (* T. D. Noe, Feb 24 2013 *)
  • PARI
    next_iter(n) = if(n%2==0, return(n/2), return(3*n+1))
    parity(n) = n%2
    a(n) = my(x=n, par=parity(x), i=0); while(x > 1, x=next_iter(x); if(parity(x)!=par, i++; par=parity(x))); i \\ Felix Fröhlich, Jun 02 2019

Formula

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

A221468 The Collatz (3x+1) iteration in A220145 converted to decimal.

Original entry on oeis.org

1, 2, 133, 4, 33, 266, 67733, 8, 541865, 66, 16933, 532, 529, 135466, 135253, 16, 4233, 1083730, 1083717, 132, 129, 33866, 33813, 1064, 8669737, 1058, 2678946987458595510314019806849701, 270932, 270929, 270506, 83717093358081109697313118964053, 32, 69357897
Offset: 1

Views

Author

T. D. Noe, Jan 17 2013

Keywords

Comments

Sequence A005186 tells how many of these numbers are in [2^n, 2^(n+1)-1].
From Rémy Sigrist, Aug 19 2017: (Start)
a(2^n) = 2^n for any n >= 0.
A000120(a(n)) - 1 = A006667(n) for any n > 0.
A070939(a(n)) - 1 = A006577(n) for any n > 0.
All terms are Fibbinary numbers (A003714).
(End)

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[#, 2] &@ Boole@ OddQ@ Reverse@ NestWhileList[If[EvenQ@ #, #/2, 3 # + 1] &, n, # > 1 &], {n, 33}] (* Michael De Vlieger, Aug 19 2017 *)
  • PARI
    a(n) = my (v=0, p=1); while (n>1, if (n%2, n = 3*n+1; v += p, n = n/2); p *= 2); return (p+v) \\ Rémy Sigrist, Aug 19 2017

A302338 a(n) = 3*n + 2^v(n) where v(n) denotes the 2-adic valuation of n.

Original entry on oeis.org

4, 8, 10, 16, 16, 20, 22, 32, 28, 32, 34, 40, 40, 44, 46, 64, 52, 56, 58, 64, 64, 68, 70, 80, 76, 80, 82, 88, 88, 92, 94, 128, 100, 104, 106, 112, 112, 116, 118, 128, 124, 128, 130, 136, 136, 140, 142, 160, 148, 152, 154, 160, 160, 164, 166, 176, 172, 176, 178
Offset: 1

Views

Author

Rémy Sigrist, Apr 28 2018

Keywords

Comments

The sequence can be seen as a variant of the Collatz map (A006370) where we perform only tripling steps.
If the 3x+1 (or Collatz) conjecture is true, then for any n > 0, A006667(n) is the least k such that a^k(n) is a power of two (where a^k denotes the k-th iterate of the sequence).

Examples

			a(42) = 3*42 + 2^1 = 128.
		

Crossrefs

Programs

  • Magma
    [3*n+2^Valuation(n, 2): n in [1..60]]; // Vincenzo Librandi, Apr 29 2018
  • Maple
    seq(3*n+2^padic:-ordp(n,2), n=1..100); # Robert Israel, Apr 29 2018
  • Mathematica
    Table[3 n + 2^IntegerExponent[n, 2], {n, 60}] (* Vincenzo Librandi, Apr 29 2018 *)
  • PARI
    a(n) = 3*n + 2^valuation(n, 2)
    

Formula

a(n) = 3*n + 2^A007814(n).
a(2*n) = 2*a(n).
a(2*k + 1) = A006370(2*k + 1) for any k >= 0.

A350369 a(n) is the length of the longest sequence of consecutive tripling steps in the Collatz (3x+1) sequence beginning at n.

Original entry on oeis.org

0, 0, 2, 0, 1, 2, 3, 0, 3, 1, 2, 2, 1, 3, 4, 0, 1, 3, 2, 1, 1, 2, 3, 2, 2, 1, 6, 3, 2, 4, 6, 0, 2, 1, 2, 3, 3, 2, 3, 1, 6, 1, 3, 2, 1, 3, 6, 2, 3, 2, 2, 1, 1, 6, 6, 3, 3, 2, 2, 4, 3, 6, 6, 0, 3, 2, 2, 1, 1, 2, 6, 3, 6, 3, 2, 2, 2, 3, 4, 1, 3, 6, 6, 1, 1, 3, 3
Offset: 1

Views

Author

Kevin P. Thompson, Dec 27 2021

Keywords

Comments

"Consecutive tripling steps" are repeated (3x+1)/2 operations that are not interrupted by a second division by 2.
This sequence attempts to measure the largest upward thrust in each Collatz sequence and so is correlated to some degree with the maximum value (A025586) and length (A006577) of Collatz sequences.
If n = 2^x * (2^y*z - 1), then a(n) >= y. - Charles R Greathouse IV, Oct 25 2022

Examples

			The Collatz sequence for n=7 has a streak of 3 consecutive tripling steps (at 7, 11, and 17), so a(7) = 3.
7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1
^      ^       ^
		

Crossrefs

Programs

  • PARI
    a(n)=my(c,r); n>>=valuation(n,2); while(n>1, n+=(n+1)/2; if(n%2, c++, r=max(r,c+1); n>>=valuation(n,2); c=0)); max(r,c) \\ Charles R Greathouse IV, Oct 25 2022

A267435 Numbers n such that each reduced Collatz trajectory (mod p): (n, T(n), T(T(n)),..., 4, 2, 1) / pZ, where the odd prime p is the number of iterations needed to reach 1, contains exactly the p-1 values {1, 2, 3, .., p-1}.

Original entry on oeis.org

8, 20, 32, 320, 2048, 2216, 8192, 13312, 87040, 218432, 524288, 89478400, 536870912, 137438953472, 250199979283796, 9007199254740992, 63800994005254144, 96076791692656640, 382805968326492160, 576460752303423488, 2305843009213693952, 4099276399740365440
Offset: 1

Views

Author

Michel Lagneau, Jan 15 2016

Keywords

Comments

Or numbers n such that the multiplicative groups {n, T(n), T(T(n)),..., 4, 2, 1} / pZ are of order p-1.
Property of the sequence:
This sequence provides a link with Artin’s conjecture on primitive roots.
Conjecture: the sequence is infinite (corollary of a Artin’s conjecture because the sequence contains the numbers 2^A001122(k) where A001122 are the primes with primitive root 2).
The sequence is divided into two class of numbers:
i) A class of powers of 2: 2^3, 2^5, 2^11, 2^13, 2^19, 2^29, 2^37, 2^53, ..., 2^A001122(k),…
ii) A class of non-powers of 2: 20, 320, 2216, 13312, 87040, 218432, 89478400...
The corresponding p of the sequence are 3, 7, 5, 11, 11, 19, 13, 19, 19, 23, 19, 29,...

Examples

			20 is in the sequence because the Collatz trajectory of 20 is {20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1} with 7 iterations, and the corresponding reduced trajectory (mod 7) is {6, 3, 5, 2, 1, 4, 2, 1} => the multiplicative group of order 6 is G = {1, 2, 3, 4, 5, 6}.
		

Crossrefs

Programs

  • Maple
    nn:=10000:T:=array(1..2000):U:=array(1..2000):
    for n from 1 to 10000000 do:
      kk:=1:m:=n:T[kk]:=n:it:=0:
        for i from 1 to nn while(m<>1) do:
         if irem(m,2)=0
           then
           m:=m/2:kk:=kk+1:T[kk]:=m:it:=it+1:
           else
           m:=3*m+1:kk:=kk+1:T[kk]:=m:it:=it+1:
         fi:
        od:
          if isprime(it)
           then
           lst:={}:
           for p from 1 to it do:
            lst:=lst union {irem(T[p],it)}:
           od:
            n0:=nops(lst):
            if n0=it-1 and lst[1]=1
             then
             print(n):
             else
            fi:
          fi:
        od:

Extensions

a(14)-a(22) from Hiroaki Yamanouchi, Jan 19 2016

A282408 Numbers k for which the number of odd members and the number of even members in the Collatz (3x+1) trajectory are both a perfect square.

Original entry on oeis.org

1, 2, 16, 17, 322, 323, 512, 1595, 1598, 1599, 1609, 1614, 1615, 1627, 1641, 1643, 1657, 1663, 1776, 1780, 1781, 1784, 1786, 2176, 2208, 2216, 2218, 2240, 2256, 2260, 2261, 2274, 2275, 2400, 2408, 2410, 2416, 2417, 2420, 2421, 3844, 3845, 3846, 3848, 3850, 3852
Offset: 1

Views

Author

Michel Lagneau, Feb 14 2017

Keywords

Comments

Or numbers m such that A078719(m) and A006666(m) are both a perfect square.
For k < 5*10^6, the fourteen distinct pairs of squares in the order of appearance are: (1, 0), (1, 1), (1, 4), (4, 9), (36, 64), (1, 9), (25, 49), (4, 16), (16, 36), (9, 25), (1, 16), (81, 144), (4, 25) and (64, 121).
The numbers 2^(m^2) = A002416(m) are in the sequence, and the corresponding pairs of squares are (1, m^2).
Number of terms <= 10^h: 2, 4, 7, 202, 203, 474, 20888, etc. Robert G. Wilson v, Feb 14 2017

Examples

			17 is in the sequence because the Collatz trajectory is 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 => the number of odd members is 4 = 2^2 and number of even members is 9 = 3^2.
		

Crossrefs

Programs

  • Maple
    nn:=10^6:
    for n from 1 to 10000 do:
      m:=n:i1:=1:i2:=0:
       for i from 1 to nn while(m<>1) do:
        if irem(m,2)=0
         then
         m:=m/2:i2:=i2+1:
         else
         m:=3*m+1:i1:=i1+1:
        fi:
       od:
        if sqrt(i1)=floor(sqrt(i1)) and sqrt(i2)=floor(sqrt(i2))
         then
         printf(`%d, `,n):
         else
        fi:
    od:
  • Mathematica
    fQ[n_] := Block[{m = n, e = 0, o = 1}, While[m > 1, If[OddQ@ m, m = 3 m + 1; o++, m /= 2; e++]]; IntegerQ@ Sqrt@ e && IntegerQ@ Sqrt@ o]; Select[ Range@ 3855, fQ] (* Robert G. Wilson v, Feb 14 2017 *)
    memsqQ[n_]:=Module[{col=NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#!=1&]}, AllTrue[ {Sqrt[ Count[ col, ?(EvenQ[#]&)]],Sqrt[Count[col,?(OddQ[ #]&)]]},IntegerQ]]; Select[Range[4000],memsqQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Sep 04 2018 *)
Previous Showing 41-50 of 58 results. Next