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.

A292411 a(n) = ((prime(n) - 1)/2)^2 modulo prime(n).

Original entry on oeis.org

1, 4, 2, 3, 10, 13, 5, 6, 22, 8, 28, 31, 11, 12, 40, 15, 46, 17, 18, 55, 20, 21, 67, 73, 76, 26, 27, 82, 85, 32, 33, 103, 35, 112, 38, 118, 41, 42, 130, 45, 136, 48, 145, 148, 50, 53, 56, 57, 172, 175, 60, 181, 63, 193, 66, 202, 68, 208, 211, 71, 220, 77, 78, 235, 238, 83, 253, 87, 262
Offset: 2

Views

Author

Alonso del Arte, Sep 16 2017

Keywords

Comments

Also the square of (prime(n) - 1)/2 + 1 modulo prime(n).

Examples

			The fourth prime is 7; ((7 - 1)/2)^2 = 3^2 = 9 = 2 mod 7. Hence a(4) = 2.
The fifth prime is 11; ((11 - 1)/2)^2 = 5^2 = 25 = 3 mod 11. Hence a(5) = 3.
		

Crossrefs

Cf. A005097.

Programs

  • Mathematica
    Table[PowerMod[(Prime[n] - 1)/2, 2, Prime[n]], {n, 2, 70}]
  • PARI
    a(n) = lift(Mod((prime(n)-1)/2, prime(n))^2); \\ Michel Marcus, Sep 19 2017
    
  • Python
    from sympy import prime
    def A292411(n): return pow((p:=prime(n))-1>>1,2,p) # Chai Wah Wu, Feb 14 2025

Formula

a(n) = 4^(-1) mod prime(n). - R. J. Cintra, Jan 25 2025