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.

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