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

A222598 Least number k having Collatz (3x+1) sequence with exactly n pairs of odd and even numbers in a row.

Original entry on oeis.org

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

Views

Author

T. D. Noe, Mar 02 2013

Keywords

Comments

This sequence is very similar to A213215. It is somewhat surprising that many of these numbers are of the form 2^k - 1. Note that this is true for n = 2, 3, 4, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 31, 32, and 33; not true for n = 1, 5, 6, 11, 13, 17, 19, 23, and 29.

Examples

			The Collatz sequence of 15 is 15, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1. It begins with 4 pairs of odd/even numbers.
		

Crossrefs

Cf. A213215.

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; countOnes[t_] := Module[{mx = 0, cnt = 0, i = 0}, While[i < Length[t], i++; If[t[[i]] == 1, cnt++; i++, If[cnt > mx, mx = cnt]; cnt = 0]]; mx]; nn = 15; t = Table[0, {nn}]; t[[1]] = 1; n = 1; While[Min[t] == 0, n = n + 2; c = countOnes[Mod[Collatz[n], 2]]; If[c <= nn && t[[c]] == 0, t[[c]] = n]]; t

Extensions

a(24)-a(33) from Donovan Johnson, Mar 03 2013

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

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