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 31-40 of 121 results. Next

A225784 Denominators of the sum of the reciprocals of the Collatz (3x+1) sequence beginning at n.

Original entry on oeis.org

1, 2, 240, 4, 80, 80, 272272, 8, 350064, 80, 38896, 240, 208, 272272, 4095840, 16, 3536, 116688, 21431696, 80, 1344, 38896, 1365280, 80, 535792400, 208, 44841486948146266934850832405421294927083491752830032389039800908293040266400, 38896, 1127984, 1365280
Offset: 1

Views

Author

Nico Brown, May 15 2013

Keywords

Comments

If the sum of the reciprocals of a Collatz sequence is bounded, there are no Collatz cycles other than 4,2,1,4,2,1,...
a(n) = denominator of Sum_{k = 1..A006577(n)} 1/A070165(n,k). - Reinhard Zumkeller, May 16 2013

Examples

			For n=9 the Collatz sequence is {9, 28, 14, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 4, 2, 1}.  So the sum of the reciprocals is 1/9 + 1/28 + 1/14 + 1/7 + 1/22 + 1/11 + ... + 1/4 + 1/2 + 1/1 = 1061683/350064, whose denominator is 350064.
		

Crossrefs

Cf. A225761 (numerators), A087226.
Cf. A225843.

Programs

  • Haskell
    import Data.Ratio (denominator)
    a225784 = denominator . sum . map (recip . fromIntegral) . a070165_row
    -- Reinhard Zumkeller, May 16 2013
  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Table[Denominator[Total[1/Collatz[n]]], {n, 40}] (* T. D. Noe, May 15 2013 *)

Extensions

Extended by T. D. Noe, May 15 2013

A347409 Longest run of halving steps in the trajectory from n to 1 in the Collatz map (or 3x+1 problem), or -1 if no such trajectory exists.

Original entry on oeis.org

0, 1, 4, 2, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 5, 4, 4, 4, 4, 4, 6, 4, 5, 4, 4, 4, 5, 4, 4, 5, 5, 5, 4, 4, 5, 4, 4, 4, 4, 4, 5, 6, 4, 4, 4, 5, 5, 4, 4, 4, 4, 4, 5, 5, 5, 4, 4, 4, 4, 5, 5, 5, 5, 6, 4, 4, 4, 4, 4, 5, 5, 4, 5, 4, 8, 4, 4, 4, 4, 4, 5, 5, 5, 6, 8, 4, 4
Offset: 1

Views

Author

Paolo Xausa, Aug 30 2021

Keywords

Comments

If the longest run of halving steps occurs as the final part of the trajectory, a(n) = A135282(n), otherwise a(n) > A135282(n).
Every nonnegative integer appears in the sequence at least once, since for any k >= 0 a(2^k) = k.
Conjecture: every integer >= 4 appears in the sequence infinitely many times.

Examples

			a(15) = 5 because the Collatz trajectory starting at 15 contains, as the longest halving run, a 5-step subtrajectory (namely, 160 -> 80 -> 40 -> 20 -> 10 -> 5).
		

Crossrefs

Cf. A347668 (indices of records), A347669 (indices of first occurrences), A348007.

Programs

  • Mathematica
    nterms=100;Table[c=n;sm=0;While[c>1,If[OddQ[c],c=3c+1,If[(s=IntegerExponent[c,2])>sm,sm=s];c/=2^s]];sm,{n,nterms}]
  • PARI
    a(n)=my(nb=0); while (n != 1, if (n % 2, n=3*n+1, my(x = valuation(n, 2)); n /= 2^x; nb = max(nb, x));); nb; \\ Michel Marcus, Sep 03 2021
    
  • Python
    def A347409(n):
        m, r = n, 0
        while m > 1:
            if m % 2:
                m = 3*m + 1
            else:
                s = bin(m)[2:]
                c = len(s)-len(s.rstrip('0'))
                m //= 2**c
                r = max(r,c)
        return r # Chai Wah Wu, Sep 29 2021

A375266 Irregular triangle read by rows in which row n lists the iterates of the A375265 map from n to 1.

Original entry on oeis.org

1, 2, 1, 3, 1, 4, 2, 1, 5, 16, 8, 4, 2, 1, 6, 2, 1, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1, 8, 4, 2, 1, 9, 3, 1, 10, 5, 16, 8, 4, 2, 1, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1, 12, 4, 2, 1, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1
Offset: 1

Views

Author

Paolo Xausa, Aug 08 2024

Keywords

Comments

By definition the trajectory ends when 1 is reached, so row 1 does not contain the cycle 1 -> 4 -> 2 -> 1.
See A375265 for links.

Examples

			Triangle begins:
   1;
   2,  1;
   3,  1;
   4,  2,  1;
   5, 16,  8,  4,  2,  1;
   6,  2,  1;
   7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10,  5, 16,  8,  4,  2,  1;
   8,  4,  2,  1;
   9,  3,  1;
  10,  5, 16,  8,  4,  2,  1;
  ...
		

Crossrefs

Cf. A375265, A375267 (# of iterations), A375268 (row sums), A375280 (row maxs).

Programs

  • Mathematica
    A375265[n_] := Which[Divisible[n, 3], n/3, Divisible[n, 2], n/2, True, 3*n + 1];
    Array[NestWhileList[A375265, #, # > 1 &] &, 15]

A005184 Self-contained numbers: odd numbers k whose Collatz sequence contains a higher multiple of k.

Original entry on oeis.org

31, 83, 293, 347, 671, 19151, 2025797
Offset: 1

Views

Author

Keywords

Comments

The Collatz sequence of a number k is defined as a(1)=k, a(j+1) = a(j)/2 if a(j) is even, 3*a(j) + 1 if a(j) is odd.
No others less than 250000000. - Sam Handler (sam_5_5_5_0(AT)yahoo.com), Aug 07 2006
There are no more terms < 10^11. - Donovan Johnson, Nov 28 2013
There are no more terms < 10^15. - Alun Stokes, Mar 01 2021

Examples

			The Collatz sequence of 31 is 31, 94, 47, 142, 71, 214, 107, 322, 161, 484, 242, 121, 364, 182, 91, 274, 137, 412, 206, 103, 310 (see A008884) ... 310 is a multiple of 31, so the number 31 is "self-contained".
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, E16.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

The ratios "higher multiple of k" / k are given in A059198.

Programs

  • Maple
    T:= proc(n) option remember; `if`(n=1, 1,
          [n, T(`if`(n::even, n/2, 3*n+1))][])
        end:
    q:= n-> ormap(x-> x>n and irem(x, n)=0, [T(n)]):
    select(q, [2*i-1$i=1..10000])[];  # Alois P. Heinz, Aug 04 2025
  • Mathematica
    isSelfContained[n_] := Module[{d}, d = n; While[d != 1, If[EvenQ[d], d = d/2, d = 3 * d + 1]; If[IntegerQ[d/n], Return[True]]]; Return[False]]; For[n = 1, n <= 250000000, n += 2, If[isSelfContained[n], Print[n]]]; (* Sam Handler (sam_5_5_5_0(AT)yahoo.com), Aug 07 2006 *)
    scnQ[n_] := MemberQ[Divisible[#, n] & / @Rest[NestWhileList[If[EvenQ[#], #/2, 3# + 1] &, n, # > 1 &]], True]; Select[Range[1, 2100001, 2], scnQ] (* Harvey P. Dale, Oct 21 2011 *)
  • PARI
    m=5; d=2; while(1,n=(3*m+1)\2; until(n==1,n=if(n%2,3*n+1,n\2); if(n%m==0,print(m," ",n); break)); m+=d; d=6-d)

Extensions

More terms from Robert G. Wilson v
Better description from Jack Brennen, Feb 07 2003

A177000 The Collatz iteration of these primes produces only even numbers, primes and 1.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 29, 37, 53, 59, 67, 89, 101, 131, 149, 157, 179, 181, 197, 241, 269, 277, 349, 397, 739, 853, 1109, 1237, 1429, 1621, 1861, 1877, 2161, 2389, 2531, 2957, 3413, 3797, 4549, 5717, 7621, 10069, 13397, 17749, 20021, 31541, 40277
Offset: 1

Views

Author

T. D. Noe, Apr 30 2010

Keywords

Comments

The Collatz iteration of primes of the form (10*4^k-1)/3 produces only one additional prime: 5. The Collatz iteration of primes of the form (13*4^k-1)/3 produces only two additional primes: 5 and 13. This sequence is probably infinite.
In a sense, these are the simplest Collatz iterations starting with a prime number. Except for the increases (3x+1) when an odd prime occurs, the sequence produced by starting with a(n) is decreasing. All the primes that occur in such a Collatz iteration are in this sequence. - T. D. Noe, Oct 05 2011

Examples

			The Collatz iteration of 7 produces 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, and 1, which are either even, prime, or 1.
		

Crossrefs

Programs

A178168 Product of the numbers in the Collatz (3x+1) trajectory of n, including n.

Original entry on oeis.org

1, 2, 153600, 8, 5120, 921600, 704889816350720000, 64, 2486851272085340160000, 51200, 4577206599680000, 11059200, 532480000, 9868457428910080000, 114523513552896000000000, 1024, 12238520320000, 44763322897536122880000
Offset: 1

Views

Author

T. D. Noe, May 21 2010

Keywords

Comments

Row n of A070165 has the Collatz trajectory of n. It appears that all products are unique. This has been verified for all n < 10^6 and for the 12332052 values of n for which a(n) < 2^1081.

Examples

			The Collatz iteration starting with 3 is 3, 10, 5, 16, 8, 4, 2, 1. The product of these numbers is 153600.
		

Crossrefs

Cf. A087226 (LCM of the trajectory), A178169, A178170

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[ # ], #/2, 3#+1] &, n, #>1 &]; Table[Times@@Collatz[n], {n, 100}]

A207674 Numbers such that all divisors occur in their Collatz trajectories.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 16, 17, 19, 20, 22, 23, 24, 25, 26, 28, 29, 31, 32, 34, 37, 38, 40, 41, 43, 44, 46, 47, 48, 49, 50, 52, 53, 56, 58, 59, 61, 62, 64, 65, 67, 68, 71, 73, 74, 76, 79, 80, 82, 83, 86, 88, 89, 92, 94, 97, 98, 100, 101
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 20 2012

Keywords

Crossrefs

Cf. A027750, A070165, A006370, A207675 (complement), A000079 and A000040 are subsequences.

Programs

  • Haskell
    import Data.List (intersect)
    a207674 n = a207674_list !! (n-1)
    a207674_list = filter
       (\x -> a027750_row x `intersect` a070165_row x == a027750_row x) [1..]
  • Mathematica
    coll[n_]:=NestWhileList[If[EvenQ[#],#/2,3#+1]&,n,#>1&]; Select[Range[101],Complement[Divisors[#],coll[#]]=={}&] (* Jayanta Basu, May 27 2013 *)

A220145 The Collatz (3x+1) iteration mod 2 with bits combined.

Original entry on oeis.org

1, 10, 10000101, 100, 100001, 100001010, 10000100010010101, 1000, 10000100010010101001, 1000010, 100001000100101, 1000010100, 1000010001, 100001000100101010, 100001000001010101, 10000, 1000010001001, 100001000100101010010, 100001000100101000101, 10000100
Offset: 1

Views

Author

T. D. Noe, Jan 17 2013

Keywords

Comments

This is essentially sequence A070165 mod 2 with bits in the same iteration combined. Note that A176999 is similar, but with a different encoding.
It appears that all numbers are distinct. Sequence A005186 tells how many numbers produce bit strings of a given length. Sequence A221468 converts to decimal and A221467 sorts them.

Examples

			For n = 7, the Collatz iteration is 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1. Looking at these numbers in base 2 and reversing them, we obtain 10000100010010101.
		

Crossrefs

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Table[FromDigits[Mod[Reverse[Collatz[n]], 2]], {n, 30}]

A221213 Conjectured total number of times that k-n appears in the Collatz (3x+1) sequence of k for k = 1, 2, 3,....

Original entry on oeis.org

42, 42, 57, 52, 46, 53, 58, 57, 54, 49, 56, 59, 49, 62, 61, 59, 69, 59, 50, 54, 72, 64, 65, 55, 57, 54, 55, 66, 61, 60, 62, 61, 64, 73, 62, 59, 71, 63, 62, 58, 68, 72, 63, 59, 57, 65, 70, 59, 60, 59, 71, 55, 64, 54, 66, 75, 67, 62, 64, 64, 73, 68, 68, 67, 58, 61
Offset: 1

Views

Author

Jayanta Basu, Feb 21 2013

Keywords

Comments

Values are tested for natural numbers up to 1000000.

Examples

			a(1) = 42 = total number of k such that k-1 appears in the Collatz sequence of k, that is, the number of terms in A070991.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, E16.

Crossrefs

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; nn = 75; t = Table[0, {nn}]; lastChange = 10; k = 0; While[k < 2*lastChange, k++; c = Collatz[k]; d = Intersection[Range[nn], k - c]; If[Length[d] > 0, lastChange = k; t[[d]]++]]; t (* T. D. Noe, Feb 21 2013 *)

A221469 Number of increasing peak values in the Collatz (3x+1) iteration of n.

Original entry on oeis.org

0, 0, 2, 0, 1, 2, 3, 0, 3, 1, 2, 1, 1, 3, 4, 0, 1, 3, 2, 0, 1, 2, 3, 0, 2, 1, 15, 2, 1, 4, 14, 0, 1, 1, 2, 1, 1, 2, 4, 0, 14, 1, 2, 1, 1, 3, 13, 0, 1, 2, 2, 0, 1, 15, 13, 0, 2, 1, 3, 3, 1, 14, 12, 0, 1, 1, 2, 0, 1, 2, 12, 0, 13, 1, 2, 1, 1, 4, 4, 0, 1, 14, 12
Offset: 1

Views

Author

T. D. Noe, Jan 17 2013

Keywords

Comments

That is, the number of times that the Collatz iteration of n reaches a new maximum. See A221470 for the first occurrence of each peak count.

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.
		

Crossrefs

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

Programs

  • Haskell
    a221469 n = sum $ map fromEnum $ zipWith (>) (tail ts) ts where
       ts = scanl1 max $ a070165_row n
    -- Reinhard Zumkeller, Jan 18 2013
  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Table[c = Collatz[n]; cnt = 0; mx = n; Do[If[k > mx, cnt++; mx = k], {k, c}]; cnt, {n, 100}]
Previous Showing 31-40 of 121 results. Next