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.

A198584 Odd numbers producing exactly 3 odd numbers in the Collatz (3x+1) iteration.

Original entry on oeis.org

3, 13, 53, 113, 213, 227, 453, 853, 909, 1813, 3413, 3637, 7253, 7281, 13653, 14549, 14563, 29013, 29125, 54613, 58197, 58253, 116053, 116501, 218453, 232789, 233013, 464213, 466005, 466033, 873813, 931157, 932053, 932067, 1856853, 1864021, 1864133
Offset: 1

Views

Author

T. D. Noe, Oct 28 2011

Keywords

Comments

One of the odd numbers is always 1. So besides a(n), there is exactly one other odd number, A198585(n), which is a term in A002450.
Sequences A228871 and A228872 show that there are two sequences here: the odd numbers in order and out of order. - T. D. Noe, Sep 12 2013
Start with the numbers in A350053. If k is in sequence then so is 4*k+1. - Ralf Stephan, Jun 18 2025

Examples

			The Collatz iteration of 113 is 113, 340, 170, 85, 256, 128, 64, 32, 16, 8, 4, 2, 1, which shows that 113, 85, and 1 are the three odd terms.
		

Crossrefs

Cf. A062053 (numbers producing 3 odds in their Collatz iteration).
Cf. A092893 (least number producing n odd numbers).
Cf. A198586-A198593 (odd numbers producing 2-10 odd numbers).

Programs

  • Mathematica
    Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; t = {}; Do[If[Length[Select[Collatz[n], OddQ]] == 3, AppendTo[t, n]], {n, 1, 10000, 2}]; t
  • Python
    # get n-th term in sequence
    def isqrt(n):
      i=0
      while(i*i<=n):
        i+=1
      return i-1
    for n in range (200):
      s = isqrt(3*n)//3
      a = s*3
      b = (a*a)//3
      c = n-b
      d = 4*(n*3+a+(c4*s+1)+(c>5*s+1))+5
      e = isqrt(d)
      f = e-1-( (d-e*e) >> 1 )
      r = ((((8<André Hallqvist, Jul 25 2019
    
  • Python
    # just prints the sequence
    for a in range (5,100,1):
      for b in range(a-8+4*(a&1),0,-6):
        print(( ((1<André Hallqvist, Aug 14 2019

Formula

Numbers of the form (2^m*(2^n-1)/3-1)/3 where n == 2 (mod 6) if m is even and n == 4 (mod 5) if m is odd. - Charles R Greathouse IV, Sep 09 2022
a(n) = (16*2^floor(b(n)) - 2^(2*floor((b(n) - 1)/2) + 3*floor(b(n)) - 6*(floor(b(n)/2) - floor((floor(b(n))^2 + 20)/12) + n) - 2))/9 - 1/3 where b(n) = sqrt(3)*sqrt(4*n - 3). - Alan Michael Gómez Calderón, Feb 02 2025

A198586 a(n) = (4^A001651(n+1) - 1)/3: numbers (4^k-1)/3 for k > 1, not multiples of 3.

Original entry on oeis.org

5, 85, 341, 5461, 21845, 349525, 1398101, 22369621, 89478485, 1431655765, 5726623061, 91625968981, 366503875925, 5864062014805, 23456248059221, 375299968947541, 1501199875790165, 24019198012642645, 96076792050570581, 1537228672809129301
Offset: 1

Views

Author

T. D. Noe, Oct 30 2011

Keywords

Comments

Numbers coprime to 6 producing 2 odd numbers in the Collatz iteration.
Numbers appearing in A198585 (sorted and duplicates removed). These numbers occur in A002450, numbers of the form (4^k-1)/3, for k = 2, 4, 5, 7, 8, 10, ... (note that k a multiple of 3 does not appear).
A124477 \ {0,1} is a subset: for these n, 3n+1 = 2^(p-3) with p > 3 prime, whence also n !== 0 (mod 3). - M. F. Hasler, Oct 16 2018
These are exactly the odd non-multiples of 3 such 3n+1 = 2^m for some m, i.e., n = (2^m-1)/3. This is possible iff m = 2k, so we get n = (4^k-1)/3. Then n == 0 (mod 3) <=> 4^k == 1 (mod 9) <=> k == 0 (mod 3) <=> k not in A001651. This yields the FORMULA. (Multiples of 3 are excluded because the original definition implied that the terms are in the Collatz-orbit of another odd number, i.e., of the form n = (3x+1)/2^r, which is impossible for x a multiple of 3.) - M. F. Hasler, Oct 16 2018
From Wolfdieter Lang, Jan 14 2022: (Start)
a(n) mod 8 = 5. As subsequence of A002450 for n >= 1.
{a(n) mod 6} == repeat{5, 1}. See the first comment, and the periodicity modulo 6 of A002450 for n >= 1.
{a(n) mod 72} == repeat{5, 13, 53, 61, 29, 37}. Proof by induction: First with the bisection formulas, a(1+2*k) = (4^(2+3*k) - 1)/3 and a(2+2*k) = (4^(3*k+4) - 1)/3, for k >= 0, then trisection, using (4^9 - 1)/3 = 873819 = 9*9709. (End)

Crossrefs

Programs

  • Magma
    [4^(3*n  div 2 + 1) div 3: n in [1..25]]; // Vincenzo Librandi, Oct 20 2018
  • Mathematica
    e = 19; ex = Complement[Range[2,3*e], 3*Range[e]]; (4^ex - 1)/3
    (* Second program: *)
    Rest@ Map[(4^# - 1)/3 &, LinearRecurrence[{1, 1, -1}, {1, 2, 4}, 21]] (* Michael De Vlieger, Oct 17 2018 *)
  • PARI
    is(n)=gcd(n,6)==1&&(n=3*n+1)>>valuation(n,2)==1 \\ M. F. Hasler, Oct 16 2018
    
  • PARI
    A198586(n)=4^(3*n\2+1)\3 \\ M. F. Hasler, Oct 16 2018
    
  • PARI
    Vec(x*(5 + 80*x - 64*x^2) / ((1 - x)*(1 - 8*x)*(1 + 8*x)) + O(x^20)) \\ Colin Barker, Jan 17 2020
    

Formula

a(n) = (4^A001651(n+1) - 1)/3. - M. F. Hasler, Oct 16 2018
From Colin Barker, Jan 17 2020: (Start)
G.f.: x*(5 + 80*x - 64*x^2) / ((1 - x)*(1 - 8*x)*(1 + 8*x)).
a(n) = a(n-1) + 64*a(n-2) - 64*a(n-3) for n>3.
a(n) = (-1 + (-8)^n + 3*8^n) / 3.
(End)

Extensions

Definition corrected by M. F. Hasler, Oct 16 2018
Showing 1-2 of 2 results.