OFFSET
1,2
FORMULA
a(n) = 2n+1 if 2n+1 is prime, 1 otherwise, for n > 1.
From Gary Detlefs, Oct 18 2011: (Start)
a(n) = Denominator(n!*(Sum_{k=1..n} k^3)/(Sum_{k=1..n} k^2))
= Denominator(n!*3*n*(n+1)/(2*(2*n+1))). (End)
MAPLE
seq(denom(n!*3*n*(n+1)/(2*(2*n+1))), n=1..81); # Gary Detlefs, Oct 18 2011
MATHEMATICA
m = 1; aa = {}; Do[k = 0; Do[k = k + m^(2 r + 1 - d)/d, {d, 1, 2 r}]; b = Sqrt[Numerator[k]] /. Sqrt[_] -> 1; AppendTo[aa, b], {r, 1, 137}]; aa (* Artur Jasinski *)
PROG
(Python)
from sympy import isprime
def A145737(n): return a if isprime(a:=(n<<1)+1) and n>1 else 1 # Chai Wah Wu, Feb 26 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Artur Jasinski, Oct 17 2008
STATUS
approved