%I #110 Aug 20 2024 03:41:38
%S 9,15,21,25,27,33,35,39,45,49,51,55,57,63,65,69,75,77,81,85,87,91,93,
%T 95,99,105,111,115,117,119,121,123,125,129,133,135,141,143,145,147,
%U 153,155,159,161,165,169,171,175,177,183,185,187,189,195,201,203,205
%N Odd composite numbers.
%C Same as A014076 except for the initial term A014076(1)=1 (which is not a composite number).
%C Values of quadratic form (2x + 3)*(2y + 3) = 4xy + 6x + 6y + 9 for x, y >= 0. - _Anton Joha_, Jan 21 2001
%C Intersection of A002808 and A005408. - _Reinhard Zumkeller_, Oct 10 2011
%C Composite numbers n such that (n-1)^(n-1) == 1 (mod n). - _Michel Lagneau_, Feb 18 2012
%C There is a rectangular array of n dots (with both sides > 1) with a unique center point if and only if n is in this sequence. - _Peter Woodward_, Apr 21 2015
%C First differences <= 6. Cf. A164510. - _Zak Seidov_, Sep 22 2016
%C Let r(n) = (a(n)-1)/(a(n)+1) if a(n) mod 4 = 1, (a(n)+1)/(a(n)-1) otherwise; then Product_{n>=1} r(n) = (4/5) * (8/7) * (10/11) * (12/13) * (14/13) * ... = Pi/4. - _Dimitris Valianatos_, May 24 2017
%H Zak Seidov and K. D. Bajpai, <a href="/A071904/b071904.txt">Table of n, a(n) for n = 1..10000</a> (first 1000 terms from Zak Seidov)
%F A000035(a(n))*(1-A010051(a(n))) = 1; A020639(a(n)) = A162022(n). - _Reinhard Zumkeller_, Oct 10 2011
%F a(n) ~ 2n. - _Charles R Greathouse IV_, Jul 02 2013
%F More precisely, a(n) = 2n(1 + 2(1+o(1))/log(n)). - _Vladimir Shevelev_, Jan 07 2015
%e 45 is in the sequence because it is odd and composite (45 = 3 * 3 * 5).
%e 195 is in the sequence because it is odd and composite (195 = 3 * 5 * 13).
%p remove(isprime, [seq(2*i+1, i = 1 .. 1000)]); # _Robert Israel_, Apr 22 2015
%p # alternative
%p A071904 := proc(n) local a;
%p if n = 1 then
%p 9;
%p else
%p for a from procname(n-1)+2 by 2 do
%p if not isprime(a) then
%p return a;
%p end if;
%p end do:
%p end if;
%p end proc: # _R. J. Mathar_, Sep 09 2015
%t Select[Table[n, {n, 9, 300, 2}], !PrimeQ[#] &] (* _Vladimir Joseph Stephan Orlovsky_, Apr 16 2011 *)
%t With[{upto = 200}, Complement[Range[9, upto, 2], Prime[Range[ PrimePi[ upto]]]]] (* _Harvey P. Dale_, Jan 24 2013 *)
%t With[{upto = 200},oddsequence=Table[2n+1,{n,1,upto}];oddcomposites=Union[Flatten[Range[oddsequence^2,upto,2*oddsequence]]]] (* _Ben Engelen_, Feb 24 2016 *)
%o (Haskell)
%o a071904 n = a071904_list !! (n-1)
%o a071904_list = filter odd a002808_list
%o -- _Reinhard Zumkeller_, Oct 10 2011
%o (PARI) is(n)=n%2 && !isprime(n) && n > 1 \\ _Charles R Greathouse IV_, Nov 24 2012
%o (PARI) lista(nn) = forcomposite(n=1, nn, if (n%2, print1(n, ", "))); \\ _Michel Marcus_, Sep 24 2016
%o (Python)
%o from sympy import isprime
%o def ok(n): return n > 3 and n%2 == 1 and not isprime(n)
%o print(list(filter(ok, range(206)))) # _Michael S. Branicky_, Sep 15 2021
%o (Python)
%o from sympy import primepi
%o def A071904(n):
%o if n == 1: return 9
%o m, k = n, primepi(n) + n + (n>>1)
%o while m != k:
%o m, k = k, primepi(k) + n + (k>>1)
%o return m # _Chai Wah Wu_, Jul 31 2024
%Y Cf. A002808, A014076, A005408, A000035, A010051, A020639, A162022.
%Y Cf. A164510.
%K nice,nonn,easy
%O 1,1
%A _Shyam Sunder Gupta_, Jun 12 2002