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.

A213678 Number of terms k such that difference between halving and tripling steps in Collatz (3x+1) trajectory of k is n.

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 8, 14, 20, 29, 40, 59, 87, 130, 196, 294, 439, 658, 985, 1459, 2203, 3328, 5001, 7482, 11205, 16805, 25220, 37850, 56713, 85108, 127728, 191635
Offset: 0

Views

Author

Jayanta Basu, Mar 04 2013

Keywords

Examples

			a(5) = 5 since there are only five numbers 12, 13, 20, 21, 32 such that difference between number of halving and tripling steps is 5.
		

Crossrefs

Cf. A220071, A222599 (lists of numbers).

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; nn = 15; t = Table[0, {nn}]; Do[c = Collatz[n]; e = Select[c, EvenQ]; diff = 2*Length[e] - Length[c]; If[diff < nn - 1, t[[diff + 2]]++], {n, 2^(nn - 1)}]; t (* T. D. Noe, Mar 04 2013 *)

Extensions

Corrected and extended by T. D. Noe, Mar 06 2013

A304715 For any n > 0, if A006666(n) >= 0, then a(n) = Sum_{i = 0..A006666(n)-1} 2^i * [T^i(n) == 0 (mod 2)] (where [] is an Iverson bracket and T^i denotes the i-th iterate of the Collatz function A014682); otherwise a(n) = -1.

Original entry on oeis.org

0, 1, 28, 3, 14, 57, 1896, 7, 7586, 29, 948, 115, 118, 3793, 3824, 15, 474, 15173, 15180, 59, 62, 1897, 1912, 231, 60722, 237, 1102691417057682138372, 7587, 7590, 7649, 137836427132210267296, 31, 242890, 949, 956, 30347, 30350, 30361, 7772616, 119
Offset: 1

Views

Author

Rémy Sigrist, May 17 2018

Keywords

Comments

In other words, when a(n) >= 0, the binary representation of a(n) encodes the tripling and halvings steps of the Collatz compressed trajectory of n up to the first occurrence of the number 1 (where zeros and ones respectively denote tripling and halving steps).

Examples

			The first terms, alongside the binary representation of a(n) and the Collatz compressed trajectory of a(n) up to the first 1 in reverse order, are:
  n    a(n)       bin(a(n))  rev(traj(n))
  --   ----       ---------  ------------
   1      0               0  (1)
   2      1               1  (1, 2)
   3     28           11100  (1, 2, 4, 8, 5, 3)
   4      3              11  (1, 2, 4)
   5     14            1110  (1, 2, 4, 8, 5)
   6     57          111001  (1, 2, 4, 8, 5, 3, 6)
   7   1896     11101101000  (1, 2, 4, 8, 5, 10, 20, 13, 26, 17, 11, 7)
   8      7             111  (1, 2, 4, 8)
   9   7586   1110110100010  (1, 2, 4, 8, 5, 10, 20, 13, 26, 17, 11, 7, 14, 9)
  10     29           11101  (1, 2, 4, 8, 5, 10)
  11    948      1110110100  (1, 2, 4, 8, 5, 10, 20, 13, 26, 17, 11)
  12    115         1110011  (1, 2, 4, 8, 5, 3, 6, 12)
  13    118         1110110  (1, 2, 4, 8, 5, 10, 20, 13)
  14   3793    111011010001  (1, 2, 4, 8, 5, 10, 20, 13, 26, 17, 11, 7, 14)
  15   3824    111011110000  (1, 2, 4, 8, 5, 10, 20, 40, 80, 53, 35, 23, 15)
  16     15            1111  (1, 2, 4, 8, 16)
  17    474       111011010  (1, 2, 4, 8, 5, 10, 20, 13, 26, 17)
  18  15173  11101101000101  (1, 2, 4, 8, 5, 10, 20, 13, 26, 17, 11, 7, 14, 9, 18)
		

Crossrefs

Programs

  • PARI
    a(n) = my (v=0); for (k=0, oo, if (n==1, return (v), n%2, n = (3*n+1)/2, n = n/2; v += 2^k))

Formula

a(2^k) = 2^k - 1 for any k >= 0.
a(2*n) = 2*a(n) + 1.
A029837(a(n)+1) = A006666(n).
A000120(a(n)) = A220071(n).
a(A248573(n)) < a(A248573(n+1)) for any n >= 0. - Rémy Sigrist, Nov 09 2018
Showing 1-2 of 2 results.