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.

A071904 Odd composite numbers.

This page as a plain text file.
%I A071904 #116 Aug 26 2025 03:53:15
%S A071904 9,15,21,25,27,33,35,39,45,49,51,55,57,63,65,69,75,77,81,85,87,91,93,
%T A071904 95,99,105,111,115,117,119,121,123,125,129,133,135,141,143,145,147,
%U A071904 153,155,159,161,165,169,171,175,177,183,185,187,189,195,201,203,205
%N A071904 Odd composite numbers.
%C A071904 Same as A014076 except for the initial term A014076(1)=1 (which is not a composite number).
%C A071904 Values of quadratic form (2x + 3)*(2y + 3) = 4xy + 6x + 6y + 9 for x, y >= 0. - _Anton Joha_, Jan 21 2001
%C A071904 Intersection of A002808 and A005408. - _Reinhard Zumkeller_, Oct 10 2011
%C A071904 Composite numbers n such that (n-1)^(n-1) == 1 (mod n). - _Michel Lagneau_, Feb 18 2012
%C A071904 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 A071904 First differences <= 6. Cf. A164510. - _Zak Seidov_, Sep 22 2016
%C A071904 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 A071904 K. D. Bajpai, <a href="/A071904/b071904.txt">Table of n, a(n) for n = 1..10000</a> (first 1000 terms from Zak Seidov).
%H A071904 Joel E. Cohen and Dexter Senft, <a href="https://doi.org/10.7546/nntdm.2025.31.3.494-503">Gaps of size 2, 4, and (conditionally) 6 between successive odd composite numbers occur infinitely often</a>, Notes on Number Theory and Discrete Mathematics, Volume 31, Number 3, 494-503 (2025). See p. 495.
%F A071904 A000035(a(n))*(1-A010051(a(n))) = 1; A020639(a(n)) = A162022(n). - _Reinhard Zumkeller_, Oct 10 2011
%F A071904 a(n) ~ 2n. - _Charles R Greathouse IV_, Jul 02 2013
%F A071904 More precisely, a(n) = 2n(1 + 2(1+o(1))/log(n)). - _Vladimir Shevelev_, Jan 07 2015
%e A071904 45 is in the sequence because it is odd and composite (45 = 3 * 3 * 5).
%e A071904 195 is in the sequence because it is odd and composite (195 = 3 * 5 * 13).
%p A071904 remove(isprime, [seq(2*i+1, i = 1 .. 1000)]); # _Robert Israel_, Apr 22 2015
%p A071904 # alternative
%p A071904 A071904 := proc(n) local a;
%p A071904     if n = 1 then
%p A071904         9;
%p A071904     else
%p A071904         for a from procname(n-1)+2 by 2 do
%p A071904             if not isprime(a) then
%p A071904                 return a;
%p A071904             end if;
%p A071904         end do:
%p A071904     end if;
%p A071904 end proc: # _R. J. Mathar_, Sep 09 2015
%t A071904 Select[Table[n, {n, 9, 300, 2}], !PrimeQ[#] &] (* _Vladimir Joseph Stephan Orlovsky_, Apr 16 2011 *)
%t A071904 With[{upto = 200}, Complement[Range[9, upto, 2], Prime[Range[ PrimePi[ upto]]]]] (* _Harvey P. Dale_, Jan 24 2013 *)
%t A071904 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 A071904 (Haskell)
%o A071904 a071904 n = a071904_list !! (n-1)
%o A071904 a071904_list = filter odd a002808_list
%o A071904 -- _Reinhard Zumkeller_, Oct 10 2011
%o A071904 (PARI) is(n)=n%2 && !isprime(n) && n > 1 \\ _Charles R Greathouse IV_, Nov 24 2012
%o A071904 (PARI) lista(nn) = forcomposite(n=1, nn, if (n%2, print1(n, ", "))); \\ _Michel Marcus_, Sep 24 2016
%o A071904 (Python)
%o A071904 from sympy import isprime
%o A071904 def ok(n): return n > 3 and n%2 == 1 and not isprime(n)
%o A071904 print(list(filter(ok, range(206)))) # _Michael S. Branicky_, Sep 15 2021
%o A071904 (Python)
%o A071904 from sympy import primepi
%o A071904 def A071904(n):
%o A071904     if n == 1: return 9
%o A071904     m, k = n, primepi(n) + n + (n>>1)
%o A071904     while m != k:
%o A071904         m, k = k, primepi(k) + n + (k>>1)
%o A071904     return m # _Chai Wah Wu_, Jul 31 2024
%Y A071904 Cf. A002808, A014076, A005408, A000035, A010051, A020639, A162022.
%Y A071904 Cf. A164510.
%K A071904 nice,nonn,easy,changed
%O A071904 1,1
%A A071904 _Shyam Sunder Gupta_, Jun 12 2002