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.

A323704 Number of cubic residues (including 0) modulo the n-th prime.

Original entry on oeis.org

2, 3, 5, 3, 11, 5, 17, 7, 23, 29, 11, 13, 41, 15, 47, 53, 59, 21, 23, 71, 25, 27, 83, 89, 33, 101, 35, 107, 37, 113, 43, 131, 137, 47, 149, 51, 53, 55, 167, 173, 179, 61, 191, 65, 197, 67, 71, 75, 227, 77, 233, 239, 81, 251, 257, 263, 269, 91, 93, 281, 95, 293
Offset: 1

Views

Author

Florian Severin, Jan 24 2019

Keywords

Crossrefs

Programs

  • Mathematica
    Table[With[{p=Prime[n]},If[Mod[p,3]==1,1+(p-1)/3,p]],{n,80}] (* Harvey P. Dale, Feb 02 2025 *)
  • PARI
    a(n) = my(p=prime(n)); sum(k=0, p-1, ispower(Mod(k,p), 3)); \\ Michel Marcus, Feb 26 2019
  • Python
    from sympy import prime
    def a(n):
      p = prime(n)
      return len(set([x**3 % p for x in range(p)]))
    

Formula

If prime(n) - 1 = 3k then a(n) = k+1, otherwise a(n) = prime(n). (Cf. formula for A236959.)
a(n) = A236959(n) + 1.
a(n) = A046530(A000040(n)). - Rémy Sigrist, Jan 24 2019

A236965 Number of nonzero quartic residues modulo the n-th prime.

Original entry on oeis.org

1, 1, 1, 3, 5, 3, 4, 9, 11, 7, 15, 9, 10, 21, 23, 13, 29, 15, 33, 35, 18, 39, 41, 22, 24, 25, 51, 53, 27, 28, 63, 65, 34, 69, 37, 75, 39, 81, 83, 43, 89, 45, 95, 48, 49, 99, 105, 111, 113, 57, 58, 119, 60, 125, 64, 131, 67, 135, 69, 70, 141, 73, 153, 155, 78
Offset: 1

Views

Author

Carmine Suriano, Apr 22 2014

Keywords

Examples

			a(5) = 5 for x^4 (mod 11 = prime(5)) equals 1, 3, 4, 5, 9.
		

Crossrefs

Programs

  • Maple
    seq((ithprime(n)-1)/gcd(ithprime(n)-1,4), n=1..80); # Ridouane Oudra, Mar 13 2025
  • PARI
    a(n) = numerator(1/2 - 1/(prime(n)+1)); \\ Michel Marcus, Feb 26 2019
    
  • PARI
    a(n) = my(p=prime(n)); sum(k=0, p-1, m = Mod(k,p); m && ispower(Mod(k,p), 4)); \\ Michel Marcus, Feb 26 2019
    
  • Python
    from sympy import prime
    from fractions import Fraction
    def a(n): return (Fraction(1, 2) - Fraction(1, (prime(n)+1))).numerator
    print([a(n) for n in range(1, 66)]) # Michael S. Branicky, Jun 04 2021

Formula

For odd primes, if prime(n) = 4k+1 then a(n) = (prime(n)-1)/4, if prime(n) = 4k+3 then a(n)=(prime(n)-1)/2.
a(n) = numerator(1/2 - 1/(prime(n)+1)). - Michel Marcus, Feb 26 2019
a(n) = A006093(n)/gcd(A006093(n),4). - Ridouane Oudra, Mar 13 2025
Showing 1-2 of 2 results.