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.

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

This page as a plain text file.
%I A198584 #53 Jun 18 2025 14:00:25
%S A198584 3,13,53,113,213,227,453,853,909,1813,3413,3637,7253,7281,13653,14549,
%T A198584 14563,29013,29125,54613,58197,58253,116053,116501,218453,232789,
%U A198584 233013,464213,466005,466033,873813,931157,932053,932067,1856853,1864021,1864133
%N A198584 Odd numbers producing exactly 3 odd numbers in the Collatz (3x+1) iteration.
%C A198584 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.
%C A198584 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
%C A198584 Start with the numbers in A350053. If k is in sequence then so is 4*k+1. - _Ralf Stephan_, Jun 18 2025
%H A198584 T. D. Noe, <a href="/A198584/b198584.txt">Table of n, a(n) for n = 1..1009</a>
%F A198584 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
%F A198584 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
%e A198584 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.
%t A198584 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
%o A198584 (Python)
%o A198584 # get n-th term in sequence
%o A198584 def isqrt(n):
%o A198584   i=0
%o A198584   while(i*i<=n):
%o A198584     i+=1
%o A198584   return i-1
%o A198584 for n in range (200):
%o A198584   s = isqrt(3*n)//3
%o A198584   a = s*3
%o A198584   b = (a*a)//3
%o A198584   c = n-b
%o A198584   d = 4*(n*3+a+(c<s)+(c>4*s+1)+(c>5*s+1))+5
%o A198584   e = isqrt(d)
%o A198584   f = e-1-( (d-e*e) >> 1 )
%o A198584   r = ((((8<<e)-(1<<f))//3)-1)//3
%o A198584   print(r,end =", ") # _André Hallqvist_, Jul 25 2019
%o A198584 (Python)
%o A198584 # just prints the sequence
%o A198584 for a in range (5,100,1):
%o A198584   for b in range(a-8+4*(a&1),0,-6):
%o A198584     print(( ((1<<a)-(1<<b))//3-1)//3 ,end=",") # _André Hallqvist_, Aug 14 2019
%Y A198584 Cf. A062053 (numbers producing 3 odds in their Collatz iteration).
%Y A198584 Cf. A092893 (least number producing n odd numbers).
%Y A198584 Cf. A198586-A198593 (odd numbers producing 2-10 odd numbers).
%Y A198584 Cf. A228871, A228872.
%K A198584 nonn,easy
%O A198584 1,1
%A A198584 _T. D. Noe_, Oct 28 2011