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

A211981 Numbers n such that floor(2^A006666(n)/3^A006667(n)) = n.

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 10, 16, 21, 32, 42, 64, 75, 85, 113, 128, 151, 170, 227, 256, 341, 512, 682, 1024, 1365, 2048, 2730, 4096, 5461, 7281, 8192, 10922, 14563, 16384, 21845, 32768, 43690, 65536, 87381, 131072, 174762, 262144, 349525, 466033, 524288, 699050, 932067
Offset: 1

Views

Author

Michel Lagneau, Feb 13 2013

Keywords

Comments

A006666 and A006667 give the number of halving and tripling steps to reach 1 in 3x+1 problem.
Properties of this sequence:
A006667(a(n)) <= 3, and if a(n) is even then a(n)/2 is in the sequence.
The sequence A000079(n) (power of 2) is included in this sequence.
{a(n)} = E1 union E2 where E1 = {A000079(n)} union {5, 10, 21, 85, 170, 227, 341, 682, 1365, 2730, 5461, ...} and E2 = {75, 113, 151, 7281, ...}. If an element k of E1 generates the Collatz sequence of iterates k -> T_1(k) -> T_2(k) -> T_3(k) -> ... then any T_i(k) is an element of E1 of the form [2^a /3^b] where a = A006666(n), or A006666(n)-1, or ... and b = A006667(n), or A006667(n)-1, or ... But if k is an element of E2, there exists at least an element T_i(k) that is not in the sequence a(n). For example 75 -> 226 ->113 -> 340 -> ... and 226 is not in the sequence because, if [x] = [2^a /3^b] = [ x. x0 x1 x2 ...], the rational number 0.x0 x1 x2 ... > 0.666666.... => [2^a /3^(b-1)] of the form [(3x+2).y0 y1 y2 ...], and this integer is different from T_(i+1)(k) = [(3x+1).y0 y1 y2 ...] = 3x+1.
Example: T_2(75) = floor(2^10 /3^2) = 113 => floor(2^10/3^1) = 341 instead T_3(75) = 340.

Examples

			227 is in the sequence because A006666(227) = 11, A006667(227) = 2 => floor(2^11/3^2) = 227.
The Collatz trajectory of 227 is 227 -> 682 -> 341 -> 1024 -> 512 -> ... -> 2 -> 1, and 227 is in the subset E1 implies the following Collatz iterates:
227 = floor(2^11/3^2);
682 = floor(2^11/3^1);
341 = floor(2^10/3^1);
1024 = floor(2^10/3^0);
512 = floor(2^9/3^0);
256 = floor(2^8/3^0);
128 = floor(2^7/3^0);
...
2 = floor(2^1/3^0);
1 = floor(2^0/3^0);
With the numbers of E1, we obtain another formulation of the Collatz problem.
		

Crossrefs

Programs

  • Maple
    A:= proc(n) if type(n, 'even') then n/2; else 3*n+1 ; end if; end proc:
    B:= proc(n) a := 0 ; x := n ; while x > 1 do x := A(x) ; a := a+1 ; end do; a ; end proc:
    C:= proc(n) a := 0 ; x := n ; while x > 1 do if type(x, 'even') then x := x/2 ; else x := 3*x+1 ; a := a+1 ; end if; end do; a ; end proc:
    D:= proc(n) C(n) ; end proc:
    A006666:= proc(n) B(n)- C(n) ; end:
    A006667:= proc(n) C(n)- D(n) ; end:
    G:= proc(n) floor(2^ A006666 (n)/3^ A006667 (n)) ; end:
    for i from 1 to 1000000 do: if G(i) =i then printf(`%d, `,i):else fi:od:
  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; nn = 30; t = {}; n = 0; While[Length[t] < nn, n++; c = Collatz[n]; ev = Length[Select[c, EvenQ]]; od = Length[c] - ev - 1; If[Floor[2^ev/3^od] == n, AppendTo[t, n]]]; t (* T. D. Noe, Feb 13 2013 *)

A225089 a(n) = floor(2^A006666(m)/3^A006667(m)) - m, where m = 2n + 1.

Original entry on oeis.org

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

Views

Author

Michel Lagneau, Apr 27 2013

Keywords

Comments

A006666 and A006667 are the number of halving and tripling steps to reach 1 in 3x+1 problem.
Properties of this sequence:
a(m) = 0 for m = A211981(m).

Examples

			a(9) = 3 because floor(2^A006666(19)/3^A006667(19)) - 19 = floor(2^14 /3^6) - 19 = floor(22.474622) - 19 = 22 - 19 = 3.
		

Crossrefs

Programs

  • Maple
    A:= proc(n) if type(n, 'even') then n/2; else 3*n+1 ; end if; end proc:
    B:= proc(n) a := 0 ; x := n ; while x > 1 do x := A(x) ; a := a+1 ; end do; a ; end proc:
    C:= proc(n) a := 0 ; x := n ; while x > 1 do if type(x, 'even') then x := x/2 ; else x := 3*x+1 ; a := a+1 ; end if; end do; a ; end proc:
    D:= proc(n) C(n) ; end proc:
    A006666:= proc(n) B(n)- C(n) ; end:
    A006667:= proc(n) C(n)- D(n) ; end:
    G:= proc(n) floor(2^A006666 (n)/3^A006667 (n)) ; end:
    for i from 1 to 100 do: printf(`%d, `, G(i)-i):od:
  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; nn = 100; t = {}; n = 0; While[Length[t] < nn, n++; c = Collatz[n]; ev = Length[Select[c, EvenQ]]; od = Length[c] - ev - 1; AppendTo[t, Floor[2^ev/3^od]-n]]; t

A287798 Least k such that A006667(k)/A006577(k) = 1/n.

Original entry on oeis.org

159, 6, 5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560, 5120, 10240, 20480, 40960, 81920, 163840, 327680, 655360, 1310720, 2621440, 5242880, 10485760, 20971520, 41943040, 83886080, 167772160, 335544320, 671088640, 1342177280, 2684354560, 5368709120, 10737418240
Offset: 3

Views

Author

Michel Lagneau, Jun 01 2017

Keywords

Comments

A006667: number of tripling steps to reach 1 in '3x+1' problem.
A006577: number of halving and tripling steps to reach 1 in '3x+1' problem.
a(n) = {159, 6} union {A020714}.

Examples

			a(3) = 159 because A006667(159)/A006577(159) = 18/54 = 1/3.
		

Crossrefs

Cf. A006577, A006666, A006667. Essentially the same as A020714, A084215, A146523 and A257113.

Programs

  • Maple
    nn:=10^12:
    for n from 3 to 35 do:
    ii:=0:
    for k from 2 to 10^6 while(ii=0) do:
      m:=k:s1:=0:s2:=0:
       for i from 1 to nn while(m<>1) do:
        if irem(m,2)=0
         then
         s2:=s2+1:m:=m/2:
         else
         s1:=s1+1:m:=3*m+1:
        fi:
       od:
        if n*s1=s1+s2
         then
         ii:=1: printf(`%d, `,k):
         else
        fi:
    od:od:
  • Mathematica
    f[u_]:=Module[{a=u,k=0},While[a!=1,k++;If[EvenQ[a],a=a/2,a=a*3+1]];k];Table[f[u],{u,10^7}];g[v_]:=Count[Differences[NestWhileList[If[EvenQ[#],#/2,3#+1]&,v,#>1&]],_?Positive];Table[g[v],{v,10^7}];Do[k=3;While[g[k]/f[k]!=1/n,k++];Print[n," ",k],{n,3,35}]
  • PARI
    a(n) = if(n < 5, [0,0,159,6][n], 5<<(n-5)) \\ David A. Corneth, Jun 01 2017
    
  • PARI
    Vec(x^3*(159 - 312*x - 7*x^2) / (1 - 2*x) + O(x^50)) \\ Colin Barker, Jun 01 2017

Formula

For n >= 5, a(n) = 5*2^n/32. - David A. Corneth, Jun 01 2017
From Colin Barker, Jun 01 2017: (Start)
G.f.: x^3*(159 - 312*x - 7*x^2) / (1 - 2*x).
a(n) = 2*a(n-1) for n>5.
(End)

A265099 Least k such that floor(2^A006666(k)/3^A006667(k)) - k = n.

Original entry on oeis.org

1, 6, 9, 19, 18, 27, 33, 37, 36, 50, 43, 56, 59, 66, 57, 74, 78, 72, 97, 87, 86, 98, 112, 119, 118, 134, 123, 115, 114, 130, 149, 148, 157, 135, 179, 144, 153, 187, 220, 174, 173, 172, 197, 196, 255, 224, 238, 219, 236, 203, 249, 268, 247, 246, 230, 229, 228
Offset: 0

Views

Author

Michel Lagneau, Dec 01 2015

Keywords

Comments

A006666 and A006667 are the number of halving and tripling steps to reach 1 in 3x+1 problem.
Conjecture: k exists for all n.
In other words, given an integer n, there always exists at least an integer k and a pair of integers (a, b) such that n + k = 2^a/3^b where a is the number of halving steps to reach 1, and b is the number of tripling steps to reach 1, in the 3x+1 problem.

Examples

			a(0) = 1 because A006666(1) = 0 and A006667(1) = 0 => floor(2^0/3^0) - 1 = 1 - 1 = 0;
a(1) = 6 because A006666(6) = 6 and A006667(6) = 2 => floor(2^6/3^2) - 6 = floor(64/9) - 6 = 7 - 6 = 1.
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[Collatz[k_]:=NestWhileList[If[EvenQ[#],#/2,3 #+1]&,k,#>1&];nn=500;t={};k=0;While[Length[t]
    				

A277367 a(n) = gcd(A006666(n), A006667(n)) where A006666 and A006667 are respectively the number of halving and tripling steps in the '3x+1' problem.

Original entry on oeis.org

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

Views

Author

Michel Lagneau, Oct 11 2016

Keywords

Examples

			a(17) = 3 because gcd(A006666(17), A006667(17)) = gcd(9, 3) = 3.
		

Crossrefs

Programs

Formula

a(2^m) = m.

A281665 Numbers m such that A006667(m)/A006577(m) = 1/3.

Original entry on oeis.org

159, 283, 377, 502, 503, 603, 615, 668, 669, 670, 799, 807, 888, 890, 892, 893, 1063, 1065, 1095, 1186, 1187, 1188, 1189, 1190, 1417, 1435, 1580, 1581, 1582, 1585, 1586, 1587, 1889, 1913, 1947, 1959, 1963, 2104, 2106, 2108, 2109, 2113, 2114, 2115, 2119, 2518
Offset: 1

Views

Author

Michel Lagneau, Jan 31 2017

Keywords

Comments

A006667: number of tripling steps to reach 1 in '3x+1' problem.
A006577: number of halving and tripling steps to reach 1 in '3x+1' problem.
The corresponding number of iterations A006577(a(n)) is given by the sequence 54, 60, 63, 66, 66, 69, 69, 69, 69, 69, 72, 72, 72, 72, 72, 72, 75, 75, ... and the set of the distinct values of this sequence is {b(n)} = {54, 60, 63, 66, 69, 72, 75, 78, 81, 84, 87, 90, 93, 96, 99, 102, 105, 108, 111, 114, 117, 120, ...}. We observe that {b(k)} = {54} union {60 + 3*k} for k = 1, 2, ...

Examples

			159 is in the sequence because A006667(159)/A006577(159) = 18/54 = 1/3.
		

Crossrefs

Programs

  • Maple
    nn:=10000:
    for n from 2 to 3000 do:
      m:=n:s1:=0:s2:=0:
       for i from 1 to nn while(m<>1) do:
        if irem(m,2)=0
         then
         s2:=s2+1:m:=m/2:
         else
         s1:=s1+1:m:=3*m+1:
        fi:
       od:
       s:=s1/(s1+s2):
        if s=1/3
         then
         printf(`%d, `,n):
         else
        fi:
    od:

A281938 a(n) is the least k such that gcd(A006666(k), A006667(k)) = n.

Original entry on oeis.org

2, 4, 8, 16, 32, 64, 128, 256, 512, 82, 129, 4096, 327, 16384, 32768, 1249, 35655, 159, 4926, 283, 377, 502, 603, 799, 1063, 1417, 1889, 2518, 3356, 4472, 5960, 7944, 10594, 14124, 18833, 25110, 33481, 44641, 59521, 79361, 105814, 141084, 188113, 250817, 334422
Offset: 1

Views

Author

Michel Lagneau, Feb 02 2017

Keywords

Comments

A006666: Number of halving steps to reach 1 in '3x+1' problem.
A006667: number of tripling steps to reach 1 in '3x+1' problem.
a(n) = 2^n for n = 1, 2, 3, 3, 4, 5, 6, 7, 8, 9, 12, 14, 15.
The primes in the sequence are 2, 283, 1063, 1249, 1889, 44641, ...

Examples

			a(10) = 82 because gcd(A006666(82), A006667(82)) = gcd(70, 40) = 10, and there is no k < 82 such that gcd(A006666(k), A006667(k)) = 10.
		

Crossrefs

Programs

  • Maple
    for n from 1 to 45 do:
    ii:=0:
    for k from 2 to 10^7 while(ii=0) do:
      m:=k:s1:=0:s2:=0:
       for i from 1 to nn while(m<>1) do:
        if irem(m,2)=0
         then
         s2:=s2+1:m:=m/2:
         else
         s1:=s1+1:m:=3*m+1:
        fi:
       od:
        if gcd(s1,s2)=n
         then
         ii:=1:printf(`%d %d \n`,n,k):
         else
        fi:
    od:
    od:
  • Mathematica
    Function[w, First /@ Lookup[w, Function[k, If[k == {}, #, Take[#, First@ k]]]@ Complement[Range@ Max@ #, #]] &@ Keys@ w]@ KeySort@ PositionIndex@ Table[GCD[Count[NestWhileList[If[OddQ[#], 3 # + 1, #/2] &, n, # > 1 &], ?(EvenQ[#] &)], Count[Differences[NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]], ?Positive]], {n, 2^16}] (* Michael De Vlieger, Feb 02 2017, Version 10, after Harvey P. Dale at A006666 and A006667 *)

A304119 Numerators of record low values of the ratio n*3^A006667(n)/2^A006666(n).

Original entry on oeis.org

1, 27, 1701, 6561, 1760826122505, 115093142840908791, 460166680231540515, 1840049047529878113
Offset: 1

Views

Author

Michel Lagneau, May 03 2018

Keywords

Comments

This has been verified for n up to 10^7.
Conjecture: Consider A006666 and A006667, the sequences giving the number of halving and tripling steps to reach 1 in 3x+1 problem. There exists a rational constant c such that c <= n*3^A006667(n)/2^A006666(n) <= 1 where c = 1840049047529878113/2305843009213693952 is the last term in the sequence of the ratios.
Note that n*3^A006667(n)/2^A006666(n) = 1 if n is a power of 2 (A000079).
It seems that n*3^A006667(n)/2^A006666(n) = c for n = 993*2^k, k = 0, 1, 2, ... In this case, c = 993*2^k*3^32/2^(61+k), where 32 = A006667(993*2^k) and 61+k = A006666(993*2^k). For example, c = 993*3^32/2^61 = 1986*3^32/2^62 = 3972*3^32/2^63 = 7944*3^32/2^64 = ...

Examples

			For n=1 to 10 the ratios are: 1, 1, 27/32, 1, 15/16, 27/32, 1701/2048, 1, 6561/8192, 15/16, so the low records are 1, 27/32, 1701/2048, 6561/8192, ...
		

Crossrefs

Cf. A006666, A006667, A127789 (for the indices where these records occur).

Programs

  • Mathematica
    q=1; Collatz[n_]:=NestWhileList[If[EvenQ[#], #/2, 3 #+1]&, n, #>1&]; nn=5000; t={}; n=0; While[Length[t]
    				
  • PARI
    ht(n) = my(h, t); while(n>1, if(n%2, n=3*n+1; t++, n>>=1; h++)); return([h, t]);
    lista(nn) = {m = 2; for (n=1, nn, v = ht(n); newm = n*3^v[2]/2^v[1]; if (newm < m, print1(numerator(newm), ", "); m = newm));} \\ Michel Marcus, May 06 2018

A302175 a(n) = [2^A006666(n)/3^A006667(n)], where [x] = floor(x).

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 8, 11, 10, 12, 14, 14, 16, 16, 16, 18, 22, 22, 21, 21, 25, 25, 28, 29, 28, 32, 33, 33, 33, 36, 32, 39, 37, 37, 44, 44, 44, 47, 42, 48, 42, 53, 50, 50, 50, 54, 56, 59, 59, 59, 56, 56, 64, 64, 67, 71, 67, 71, 67, 67, 72, 72, 64, 79, 79, 79, 75
Offset: 1

Views

Author

Michel Lagneau, Apr 03 2018

Keywords

Comments

The sequence contains A211981 and the powers of 2 (A000079).
There exists a subset E = { 1, 2, 3, 4, 5, 8, 10, 16, 21, 32, 42, 64, 85, 128, 170, 227, 256, 341, 512, 682, 1024, 2048, ...} in {a(n)} such that each element m of E generates the Collatz sequence of iterates m -> T_1(m) -> T_2(m) -> T_3(m) -> ... -> 1 where any T_i(m) is an element of E of the form [2^i /3^j] where i = A006666(m), or A006666(m)-1, or ... and j = A006667(m), or A006667(m)-1, or ..., but with A006667(m) <= 3. If m is even then m/2 is in E.
For example, the statement that "3 is an element of E" implies that each element of the trajectory 3 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 belongs to E. Thus the trajectory of the number 3 can be represented by [2^5/3^2] -> [2^5/3^1] -> [2^4/3^1] -> [2^4/3^0] -> [2^3/3^0] -> [2^2/3^0] -> [2^1/3^0] -> [2^0/3^0].

Examples

			a(39) = [2^A006666(39)/3^A006667(39)] = [2^23/3^11] = [47.353937...] = 47.
		

Crossrefs

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; nn = 70; t = {}; n = 0; While[Length[t] < nn, n++; c = Collatz[n]; ev = Length[Select[c, EvenQ]]; od = Length[c] - ev - 1; AppendTo[t, Floor[2^ev/3^od]]]; t
  • PARI
    a(n) = my(t, h); while(n>1, if(n%2, n=3*n+1; t++, n>>=1; h++)); 2^h\3^t; \\ Michel Marcus, May 05 2018

A303811 Least k such that A006666(k)/A006667(k) = prime(n).

Original entry on oeis.org

159, 6, 10, 40, 640, 2560, 40960, 163840, 2621440, 167772160, 671088640, 42949672960, 687194767360, 2748779069440, 43980465111040, 2814749767106560, 180143985094819840, 720575940379279360, 46116860184273879040, 737869762948382064640, 2951479051793528258560
Offset: 1

Views

Author

Michel Lagneau, Sep 10 2018

Keywords

Comments

A006666 and A006667 are respectively the number of halving and tripling steps in the '3x+1' problem.
For n > 2, it seems that a(n) is of the form a(n) = 5*2^q with q = 1, 3, 7, 9, 13, 15, 19, 25, 27, 33, 37, 39, 43, 49, 55, 57, 63, 67, 69, ... (Numbers q such that q+4 is prime: A172367)

Examples

			a(4) = 40 because A006666(40)/A006667(40) = 7/1 = prime(4).
		

Crossrefs

Programs

  • Maple
    nn:=10^20:
    for n from 1 to 10 do:
    ii:=0:
       for k from 1 to nn while(ii=0) do:
        it0:=0:it1:=0:m:=k:
          for i from 1 to nn while(m<>1) do:
            if irem(m, 2)=0
             then
             m:=m/2:it0:=it0+1:
             else
             m:=3*m+1:it1:=it1+1:
           fi:
         od:
          if it1<>0 and it0/it1 = ithprime(n)
           then
           ii:=1:printf(`%d %d \n`,n,k):
           else
         fi:
    od:
    od:
Showing 1-10 of 58 results. Next