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.
%I A236965 #31 Mar 21 2025 18:19:56 %S A236965 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, %T A236965 51,53,27,28,63,65,34,69,37,75,39,81,83,43,89,45,95,48,49,99,105,111, %U A236965 113,57,58,119,60,125,64,131,67,135,69,70,141,73,153,155,78 %N A236965 Number of nonzero quartic residues modulo the n-th prime. %F A236965 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. %F A236965 a(n) = numerator(1/2 - 1/(prime(n)+1)). - _Michel Marcus_, Feb 26 2019 %F A236965 a(n) = A006093(n)/gcd(A006093(n),4). - _Ridouane Oudra_, Mar 13 2025 %e A236965 a(5) = 5 for x^4 (mod 11 = prime(5)) equals 1, 3, 4, 5, 9. %p A236965 seq((ithprime(n)-1)/gcd(ithprime(n)-1,4), n=1..80); # _Ridouane Oudra_, Mar 13 2025 %o A236965 (PARI) a(n) = numerator(1/2 - 1/(prime(n)+1)); \\ _Michel Marcus_, Feb 26 2019 %o A236965 (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 %o A236965 (Python) %o A236965 from sympy import prime %o A236965 from fractions import Fraction %o A236965 def a(n): return (Fraction(1, 2) - Fraction(1, (prime(n)+1))).numerator %o A236965 print([a(n) for n in range(1, 66)]) # _Michael S. Branicky_, Jun 04 2021 %Y A236965 Cf. A000040, A130290, A236959, A306591. %K A236965 nonn,frac %O A236965 1,4 %A A236965 _Carmine Suriano_, Apr 22 2014