OFFSET
0,3
COMMENTS
1's between primes correspond to odd nonprimes (see A047846).
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..1000
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
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 *)
PROG
(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
(Python)
from sympy import isprime
def A128059(n): return a if isprime(a:=(n<<1)-1) else 1 # Chai Wah Wu, Feb 26 2024
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Paul Barry, Feb 13 2007
STATUS
approved