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

A125626 Numbers n whose reverse binary representation has the following property: let a 0 mean "halving" and a 1 mean "k -> 3k+1". The number describes an operation k -> f_n(k). If the equation f_n(k) = k has a positive solution, n is a term in the sequence.

Original entry on oeis.org

4, 8, 16, 32, 33, 34, 36, 40, 48, 64, 65, 66, 68, 72, 80, 96, 128, 129, 130, 131, 132, 133, 134, 136, 137, 138, 140, 144, 145, 146, 148, 152, 160, 161, 162, 164, 168, 176, 192, 193, 194, 196, 200, 208, 224, 256, 257, 258, 259, 260
Offset: 4

Views

Author

Nicholas Sanders (gummybean(AT)gmail.com), Jan 27 2007

Keywords

Comments

The terms in this sequence have the following characterization. Suppose the binary expansion of n contains i 1's and j 0's. Then it is easy to see that n is in the sequence if and only if 3^i < 2^j, or i/j < log 2 / log 3 = 0.630929753... - David Applegate and N. J. A. Sloane, Feb 01 2007
Note that f_n(x) is always a linear function of x.
The reverse binary expansions of the first few terms are:
001
0001
00001
000001
100001
010001
001001
000101
000011
0000001
1000001
0100001
0010001
0001001
0000101
0000011
00000001
10000001
01000001
11000001
00100001
...
Could be used in conjunction with the Collatz (or 3x+1) conjecture. If the positive solution k is an integer (most are not) then a cycle exists. If this cycle does not contain a 1 and the sequence of steps agrees with what Collatz's rule tells you to do when you start with k, then the Collatz conjecture would be false.

Examples

			Consider the term 200: its binary representation is 11001000. Reversing this gives 00010011. We solve (3*(3*(((3*(((k/2)/2)/2)+1)/2)/2)+1)+1) = k and find k = 40. Since k is positive, 200 is a member of the sequence.
		

Crossrefs

For the values of n for which the fixed point k is a positive (or any) integer, see A125754-A125757.

Programs

  • C
    #include  #include  #include  void multiply(float *coef, float *cons) { (*coef) *= 3; (*cons) = 3*(*cons)+1; } void divide(float *coef, float *cons) { (*coef) /= 2; (*cons) /= 2; } int main() { int a, b, c, n; float coef, cons, final; char data[30], sequence[30]; for (a = 1; a < 500; a++) { coef = 1; cons = 0; c = a; sequence[0] = ''; for (b = 1; b < 12; b++) //12 is arbitrary; it allows for "a" up to 2^12 { if (c != 0) { if (c % 2) { sprintf(sequence, "%s1", sequence); multiply(&coef, &cons); } else { sprintf(sequence, "%s0", sequence); divide(&coef, &cons); } c = trunc(c/2); } else break; } if (coef >= 1.0) { coef -= 1.0; cons *= -1.0; } else coef = 1.0-coef; final = cons/coef; if (final > 0) { sprintf(data, "%10.3f %s %d ", final, sequence, a); printf(data); } } return 0; }

A125710 In the "3x+1" problem, let 0 denote a halving step and 1 denote an x->3x+1 step. Then a(n) is obtained by writing the sequence of steps needed to reach 1 from 2n+1 and reading it as a decimal number.

Original entry on oeis.org

4, 80, 16, 43280, 305424, 10512, 272, 87056, 2320, 665872, 64, 21520, 4860176, 1676649379371438023024192690344976, 141584, 54056611079304389108412587463696, 38414608, 5136, 1091856, 11358841104
Offset: 0

Views

Author

N. J. A. Sloane, Feb 01 2007

Keywords

Examples

			7 -> 22 -> 11 -> 34 -> 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1, so a(3) is the
decimal equivalent of 1010100100010000, which is 43280.
		

Crossrefs

Programs

  • Mathematica
    f[x_] := If[EvenQ[x], x/2, 3x + 1];g[n_] := FromDigits[Mod[Most[NestWhileList[f, 2n + 1, # > 1 &, {2, 1}]], 2], 2];Table[g[n], {n, 0, 30}] (* Ray Chandler, Feb 02 2007 *)

Extensions

Extended by Ray Chandler, Feb 02 2007

A125754 Numbers n whose reverse binary representation has the following property: let a 0 mean "halving" and a 1 mean "k -> 3k+1". The number describes an operation k -> f_n(k). If the equation f_n(k) = k has an integer solution, n is a term in the sequence.

Original entry on oeis.org

2, 4, 10, 17, 18, 20, 24, 36, 42, 140, 145, 170, 200, 292, 561, 594, 660, 682, 792, 1059, 1136, 1553, 1800, 2340, 2730, 4150, 4274, 4297, 4308, 4389, 4433, 4490, 4634, 4696, 4705, 4741, 4804, 4876, 5133, 5164, 5218, 5254, 5400, 5409, 5668
Offset: 1

Views

Author

David Applegate, Feb 02 2007

Keywords

Comments

Suggested by A125626.
Note that f_n(x) is always a linear function of x.

Crossrefs

A125756 Numbers n whose reverse binary representation has the following property: let a 0 mean "halving" and a 1 mean "k -> 3k+1". The number describes an operation k -> f_n(k). If the equation f_n(k) = k has a positive integer solution, n is a term in the sequence.

Original entry on oeis.org

4, 36, 140, 145, 200, 292, 1059, 1136, 1553, 1800, 2340, 4150, 4274, 4297, 4308, 4389, 4433, 4490, 4634, 4696, 4705, 4741, 4804, 4876, 5133, 5164, 5218, 5254, 5400, 5409, 5668, 5712, 5761, 6244, 6290, 6312, 6448, 6466, 6662, 6800, 6976
Offset: 1

Views

Author

David Applegate, Feb 02 2007

Keywords

Comments

Suggested by A125626.
Note that f_n(x) is always a linear function of x.

Crossrefs

A125758 Numbers congruent to 4 or 7 (mod 9).

Original entry on oeis.org

4, 7, 13, 16, 22, 25, 31, 34, 40, 43, 49, 52, 58, 61, 67, 70, 76, 79, 85, 88, 94, 97, 103, 106, 112, 115, 121, 124, 130, 133, 139, 142, 148, 151, 157, 160, 166, 169, 175, 178, 184, 187, 193, 196, 202, 205, 211, 214, 220, 223, 229, 232, 238, 241, 247, 250, 256, 259, 265, 268
Offset: 1

Views

Author

N. J. A. Sloane and David Applegate, Feb 02 2007

Keywords

Comments

For a given integer m, write its binary representation in reverse order, as in A125626, A125754, etc.; let a 0 mean "halving" and a 1 mean "k -> 3k+1". Then m specifies an operation on real numbers given by k -> f_m(k). Suppose the equation f_m(k) = k has a positive integer solution for some m. Then we conjecture that the values of k are precisely the terms of this sequence.
25 is a term because we have 25 -> 76 -> 38 -> 19 -> 58 -> 29 -> 88 -> 44 -> 22 -> 11 -> 34 -> 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 25.
In other words, we conjecture that this sequence coincides with A125757 sorted and with duplicates removed.

Crossrefs

Programs

  • Mathematica
    Select[Range[300],MemberQ[{4,7},Mod[#,9]]&]  (* Harvey P. Dale, Mar 12 2011 *)

Formula

From R. J. Mathar, Apr 03 2009: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3) = a(n-2) + 9.
a(n) + a(n+1) = A017185(n).
G.f.: x*(4+3*x+2*x^2)/((1+x)*(x-1)^2). (End)
E.g.f.: 2 + ((9*x - 5/2)*exp(x) - (3/2)*exp(-x))/2. - David Lovler, Aug 21 2022

A348094 If the Collatz trajectory of n reaches 1, say after k steps, and there is an integer m > n such that T^i(m) and T^i(n) have the same parity for i = 0..k (where T^i denotes the i-th iterate of the Collatz map A006370), then a(n) is the least such m, otherwise a(n) is -1.

Original entry on oeis.org

2, 4, 35, 8, 21, 70, 2055, 16, 8201, 42, 1035, 140, 141, 4110, 4111, 32, 529, 16402, 16403, 84, 85, 2070, 2071, 280, 65561, 282, 1180591620717411303451, 8220, 8221, 8222, 147573952589676412959, 64, 262177, 1058, 1059, 32804, 32805, 32806, 8388647, 168
Offset: 1

Views

Author

Rémy Sigrist, Sep 29 2021

Keywords

Comments

When a(n) > 0, the binary expansion of A125711(n) is a prefix of that of A125711(a(n)).

Examples

			The first terms, alongside the binary representations of A125711(n) and of A125711(a(n)), are:
  n  a(n)  h(n)               h(a(n))
  -  ----  -----------------  --------------------------------------
  1     2                  1                                      11
  2     4                 11                                     111
  3    35           10101111                          10101111101111
  4     8                111                                    1111
  5    21             101111                                10111111
  6    70          110101111                         110101111101111
  7  2055  10101011011101111  10101011011101111110111010101111101111
  8    16               1111                                   11111
		

Crossrefs

Programs

  • Mathematica
    A348094[n_] := n+2^(Length[NestWhileList[If[OddQ[#], 3#+1, #]/2 &, n, #>1 &]]-1);
    Array[A348094, 50] (* Paolo Xausa, Apr 05 2024 *)
  • PARI
    a(n) = { my (h=0, r=n); while (r>1, if (r%2, r=3*r+1, r=r/2; h++)); n+2^h }

Formula

a(2^k) = 2^(k+1) for any k >= 0.
a(n) = n + 2^A006666(n) when A006666(n) >= 0.
Showing 1-6 of 6 results.