A368118 a(n) = ceiling(1/p(n)) if p(n) > 0 otherwise 0, where p(n) = 2*sin(Pi * Gamma(n) / n).
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
Keywords
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.
Programs
-
Mathematica
a[n_] := If[(p = 2Sin[Pi*Gamma[n]/n]) > 0, Ceiling[1/p], 0]; Array[a, 84] (* Stefano Spezia, Dec 17 2023 *)
-
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)])
Formula
a(n) > 0 if and only if n is prime. If n is not prime then a(n) = 0.
Comments