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

A014076 Odd nonprimes.

Original entry on oeis.org

1, 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, 207
Offset: 1

Views

Author

Keywords

Comments

Same as A071904 except for the initial term 1 (which is not composite).
Numbers n such that product of first n odd numbers divided by sum of the first n odd numbers is an integer : 1*3*5*...*(2*n - 1) / (1 + 3 + 5 + ... + (2*n - 1)) = c. - Ctibor O. Zizka, Jun 26 2010
Conjecture: There exist infinitely many pairs [a(n), a(n)+6] such that a(n)/3 and (a(n)+6)/3 are twin primes. - Eric Desbiaux, Sep 25 2014.
Odd numbers 2*n + 1 such that (2*n)!/(2*n + 1) is an integer. Odd terms of A056653. - Peter Bala, Jan 24 2017

Crossrefs

Cf. A002808, A005408; first differences: A067970, A196274; A047846.
Cf. A056653.

Programs

  • Haskell
    a014076 n = a014076_list !! (n-1)
    a014076_list = filter ((== 0) . a010051) a005408_list
    -- Reinhard Zumkeller, Sep 30 2011
    
  • Maple
    remove(isprime, [seq(i,i=1..1000,2)]); # Robert Israel, May 25 2016
    for n from 0 to 120 do
    if irem(factorial(2*n), 2*n+1) = 0 then print(2*n+1) end if;
    end do: # Peter Bala, Jan 24 2017
  • Mathematica
    Select[Range@210, !PrimeQ@ # && OddQ@ # &] (* Robert G. Wilson v, Sep 22 2008 *)
    Select[Range[1, 199, 2], PrimeOmega[#] != 1 &] (* Alonso del Arte, Nov 19 2012 *)
  • PARI
    is(n)=n%2 && !isprime(n) \\ Charles R Greathouse IV, Nov 24 2012
    
  • Python
    from sympy import primepi
    def A014076(n):
        if n == 1: return 1
        m, k = n-1, primepi(n) + n - 1 + (n>>1)
        while m != k:
            m, k = k, primepi(k) + n - 1 + (k>>1)
        return m # Chai Wah Wu, Jul 31 2024

Formula

A000035(a(n))*(1 - A010051(a(n))) = 1. - Reinhard Zumkeller, Sep 30 2011
a(n) ~ 2n. - Charles R Greathouse IV, Jul 02 2013
(a(n+2)-1)/2 - pi(a(n+2)-1) = n. - Anthony Browne, May 25 2016. Proof from Robert Israel: This follows by induction on n. If f(n) = (a(n+2)-1)/2 - pi(a(n+2)-1), one can show f(n+1) - f(n) = 1 (there are three cases to consider, depending on primeness of a(n+2) + 2 and a(n+2) + 4).
Union of A091113 and A091236. - R. J. Mathar, Oct 02 2018

A128059 a(n) = numerator((2*n-1)^2/(2*(2*n)!)).

Original entry on oeis.org

1, 1, 3, 5, 7, 1, 11, 13, 1, 17, 19, 1, 23, 1, 1, 29, 31, 1, 1, 37, 1, 41, 43, 1, 47, 1, 1, 53, 1, 1, 59, 61, 1, 1, 67, 1, 71, 73, 1, 1, 79, 1, 83, 1, 1, 89, 1, 1, 1, 97, 1, 101, 103, 1, 107, 109, 1, 113, 1, 1, 1, 1, 1, 1, 127
Offset: 0

Views

Author

Paul Barry, Feb 13 2007

Keywords

Comments

1's between primes correspond to odd nonprimes (see A047846).

Crossrefs

Essentially the odd bisection of A089026.

Programs

  • Haskell
    a128059 0 = 1
    a128059 n = f n n where
       f 1 _ = 1
       f x q = if a010051' q' == 1 then q' else f x' q'
               where x' = x - 1; q' = q + x'
    -- Reinhard Zumkeller, Jun 14 2015
    
  • Maple
    A128059 := proc(n): numer(((2*n-1)^2)/(2*(2*n)!)) end: seq(A128059(n), n=0..64); # Artur Jasinski, Nov 29 2008
    A128059 := proc(n): if isprime(2*n-1) then 2*n-1 else 1 fi: end: seq(A128059(n), n=0..64); # Johannes W. Meijer, Oct 25 2012, Jun 01 2016
  • Mathematica
    Table[Numerator[(2 n - 1)^2/(2 (2 n)!)], {n, 0, 64}] (* Michael De Vlieger, Jun 01 2016 *)
  • Python
    from sympy import isprime
    def A128059(n): return a if isprime(a:=(n<<1)-1) else 1 # Chai Wah Wu, Feb 26 2024

Formula

Conjecture: a(n) = denominator(f(n-1)) with f(n) = lcm(2,3,4,5,...,n)*(Sum_{k=0..n} frac(Bernoulli(2*k))*binomial(n+k,k)). - Yalcin Aktar, Jul 23 2008
a(n) = 2*n-3 if 2*n-3 is prime and a(n) = 1 otherwise. a(n+4) = A145737(n+2), for n >= 1. - Artur Jasinski, Nov 29 2008
a(n+1) = denominator( (2n)!/(2n+1) ), n > 0. - Wesley Ivan Hurt, Jun 19 2013
a(n+1) = abs(2n*(pi(2n) - pi(2n-2)) - 1) where abs is the absolute value function and pi is the prime counting function (A000720). - Anthony Browne, Jun 28 2016
a(n+1) = denominator(Bernoulli(2*n)*(2*n)!) = numerator(Clausen(2*n,1)/(2*n)!) with Clausen defined in A160014. - Peter Luschny, Sep 25 2016

A196277 Numbers m such that A196274(m) > 1.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 10, 12, 14, 16, 17, 19, 20, 22, 25, 26, 27, 28, 34, 35, 37, 41, 43, 45, 46, 48, 50, 54, 55, 60, 65, 66, 67, 69, 73, 75, 77, 79, 81, 82, 86, 92, 93, 94, 100, 102, 106, 107, 109, 112, 114, 116, 117, 119, 122, 123, 126, 130, 134, 136, 137
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 30 2011

Keywords

Comments

Complement of A196276; A196274(a(n)) > 1;
A047846(n+1) = a(n+1) - a(n).

Programs

  • Haskell
    import Data.List (findIndices)
    a196277 n = a196277_list !! (n-1)
    a196277_list = map (+ 1) $ findIndices (> 1) a196274_list

A160522 The n-th odd composite number minus the n-th even composite number.

Original entry on oeis.org

5, 9, 13, 15, 15, 19, 19, 21, 25, 27, 27, 29, 29, 33, 33, 35, 39, 39, 41, 43, 43, 45, 45, 45, 47, 51, 55, 57, 57, 57, 57, 57, 57, 59, 61, 61, 65, 65, 65, 65, 69, 69, 71, 71, 73, 75, 75, 77, 77, 81, 81, 81, 81, 85, 89, 89, 89, 89, 89, 91, 91, 91, 91, 91, 93, 97, 99, 99, 103, 103
Offset: 1

Views

Author

Kyle Stern, May 16 2009

Keywords

Crossrefs

Programs

  • MATLAB
    composite function [a] = A160522(k) j = 1; n = 1; even = 4; while j < k n = n + 1; if isprime(n) == 1 else if mod(n,2) == 0 else a(j,1) = n - even; even = even + 2; j = j + 1; end end end
    
  • Mathematica
    Last[t = GatherBy[Select[Range[4, 245], ! PrimeQ[#] &], OddQ]] - Take[First[t], Length[Last[t]]] (* Jayanta Basu, Aug 11 2013 *)
  • PARI
    m=70; v=vector(m); k=4; n=0; while(n0&&!isprime(k), n++; v[n]=k-2*(n+1)); k++); v \\ Klaus Brockhaus, May 22 2009
    
  • Python
    from sympy import primepi
    def A160522(n):
        if n == 1: return 5
        m, k = n, primepi(n) + n + (n>>1)
        while m != k:
            m, k = k, primepi(k) + n + (k>>1)
        return m-(n+1<<1) # Chai Wah Wu, Aug 01 2024

Formula

a(n) = A071904(n) - A005843(n+1).

Extensions

Extended and formula edited by Klaus Brockhaus, May 22 2009

A256253 Number of successive odd nonprimes A014076 and number of successive odd primes A065091, interleaved.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Mar 30 2015

Keywords

Comments

See also A256252 and A256262 which contain similar diagrams.

Examples

			Consider an irregular array in which the odd-indexed rows list successive odd nonprimes (A014076) and the even-indexed rows list successive odd primes (A065091), in the sequence of odd numbers (A005408), as shown below:
1;
3, 5, 7;
9;
11, 13;
15;
17; 19;
21,
23;
25, 27;
39, 31;
...
a(n) is the length of the n-th row.
.
Illustration of the first 16 regions of the diagram of the symmetric representation of odd nonprimes (A014076) and of odd primes (A065091):
.            _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.           |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _  |   31
.           |_ _ _ _ _ _ _ _ _ _ _ _ _ _  | |   29
.           | | |_ _ _ _ _ _ _ _ _ _ _  | | |   23
.           | | | |_ _ _ _ _ _ _ _ _  | | | |   19
.           | | | |_ _ _ _ _ _ _ _  | | | | |   17
.           | | | | |_ _ _ _ _ _  | | | | | |   13
.           | | | | |_ _ _ _ _  | | | | | | |   11
.           | | | | | |_ _ _  | | | | | | | |    7
.           | | | | | |_ _  | | | | | | | | |    5
.   A014076 | | | | | |_  | | | | | | | | | |    3
.      1    | | | | | |_|_|_|_| | | | | | | | A065091
.      9    | | | | |_ _ _ _ _|_|_| | | | | |
.     15    | | | |_ _ _ _ _ _ _ _|_|_| | | |
.     21    | | |_ _ _ _ _ _ _ _ _ _ _|_| | |
.     25    | |_ _ _ _ _ _ _ _ _ _ _ _ _| | |
.     27    |_ _ _ _ _ _ _ _ _ _ _ _ _ _|_|_|
.
a(n) is also the length of the n-th boundary segment in the zig-zag path of the above diagram, between the two types of numbers, as shown below for n = 1..10:
.
.                       |_ _ _
.                             |_ _
.                                 |_ _
.                                     |_
.                                       |
.                                       |_ _
.
The sequence begins:    1,3,1,2,1,2,1,1,2,2,...
.
		

Crossrefs

Programs

  • PARI
    lista(nn) = {my(nb = 1, isp = 0); forstep (n=3, nn, 2, if (bitxor(isp, ! isprime(n)), nb++, print1(nb, ", "); nb = 1; isp = ! isp););} \\ Michel Marcus, May 25 2015

Formula

a(n) = A256252(n-1), n >= 3.
Showing 1-5 of 5 results.