login
A368118
a(n) = ceiling(1/p(n)) if p(n) > 0 otherwise 0, where p(n) = 2*sin(Pi * Gamma(n) / n).
0
0, 1, 1, 0, 1, 0, 2, 0, 0, 0, 2, 0, 3, 0, 0, 0, 3, 0, 4, 0, 0, 0, 4, 0, 0, 0, 0, 0, 5, 0, 5, 0, 0, 0, 0, 0, 6, 0, 0, 0, 7, 0, 7, 0, 0, 0, 8, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 10, 0, 10, 0, 0, 0, 0, 0, 11, 0, 0, 0, 12, 0, 12, 0, 0, 0, 0, 0, 13, 0, 0, 0, 14, 0
OFFSET
1,7
COMMENTS
Replacing in the definition '2' by 'n', i.e., defining q(n) = n * sin(Pi * Gamma(n) / n), would make sequence a coincide with the characteristic function of the primes, A010051, since 0 < 1/q(n) < 1 and 1/q(n) -> 1/Pi for prime n -> oo.
REFERENCES
L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 1, p. 427.
LINKS
Underwood Dudley, Formulas for primes, Math. Mag., 56 (1983), 17-22.
Jeffrey Shallit, No Formula for the Prime Numbers?, blog post, Jan 2013.
C. P. Willans, On Formulae for the Nth Prime Number, The Mathematical Gazette, Volume 48, Issue 366, December 1964, pp. 413 - 415.
FORMULA
a(n) > 0 if and only if n is prime. If n is not prime then a(n) = 0.
MATHEMATICA
a[n_] := If[(p = 2Sin[Pi*Gamma[n]/n]) > 0, Ceiling[1/p], 0]; Array[a, 84]
(* Stefano Spezia, Dec 17 2023 *)
PROG
(SageMath)
p = lambda s: 2*sin(pi*gamma(s)/s)
IsPrime = lambda n: p(n).n() > 0
def a(n): return ceil(1/p(n).n()) if IsPrime(n) else 0
print([a(n) for n in range(1, 85)])
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Dec 17 2023
STATUS
approved