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.

Showing 1-2 of 2 results.

A372651 a(n) is the product of the distinct nonzero quadratic residues of n.

Original entry on oeis.org

1, 1, 1, 1, 4, 12, 8, 4, 28, 1080, 540, 36, 12960, 44352, 2160, 36, 1797120, 524160, 22619520, 2880, 1088640, 4790016000, 465813504, 6912, 5096577024, 8115883776000, 5477472000, 2419200, 267346759680000, 124104960000, 216218419200000, 244800, 143187264000
Offset: 1

Views

Author

Darío Clavijo, May 27 2024

Keywords

Crossrefs

Programs

  • PARI
    a(n) = my(list=List()); for (i=1, n-1, if (issquare(Mod(i, n)), listput(list, i))); vecprod(Vec(list)); \\ Michel Marcus, May 28 2024
  • Python
    from sympy import prod
    def a(n):
      k, QS = 0,[]
      for i in range((n >> 1) + 1):
        if k > 0: QS.append(k)
        k += (i << 1) + 1
        k %= n
      return prod(set(QS))
    print([a(n) for n in range(1, 34)])
    
  • Python
    from math import prod
    from sympy.ntheory.residue_ntheory import quadratic_residues
    def A372651(n): return prod(r for r in quadratic_residues(n) if r) # Chai Wah Wu, May 30 2024
    

Formula

a(n) mod n = A232195(n).
a(n) = Product_{k=1..n} A046071(n,k).

A373286 a(n) = Product_{k=1..n} (k^2 mod n if k^2 mod n > 0).

Original entry on oeis.org

1, 1, 1, 1, 16, 48, 64, 16, 784, 233280, 291600, 20736, 167961600, 281014272, 74649600, 1679616, 3229640294400, 2472693350400, 511642685030400, 2751882854400, 4854321355161600, 2085841207296000000, 216982220508758016, 15850845241344, 25975097361564696576
Offset: 1

Views

Author

Darío Clavijo, May 30 2024

Keywords

Comments

a(n) mod A372651(n) = 0.

Crossrefs

Programs

  • Mathematica
    a[n_]:=Product[Max[Mod[k^2,n],1],{k,n}]; Array[a,25] (* Stefano Spezia, May 30 2024 *)
  • PARI
    a(n) = my(x); prod(k=1, n, if ((x=lift(Mod(k,n)^2))>0, x, 1)); \\ Michel Marcus, May 30 2024
  • Python
    def a(n):
      tmp = 1
      for i in range(1, n+1):
        if (k := pow(i,2,n)): tmp *= k
      return tmp
    print([a(n) for n in range(1, 26)])
    
Showing 1-2 of 2 results.