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-3 of 3 results.

A071904 Odd composite numbers.

Original entry on oeis.org

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

Views

Author

Shyam Sunder Gupta, Jun 12 2002

Keywords

Comments

Same as A014076 except for the initial term A014076(1)=1 (which is not a composite number).
Values of quadratic form (2x + 3)*(2y + 3) = 4xy + 6x + 6y + 9 for x, y >= 0. - Anton Joha, Jan 21 2001
Intersection of A002808 and A005408. - Reinhard Zumkeller, Oct 10 2011
Composite numbers n such that (n-1)^(n-1) == 1 (mod n). - Michel Lagneau, Feb 18 2012
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
First differences <= 6. Cf. A164510. - Zak Seidov, Sep 22 2016
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

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).
		

Crossrefs

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

A000035(a(n))*(1-A010051(a(n))) = 1; A020639(a(n)) = A162022(n). - Reinhard Zumkeller, Oct 10 2011
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

A281681 a(n) = A055396(A071904(n)) - 1.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 1, 1, 3, 1, 2, 1, 1, 2, 1, 1, 3, 1, 2, 1, 3, 1, 2, 1, 1, 1, 2, 1, 3, 4, 1, 2, 1, 3, 1, 1, 4, 2, 1, 1, 2, 1, 3, 1, 5, 1, 2, 1, 1, 2, 4, 1, 1, 1, 3, 2, 1, 4, 1, 2, 3, 1, 5, 1, 1, 2, 1, 1, 2, 5, 1, 4, 1, 3, 1, 2, 1, 1, 2, 1, 1, 3, 6, 1, 2, 1, 5, 3, 1, 2, 1, 1, 4, 1, 6, 2, 1, 3, 1, 2, 1, 4, 3, 1, 1, 2, 1, 7, 1, 2, 1, 3, 1, 5, 1, 2, 1, 6, 1, 2, 1, 5, 1, 4, 1, 3, 2, 1
Offset: 1

Views

Author

Enrique Navarrete, Jan 26 2017

Keywords

Comments

The sequence measures, in a sense, inversions in remainders of odd numbers upon factoring out their largest divisors (see A281680).
In A281680, we have A281680(4) = A281680(7) = A281680(10) = 3 (and there will be infinitely many 1's to the right after each one of them), so there is why a(1)=a(2)=a(3)=1. Then we have A281680(12) = 5 (and there will be infinitely many 1's and 3's to the right), so that's why a(4) = 2, and so forth. I used 1,2,3,... here to represent these inversions, but any other symbols could have been used.
Entries correspond to the position of the lowest prime factor of the odd composites, with prime=3 being position 1. - Bill McEachen, Jan 28 2018

Crossrefs

Programs

  • PARI
    genit(maxx)={forcomposite(i5=9,maxx,if(i5%2==0,next);ptr=0;forprime(x=3,maxx,ptr+=1;if(i5%x==0,print1(ptr,",");break)));} \\ Bill McEachen, Jan 28 2018
    
  • Python
    from sympy import primepi, primefactors
    def A281681(n):
        if n == 1: return 1
        m, k = n, primepi(n) + n + (n>>1)
        while m != k:
            m, k = k, primepi(k) + n + (k>>1)
        return primepi(min(primefactors(m)))-1 # Chai Wah Wu, Aug 02 2024

Extensions

Name changed by Robert Israel, Aug 03 2020

A162023 Exactly 10 consecutive odd integers starting with n are composite.

Original entry on oeis.org

1131, 1341, 1673, 1953, 2183, 2313, 2483, 2559, 2979, 3143, 3231, 3279, 3471, 3741, 3969, 4029, 4181, 4307, 4527, 4763, 4841, 5127, 5241, 5361, 5451, 5537, 5603, 5759, 5961, 6177, 6401, 6429, 6501, 6741, 6927, 7083, 7131, 7263, 7373, 7769, 7797, 7973
Offset: 1

Views

Author

Zak Seidov, Jun 25 2009, typo corrected Aug 14 2009

Keywords

Examples

			Exactly 10 consecutive odd integers 1131(2)1149 are composite while 1151 is prime.
		

Crossrefs

Programs

  • Maple
    R:= NULL: count:= 0: k:= 1: state:= 0:
    while count < 100 do
      k:= k+2;
      if isprime(k) then
        if state >= 10 then R:= R,k - 20; count:= count + 1;  fi;
        state:= 0;
      else state:= state + 1
      fi;
    od:
    R; # Robert Israel, Feb 12 2025
  • Mathematica
    Transpose[Select[Partition[Range[1,8001,2],11,1],PrimeQ/@ == {False,False,False,False,False,False,False,False,False,False,True}&]] [[1]] (* Harvey P. Dale, Nov 21 2011 *)
Showing 1-3 of 3 results.