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.

Previous Showing 51-53 of 53 results.

A277365 a(n) is the smallest number k such that f(k) = f(n) + f(n+1) and g(k) = g(n) + g(n+1), where f(n) (resp. g(n)) is the number of halving (resp. tripling) steps to reach 1 in the Collatz ('3x+1') problem.

Original entry on oeis.org

2, 6, 12, 20, 34, 49, 56, 72, 98, 112, 144, 176, 196, 228, 224, 272, 344, 406, 392, 384, 448, 520, 576, 688, 688, 772, 913, 912, 912, 1028, 992, 1040, 1220, 1152, 1376, 1624, 1624, 1708, 1624, 1728, 1728, 1824, 2160, 2080, 2080, 2215, 2559, 2752, 2884, 2884, 2752
Offset: 1

Views

Author

Michel Lagneau, Oct 11 2016

Keywords

Comments

A006666: Number of halving steps to reach 1 in '3x+1' problem.
A006667: Number of tripling steps to reach 1 in '3x+1' problem.
We observe an interesting property: the subsequence {b(i)} of perfect squares is {49, 144, 196, 576, 3844, 12544, 15376, 51529, 61504, 246016, ...} with the property that b(3) = 4*b(1), b(4) = 4*b(2), b(7) = 4*b(5), b(9) = 4*b(7), b(10) = 4*b(9), ...
The primes of the sequence are 2, 2953, 3739, 9931, 38303, 44641, ...

Examples

			a(3) = 12 because (A006666(3), A006667(3)) = (f(3), g(3)) = (5, 2) => f(12) = f(3) + f(4) = 5 + 2 = 7 and g(12) = g(3) + g(4) = 2 + 0 = 2.
		

Crossrefs

Programs

  • Maple
    nn:=10^6:U:=array(1..nn):V:=array(1..nn):
    for i from 1 to nn do:
    m:=i:it0:=0:it1:=0:
       for j from 1 to nn while(m<>1) do:
        if irem(m,2)=0
         then
         m:=m/2:it0:=it0+1:
         else
         m:=3*m+1:it1:=it1+1:
        fi:
       od:
       U[i]:=it0:V[i]:=it1:
      od:
       for n from 1 to 100 do:
       ii:=0:
        for k from 1 to nn while(ii=0) do:
         if U[k]=U[n]+U[n+1] and V[k]=V[n]+V[n+1]
          then
          ii:=1:printf(`%d, `,k):
          else
         fi:
        od:
    od:

Extensions

Name edited by Michel Marcus, Sep 13 2017

A291352 Numerators of the Collatz parity generator fractions.

Original entry on oeis.org

1, 3, 7, 191, 25983, 2663063519, 7160414743310596607, 208229791652776621349215306687873023871, 45218742589363955614633859184750699518167124046103786511727246869388335095775
Offset: 1

Views

Author

John Laky, Aug 22 2017

Keywords

Comments

a(n) is a numerator of a fraction of the form a(n)/(2^2^n + 1) whose expansion into a repeating binary string models the n-th parity in the Collatz orbit of an integer.

Examples

			a(1)=1 => f(1) = 1/3 => b(1) = 101010...
a(2)=3 => f(2) = 3/5 => b(2) = 10011001...
elements in b(2) determine the parity of elements at index 2 in the Collatz parity sequence of an integer.
		

Crossrefs

Cf. A006666.

A329535 Numbers with twice as many halving steps before reaching 1 in the 3x + 1 problem as tripling steps.

Original entry on oeis.org

1, 159, 283, 377, 502, 503, 603, 615, 668, 669, 670, 799, 807, 888, 890, 892, 893, 1063, 1065, 1095, 1186, 1187, 1188, 1189, 1190, 1417, 1435, 1580, 1581, 1582, 1585, 1586, 1587, 1889, 1913, 1947, 1959, 1963, 2104, 2106, 2108, 2109, 2113, 2114, 2115, 2119, 2518
Offset: 1

Views

Author

Michel Lagneau, Nov 16 2019

Keywords

Comments

Essentially the same as A281665. - R. J. Mathar, Feb 07 2020
Numbers m such that A006666(m) = 2 * A006667(m).
Steps after reaching 1 the first time are ignored. For example, for 5, 16, 8, 4, 2, 1, 4, 2, 1, ..., only 8, 4, 2, 1 are counted for halving steps, the subsequent 4, 2, 1 subcycles are ignored.

Examples

			159 is in the sequence because its trajectory, 159, 478, 239, 718, ..., has 36 halving steps and 18 tripling steps.
160 is not in the sequence because its trajectory, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1, has nine even terms but only two odd terms.
		

Crossrefs

Programs

  • Mathematica
    collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; nn = 50; t = {}; n = 0; While[Length[t] < nn, n++; c = collatz[n]; ev = Length[Select[c, EvenQ]]; od = Length[c] - ev - 1; If[ev == 2 * od, AppendTo[t, n]]]; t
  • Scala
    def halfTripleCompare(n: Int): Int = {
      var curr = n
      var htc = 0
      while (curr > 1) {
        curr = (curr % 2) match {
          case 0 => htc = htc + 1
            curr / 2
          case 1 => htc = htc - 2
            3 * curr + 1
        }
      }
      htc
    }
    (1 to 1000).filter(halfTripleCompare() == 0) // _Alonso del Arte, Nov 18 2019
Previous Showing 51-53 of 53 results.