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.

A046094 Agoh's congruence; a(n) is conjectured to be 1 iff n is prime.

Original entry on oeis.org

0, 1, 1, 0, 1, 0, 1, 0, 3, 0, 1, 0, 1, 0, 5, 0, 1, 0, 1, 0, 7, 0, 1, 0, 5, 0, 9, 0, 1, 0, 1, 0, 11, 0, 0, 0, 1, 0, 13, 0, 1, 0, 1, 0, 24, 0, 1, 0, 7, 0, 17, 0, 1, 0, 0, 0, 19, 0, 1, 0, 1, 0, 21, 0, 13, 0, 1, 0, 23, 0, 1, 0, 1, 0, 25, 0, 0, 0, 1, 0, 27, 0, 1, 0, 17, 0, 29, 0, 1, 0, 13, 0, 31, 0, 0, 0, 1, 0
Offset: 1

Views

Author

Keywords

Examples

			- 21 * Bernoulli(20) = 21 * 174611 / 330 = 1222277 / 110  and 1 / 110 == 17 mod 21, so a(21) = 1222277 * 17 mod 21 = 7. - _Jonathan Sondow_, Aug 13 2013
		

Crossrefs

Cf. A228037.

Programs

  • Mathematica
    a[ n_ ] := Mod[ Numerator[ -n* BernoulliB[ n-1 ]]*PowerMod[ Denominator[ n*BernoulliB[ n-1 ] ], -1, n ], n ] (* Jonathan Sondow, Aug 13 2013 *)
  • PARI
    a(n) = -n*bernfrac(n-1) % n; \\ Michel Marcus, Aug 08 2017

Formula

a(n) = - n*Bernoulli(n-1) mod n.

Extensions

a(21), a(51), a(57), a(65), a(81) corrected by Jonathan Sondow, Aug 13 2013