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 21-26 of 26 results.

A087228 a(n) is the smallest number k such that the LCM of the terms of the Collatz trajectory of k has n distinct prime factors.

Original entry on oeis.org

2, 5, 3, 17, 11, 7, 9, 33, 67, 57, 59, 39, 105, 185, 191, 123, 225, 219, 239, 159, 319, 283, 251, 167, 335, 111, 297, 175, 233, 155, 103, 91, 107, 71, 31, 41, 27, 193, 129, 231, 171, 463, 327, 411, 859, 731, 487, 649, 639, 1153, 1563, 1607, 1071, 1215, 1307, 871, 1161
Offset: 1

Views

Author

Labos Elemer, Aug 28 2003

Keywords

Examples

			a(10)=57 because 57 is the smallest number such that the LCM of the terms in its Collatz trajectory has 10 different prime factors: A082226(57) = 864203580240 = 2^4*3*5*7*11*13*17*19*37*43.
		

Crossrefs

Programs

  • Mathematica
    c[x_] := (1-Mod[x, 2])*(x/2)+Mod[x, 2]*(3*x+1)c[1]=1; fpl[x_] := Delete[FixedPointList[c, x], -1] ef[x_] := Length[FactorInteger[Apply[LCM, fpl[x]]]] t=Table[0, {256}]; Do[s=ef[n]; If[s<257&&t[[s]]==0, t[[s]]=n], {n, 1, 1000}]; t

Formula

a(n) = Min{k; A087227(k)=n}, where A087227(k) = A001221(A087226(k)); A087226(k) = lcm(terms in Collatz trajectory of k).

Extensions

Edited by Jon E. Schoenfield, Jul 09 2018

A282408 Numbers k for which the number of odd members and the number of even members in the Collatz (3x+1) trajectory are both a perfect square.

Original entry on oeis.org

1, 2, 16, 17, 322, 323, 512, 1595, 1598, 1599, 1609, 1614, 1615, 1627, 1641, 1643, 1657, 1663, 1776, 1780, 1781, 1784, 1786, 2176, 2208, 2216, 2218, 2240, 2256, 2260, 2261, 2274, 2275, 2400, 2408, 2410, 2416, 2417, 2420, 2421, 3844, 3845, 3846, 3848, 3850, 3852
Offset: 1

Views

Author

Michel Lagneau, Feb 14 2017

Keywords

Comments

Or numbers m such that A078719(m) and A006666(m) are both a perfect square.
For k < 5*10^6, the fourteen distinct pairs of squares in the order of appearance are: (1, 0), (1, 1), (1, 4), (4, 9), (36, 64), (1, 9), (25, 49), (4, 16), (16, 36), (9, 25), (1, 16), (81, 144), (4, 25) and (64, 121).
The numbers 2^(m^2) = A002416(m) are in the sequence, and the corresponding pairs of squares are (1, m^2).
Number of terms <= 10^h: 2, 4, 7, 202, 203, 474, 20888, etc. Robert G. Wilson v, Feb 14 2017

Examples

			17 is in the sequence because the Collatz trajectory is 17 -> 52 -> 26 -> 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 => the number of odd members is 4 = 2^2 and number of even members is 9 = 3^2.
		

Crossrefs

Programs

  • Maple
    nn:=10^6:
    for n from 1 to 10000 do:
      m:=n:i1:=1:i2:=0:
       for i from 1 to nn while(m<>1) do:
        if irem(m,2)=0
         then
         m:=m/2:i2:=i2+1:
         else
         m:=3*m+1:i1:=i1+1:
        fi:
       od:
        if sqrt(i1)=floor(sqrt(i1)) and sqrt(i2)=floor(sqrt(i2))
         then
         printf(`%d, `,n):
         else
        fi:
    od:
  • Mathematica
    fQ[n_] := Block[{m = n, e = 0, o = 1}, While[m > 1, If[OddQ@ m, m = 3 m + 1; o++, m /= 2; e++]]; IntegerQ@ Sqrt@ e && IntegerQ@ Sqrt@ o]; Select[ Range@ 3855, fQ] (* Robert G. Wilson v, Feb 14 2017 *)
    memsqQ[n_]:=Module[{col=NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#!=1&]}, AllTrue[ {Sqrt[ Count[ col, ?(EvenQ[#]&)]],Sqrt[Count[col,?(OddQ[ #]&)]]},IntegerQ]]; Select[Range[4000],memsqQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Sep 04 2018 *)

A282409 Numbers n for which the number of odd members and the number of even members in the Collatz (3x+1) trajectory are both prime.

Original entry on oeis.org

3, 9, 10, 12, 13, 22, 23, 40, 42, 73, 88, 90, 92, 93, 114, 115, 118, 119, 144, 148, 149, 152, 154, 162, 163, 164, 165, 166, 192, 208, 212, 213, 226, 227, 251, 295, 318, 319, 350, 351, 576, 592, 596, 597, 608, 616, 618, 625, 640, 642, 643, 648, 650, 652, 653
Offset: 1

Views

Author

Michel Lagneau, Feb 14 2017

Keywords

Comments

Or numbers m such that A078719(m) and A006666(m) are both prime.
The distinct pairs of primes in the order of appearance are: (3, 5), (7, 13), (2, 5), (3, 7), (5, 11), (2, 7), (43, 73), (5, 13), (11, 23), (7, 17), (41, 71), (3, 11), (23, 43), (19, 37),...

Examples

			13 is in the sequence because its Collatz trajectory is 13 -> 40 -> 20 -> 10 -> 5 -> 16 -> 8 -> 4 -> 2 -> 1 which contains 3 odd members and 7 even members.
		

Crossrefs

Programs

  • Maple
    nn:=10^6:
    for n from 1 to 500 do:
      m:=n:i1:=1:i2:=0:
       for i from 1 to nn while(m<>1) do:
        if irem(m,2)=0
         then
         m:=m/2:i2:=i2+1:
         else
         m:=3*m+1:i1:=i1+1:
        fi:
       od:
         if isprime(i1) and isprime(i2)
         then
         printf(`%d, `,n):
         else
        fi:od:
  • PARI
    is(n)=my(e,o=1); while(n>1, n=if(n%2, o++; 3*n+1, e++; n/2)); isprime(e) && isprime(o) \\ Charles R Greathouse IV, Feb 14 2017
    
  • Python
    from sympy import isprime
    def a(n):
        l=[n]
        while True:
            if n%2==0: n//=2
            else: n = 3*n + 1
            l.append(n)
            if n<2: break
        o=list(filter(lambda i: i%2==1, l))
        e=list(filter(lambda i: i%2==0, l))
        return [o, e]
    print([n for n in range(2, 1001) if isprime(len(a(n)[0])) and isprime(len(a(n)[1]))]) # Indranil Ghosh, Apr 14 2017

A316783 Seed values of hailstone sequences for which, by the time they first reach 1, the ratio of odd terms to even terms is exactly 1/2. (The seed value itself is included in the ratio calculation.)

Original entry on oeis.org

4, 5, 6, 11, 14, 15, 18, 19, 25, 33, 43, 57, 59, 78, 79, 105, 135, 139, 185, 187, 191, 246, 247, 249, 254, 255, 329, 338, 339, 359, 427, 438, 439, 443, 450, 451, 478, 479, 569, 585, 590, 591, 601, 636, 637, 638, 758, 759, 767, 779, 786, 787, 801, 849, 850, 851
Offset: 1

Views

Author

Matt Enlow, Jul 13 2018

Keywords

Comments

1/2 is the most common odd/even ratio for these sequences. For seed values from 2 to 2^17, it is the odd/even ratio for 4454 of those sequences. The next most common ratio is 5/11, with 1834 sequences. (This is all empirical observation, using Mathematica.)

Examples

			The hailstone sequence starting with 11 (and ending at 1) is 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1. Five of those terms are odd, and the other ten are even, giving an odd/even ratio of 1/2. Therefore 11 is a term in this sequence.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=1, [1, 0],
          `if`(n::odd, [1, 0]+b(3*n+1), [0, 1]+b(n/2)))
        end:
    a:= proc(n) option remember; local k; for k from a(n-1)
          +1 while (l-> 2*l[1]<>l[2])(b(k)) do od; k
        end: a(0):=0:
    seq(a(n), n=1..100);  # Alois P. Heinz, Aug 02 2018
  • Mathematica
    collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1]&, n, # != 1 &];
    A316783 = Select[Range[2, 1000], With[{c = Mod[collatz[#], 2]}, 2 Total[c] == Total[1 - c]] &]
  • PARI
    is(n) = my(x=n, even=0, odd=0); while(1, if(x%2==0, x=x/2; even++, x=3*x+1; odd++); if(x==1, odd++; break)); odd/even==1/2 \\ Felix Fröhlich, Jul 13 2018

Formula

{ k : A006666(k)/A078719(k) = 2 }. - Alois P. Heinz, Aug 02 2018

A330732 a(n) is the smallest number whose odd hailstone sequence has length n (including 1 and itself) and is in descending order.

Original entry on oeis.org

1, 5, 13, 17, 45, 241, 321, 1713, 9137, 24365, 36033, 173261, 231681, 630033, 1642769, 4380717, 11715629, 31241677, 41655569, 111081517, 148108689, 789913009, 1053217345, 1404289793, 3744772781, 9986060749, 13314747665, 35505993773, 94682650061, 128599099649
Offset: 1

Views

Author

Xiangyu Chen, Dec 28 2019

Keywords

Comments

The hailstone (Collatz) sequence of a number is defined by repeated operations of f(x), where f(x)=x/2 if x is even, and f(x)=3x+1 if x is odd. The odd numbers of a number's hailstone sequence are also called its odd hailstone sequence.
The odd hailstone sequence of 45 [45, 17, 13, 5, 1] contains the first five terms of this sequence.
Note that a(n+1) isn't necessarily greater than a(n).

Examples

			Consider a(8): [1713, 1285, 241, 181, 17, 13, 5, 1]; the odd hailstone sequence of 1713 is descending and has length 8. 1713 is the lowest such number.
		

Crossrefs

Programs

  • Mathematica
    With[{s = Array[If[AllTrue[Differences@ #, # < 0 &], Length@ #, 0] &@ Select[NestWhileList[If[EvenQ@ #, #/2, 3 # + 1] &, #, # > 1 &], OddQ] &, 10^5]}, Array[FirstPosition[s, #][[1]] &, Max@ s]] (* Michael De Vlieger, Jan 01 2020 *)
  • PARI
    is(k, n) = {my(x=k, v=List([])); while(x>1, if(x%2==0, x=x/2, listput(v, x); x=3*x+1)); 1+#v==n&&v==vecsort(v, , 4); }
    a(n) = {k=1; while(is(k, n)==0, k+=2); k; } \\ Jinyuan Wang, Dec 31 2019

Extensions

a(23)-a(30) from Kevin P. Thompson, Jul 23 2022

A375888 Rectangular array: row n shows all k such that n is the number of rises in the trajectory of k in the Collatz problem.

Original entry on oeis.org

1, 2, 5, 4, 10, 3, 8, 20, 6, 17, 16, 21, 12, 34, 11, 32, 40, 13, 35, 22, 7, 64, 42, 24, 68, 23, 14, 9, 128, 80, 26, 69, 44, 15, 18, 25, 256, 84, 48, 70, 45, 28, 19, 49, 33, 512, 85, 52, 75, 46, 29, 36, 50, 65, 43, 1024, 160, 53, 136, 88, 30, 37, 51, 66, 86, 57
Offset: 0

Views

Author

Clark Kimberling, Sep 11 2024

Keywords

Comments

Assuming that the Collatz conjecture (also known as the 3x+1 conjecture) is true, this is a permutation of the positive integers; viz., every positive integer occurs exactly once. Conjecture: every row contains a pair of consecutive integers.

Examples

			Corner:
   1     2     4     8    16    32    64   128   256   512  1024
   5    10    20    21    40    42    80    84    85   160   168
   3     6    12    13    24    26    48    52    53    96   104
  17    34    35    68    69    70    75   136   138   140   141
  11    22    23    44    45    46    88    90    92    93   176
   7    14    15    28    29    30    56    58    60    61   112
   9    18    19    36    37    38    72    74    76    77    81
6 is in row 2 because the trajectory, (6, 3, 10, 5, 16, 4, 2, 1), has exactly 2 rises: 3 to 10, and 5 to 16.
		

Crossrefs

Cf. A000027, A000079 (row 1), A092893 (column 1), A006667, A070265, A078719.
Cf. A354236.

Programs

  • Mathematica
    t = Table[Count[Differences[NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]], ? Positive], {n, 2048}]; (* after _Harvey P. Dale, A006667 *)
    r[n_] := Flatten[Position[t, n - 1]];
    Column[Table[r[n], {n, 1, 21}]] (* array *)
    u = Table[r[k][[n + 1 - k]], {n, 1, 12}, {k, 1, n}]
    Flatten[u] (* sequence *)

Formula

Transpose of the array in A354236.
Previous Showing 21-26 of 26 results.