cp's OEIS Frontend

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.

A368118 a(n) = ceiling(1/p(n)) if p(n) > 0 otherwise 0, where p(n) = 2*sin(Pi * Gamma(n) / n).

Original entry on oeis.org

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

Views

Author

Peter Luschny, Dec 17 2023

Keywords

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.

Crossrefs

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.