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.

A221470 Least m such that the Collatz (3x+1) iteration of m has exactly n increasing peak values.

Original entry on oeis.org

1, 5, 3, 7, 15, 287, 191, 127, 223, 159, 143, 95, 63, 47, 31, 27, 703, 6471, 6383, 4255, 6887, 4591, 50427, 47867, 31911, 77671, 161439, 113383, 239231, 159487, 1027431, 974079, 730559, 487039, 432923, 288615, 270271, 3041391, 9158655, 6416623, 16786431, 12589823
Offset: 0

Views

Author

T. D. Noe, Jan 17 2013

Keywords

Comments

Sequence A221469 lists the number of increasing peaks.

Examples

			The Collatz iteration starting at 7 is (7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1), which has 3 increasing peaks: 22, 34, and 52. No number smaller than 7 has 3 increasing peaks. Hence, a(3) = 7.
		

Crossrefs

Cf. A070165 (Collatz trajectory of n), A221469.

Programs

  • Haskell
    a221470 = (+ 1 ) . fromJust . (`elemIndex` (map a221469 [1..]))
    -- Reinhard Zumkeller, Jan 18 2013
  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; nn = 20; t = Table[0, {nn}]; found = 0; n = 0; While[found < nn, n++; c = Collatz[n]; cnt = 0; mx = n; Do[If[k > mx, cnt++; mx = k], {k, c}]; If[cnt > 0 && cnt <= nn && t[[cnt]] == 0, t[[cnt]] = n; found++]]; Join[{1}, t]

A346965 a(n) is the number of ascending subsequences in reducing n to 1 using the Collatz reduction, or -1 if n refutes the Collatz conjecture.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 3, 0, 4, 1, 3, 1, 2, 3, 2, 0, 3, 4, 4, 1, 1, 3, 2, 1, 5, 2, 17, 3, 4, 2, 16, 0, 6, 3, 2, 4, 4, 4, 6, 1, 17, 1, 6, 3, 4, 2, 16, 1, 5, 5, 5, 2, 2, 17, 17, 3, 7, 4, 6, 2, 3, 16, 15, 0, 6, 6, 5, 3, 3, 2, 16, 4, 18, 4, 2, 4, 5, 6, 6, 1, 4, 17, 17
Offset: 1

Views

Author

Douglas Boffey, Aug 09 2021

Keywords

Comments

In this sequence, a subsequence is considered ascending for as long as a (3*n + 1) / 2 step is required.

Examples

			a(9) = 4, viz.
  9->14;
  14->7->11->17->26;
  26->13->20;
  20->10->5->8.
		

Crossrefs

Programs

  • C
    /* A007814 */
    int num_clear_bits(unsigned n) {
      if (n == 0)
        return -1;
      return log2(n & -n);
    }
    int A346965(unsigned n) {
      int x;
      int result = 0;
      n >>= num_clear_bits(n);
      while (n > 1) {
        x = num_clear_bits(n + 1);
        n = ((n >> x) + 1) * pow(3, x) - 1;
        n >>= num_clear_bits(n);
        ++result;
      }
      return result;
    }

Formula

a(2^n) = 0.
a((2^n*(2*x+1)-1) * 2^y) = a(3^n*(2*x+1)-1) + 1, where x, y >= 0.
a(n) = a(A085062(n)) + (n mod 2) for n >= 2. - Alan Michael Gómez Calderón, Feb 09 2025
a(n) = A160541(A000265(n)). - Alan Michael Gómez Calderón, Mar 19 2025

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