A071904 Odd composite numbers.
9, 15, 21, 25, 27, 33, 35, 39, 45, 49, 51, 55, 57, 63, 65, 69, 75, 77, 81, 85, 87, 91, 93, 95, 99, 105, 111, 115, 117, 119, 121, 123, 125, 129, 133, 135, 141, 143, 145, 147, 153, 155, 159, 161, 165, 169, 171, 175, 177, 183, 185, 187, 189, 195, 201, 203, 205
Offset: 1
Examples
45 is in the sequence because it is odd and composite (45 = 3 * 3 * 5). 195 is in the sequence because it is odd and composite (195 = 3 * 5 * 13).
Links
- K. D. Bajpai, Table of n, a(n) for n = 1..10000 (first 1000 terms from Zak Seidov).
- Joel E. Cohen and Dexter Senft, Gaps of size 2, 4, and (conditionally) 6 between successive odd composite numbers occur infinitely often, Notes on Number Theory and Discrete Mathematics, Volume 31, Number 3, 494-503 (2025). See p. 495.
Programs
-
Haskell
a071904 n = a071904_list !! (n-1) a071904_list = filter odd a002808_list -- Reinhard Zumkeller, Oct 10 2011
-
Maple
remove(isprime, [seq(2*i+1, i = 1 .. 1000)]); # Robert Israel, Apr 22 2015 # alternative A071904 := proc(n) local a; if n = 1 then 9; else for a from procname(n-1)+2 by 2 do if not isprime(a) then return a; end if; end do: end if; end proc: # R. J. Mathar, Sep 09 2015
-
Mathematica
Select[Table[n, {n, 9, 300, 2}], !PrimeQ[#] &] (* Vladimir Joseph Stephan Orlovsky, Apr 16 2011 *) With[{upto = 200}, Complement[Range[9, upto, 2], Prime[Range[ PrimePi[ upto]]]]] (* Harvey P. Dale, Jan 24 2013 *) With[{upto = 200},oddsequence=Table[2n+1,{n,1,upto}];oddcomposites=Union[Flatten[Range[oddsequence^2,upto,2*oddsequence]]]] (* Ben Engelen, Feb 24 2016 *)
-
PARI
is(n)=n%2 && !isprime(n) && n > 1 \\ Charles R Greathouse IV, Nov 24 2012
-
PARI
lista(nn) = forcomposite(n=1, nn, if (n%2, print1(n, ", "))); \\ Michel Marcus, Sep 24 2016
-
Python
from sympy import isprime def ok(n): return n > 3 and n%2 == 1 and not isprime(n) print(list(filter(ok, range(206)))) # Michael S. Branicky, Sep 15 2021
-
Python
from sympy import primepi def A071904(n): if n == 1: return 9 m, k = n, primepi(n) + n + (n>>1) while m != k: m, k = k, primepi(k) + n + (k>>1) return m # Chai Wah Wu, Jul 31 2024
Formula
a(n) ~ 2n. - Charles R Greathouse IV, Jul 02 2013
More precisely, a(n) = 2n(1 + 2(1+o(1))/log(n)). - Vladimir Shevelev, Jan 07 2015
Comments