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.
%I A368118 #14 Dec 18 2023 04:19:46 %S A368118 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, %T A368118 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, %U A368118 0,0,0,12,0,12,0,0,0,0,0,13,0,0,0,14,0 %N A368118 a(n) = ceiling(1/p(n)) if p(n) > 0 otherwise 0, where p(n) = 2*sin(Pi * Gamma(n) / n). %C A368118 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. %D A368118 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. %H A368118 Underwood Dudley, <a href="http://www.jstor.org/stable/2690261">Formulas for primes</a>, Math. Mag., 56 (1983), 17-22. %H A368118 Jeffrey Shallit, <a href="https://recursed.blogspot.com/2013/01/no-formula-for-prime-numbers.html">No Formula for the Prime Numbers?</a>, blog post, Jan 2013. %H A368118 C. P. Willans, <a href="https://doi.org/10.2307/3611701">On Formulae for the Nth Prime Number</a>, The Mathematical Gazette, Volume 48, Issue 366, December 1964, pp. 413 - 415. %F A368118 a(n) > 0 if and only if n is prime. If n is not prime then a(n) = 0. %t A368118 a[n_] := If[(p = 2Sin[Pi*Gamma[n]/n]) > 0, Ceiling[1/p], 0]; Array[a, 84] %t A368118 (* _Stefano Spezia_, Dec 17 2023 *) %o A368118 (SageMath) %o A368118 p = lambda s: 2*sin(pi*gamma(s)/s) %o A368118 IsPrime = lambda n: p(n).n() > 0 %o A368118 def a(n): return ceil(1/p(n).n()) if IsPrime(n) else 0 %o A368118 print([a(n) for n in range(1, 85)]) %Y A368118 Cf. A000040, A010051, A061397. %K A368118 nonn %O A368118 1,7 %A A368118 _Peter Luschny_, Dec 17 2023