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

A213215 For the Collatz (3x+1) iterations starting with the odd numbers k, a(n) is the smallest k such that the trajectory contains at least n successive odd numbers == 3 (mod 4).

Original entry on oeis.org

1, 3, 7, 15, 27, 27, 127, 255, 511, 1023, 1819, 4095, 4255, 16383, 32767, 65535, 77671, 262143, 459759, 1048575, 2097151, 4194303, 7456539, 16777215, 33554431, 67108863, 125687199, 125687199, 125687199, 1073741823, 2147483647, 4294967295, 8589934591, 17179869183
Offset: 1

Views

Author

Michel Lagneau, Mar 02 2013

Keywords

Comments

The count of odd numbers includes the starting number n if it is part of the longest chain of odd numbers in the sequence.
The sequence is infinite because the Collatz trajectory starting at k = 2^n - 1 contains at least n consecutive odd numbers == 3 (mod 4) such that 3*2^n - 1 -> 3^2*2^(n-1)-1 -> ... -> 2*3^(n-1)-1 and then -> 3^n-1 -> ... but the numbers of this sequence are not always of this form, for example 27, 1819, 4255, 77671, 459759, ...
Equivalently, a(n) is the smallest k such that the Collatz sequence for k suffers at least n consecutive (3x+1)/2 operations (i.e., no consecutive divisions by 2). - Kevin P. Thompson, Dec 15 2021

Examples

			a(4)=15 because the Collatz sequence for 15 (15, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1) is the first Collatz sequence to contain 4 consecutive odd numbers congruent to 3 (mod 4): 15, 23, 35, and 53.
		

Crossrefs

Cf. A222598 (similar).

Programs

  • Maple
    nn:=200:T:=array(1..nn):
    for n from 1 to 20 do:jj:=0:
             for m from 3 by 2 to 10^8 while(jj=0) do:
                   for i from 1 to nn while(jj=0) do:
                   T[i]:=0:od:a:=1:T[1]:=m:x:=m:
                         for it from 1 to 100 while (x>1) do:
                             if irem(x,2)=0 then
                             x := x/2:a:=a+1:T[a]:=x:
                             else
                             x := 3*x+1: a := a+1: T[a]:=x:
                            fi:
                         od:
                         jj:=0:aa:=a:
                           for j from 1 to aa while(jj=0) do:
                             if irem(T[j],4)=3 then
                             T[j]:=1:
                             else
                             T[j]:=0:
                           fi:
                          od:
                             for p from 0 to aa-1 while (jj=0) do:
                             s:=sum(T[p+k],k=1..2*n):
                             if s=n then
                             jj:=1: printf ( "%d %d \n",n,m):
                             else
                             fi:
                      od:
                  od:
               od:
  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; countThrees[t_] := Module[{mx = 0, cnt = 0, i = 0}, While[i < Length[t], i++; If[t[[i]] == 3, cnt++; i++, If[cnt > mx, mx = cnt]; cnt = 0]]; mx]; nn = 15; t = Table[0, {nn}]; n = 1; While[Min[t] == 0, n = n + 2; c = countThrees[Mod[Collatz[n], 4]]; If[c <= nn && t[[c]] == 0, t[[c]] = n; Do[If[t[[i]] == 0, t[[i]] = n], {i, c}]]]; t (* T. D. Noe, Mar 02 2013 *)

Extensions

Definition clarified, a(1) inserted, and a(21)-a(34) added by Kevin P. Thompson, Dec 15 2021

A350370 a(n) is the smallest k such that the Collatz sequence for k includes a record number of consecutive tripling steps.

Original entry on oeis.org

1, 3, 7, 15, 27, 127, 255, 511, 1023, 1819, 4095, 4255, 16383, 32767, 65535, 77671, 262143, 459759, 1048575, 2097151, 4194303, 7456539, 16777215, 33554431, 67108863, 125687199, 1073741823, 2147483647, 4294967295, 8589934591, 17179869183, 20361326439, 68719476735
Offset: 1

Views

Author

Kevin P. Thompson, Dec 27 2021

Keywords

Comments

See A350369 for a description of "consecutive tripling steps."
Records for A350369, recorded by the Collatz sequence starting value.
Differs from A213215 in that repeated values are removed, i.e., if a gap in the number of consecutive tripling steps occurs, A213215 will report the starting value multiple times but this sequence will not. Example: The Collatz sequence for 15 has 4 tripling steps but the sequence for 27 has 6, so 27 is reported by A213215 for n=5 and n=6. This sequence only reports 27 once as having set a new record.
Differs from A222598 in that certain consecutive tripling step lengths will not be represented here when a gap in the record number of consecutive tripling steps occurs. Example: Since the consecutive tripling step record moves from 4 in the Collatz sequence for 15 to 6 in the Collatz sequence for 27, this sequence will not report the Collatz sequence for 159 with 5 consecutive tripling steps like A222598 does.

Examples

			a(5) = 27 since the Collatz sequence for 27 is the 5th sequence to set a record for the most consecutive tripling steps, i.e., A350369(27) = 6 is the first occurrence of 6 in A350369.
		

Crossrefs

Programs

  • Mathematica
    k=0;nmax=0;Do[While[t=0;max=0;NestWhileList[If[OddQ@#,t++;If[t>max,max=t];(3#+1)/2,t=0;#/2]&,++k,#!=1&];maxGiorgos Kalogeropoulos, Jan 11 2022 *)
Showing 1-2 of 2 results.