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.

A337119 Primes p such that b^(p-1) == 1 (mod p-1) for all b coprime to p-1.

This page as a plain text file.
%I A337119 #32 Sep 22 2024 23:20:29
%S A337119 2,3,5,7,13,17,19,37,41,43,61,73,97,101,109,127,157,163,181,193,241,
%T A337119 257,313,337,379,401,421,433,487,541,577,601,641,661,673,757,769,881,
%U A337119 883,937,1009,1093,1153,1201,1249,1297,1321,1361,1459,1601,1621,1801,1861,1873,2017,2029,2053,2161,2269,2341,2437,2521,2593
%N A337119 Primes p such that b^(p-1) == 1 (mod p-1) for all b coprime to p-1.
%C A337119 Equivalently: primes p to p-1 a Novák-Carmichael number A124240.
%C A337119 These p are such that for all x in [0,p), and all b coprime to p-1, x^(b^(p-1)) == x (mod p), this follows from the FLT.
%C A337119 Equivalently, primes p such that for all primes q | p-1, q-1 | p-1. Primes such that p-1 is in A124240. No prime of the form 12k+11 is in this sequence. - _Paul Vanderveen_, Apr 02 2022
%C A337119 Primes p such that B^(b^(p-1)-1) == 1 (mod p^2) for every B coprime to p and for every b coprime to (p-1)*p. - _Thomas Ordowski_, Sep 01 2024
%H A337119 Michael S. Branicky, <a href="/A337119/b337119.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..300 from Harvey P. Dale)
%e A337119 7 is in the sequence because it is prime, 1 and 5 are the integers (mod 6) coprime to 6; 1^6 mod 6 = 1; and 5^6 mod 6 = 1.
%e A337119 11 is not in the sequence because 3 is coprime to 10; and 3^10 mod 10 = 9 <> 1.
%t A337119 a={}; For[p=2,p<2600, p=NextPrime[p],b=p-1; While[--b>0&&(GCD[b,p-1]!=1||PowerMod[b,p-1,p-1]==1)];If[b==0,AppendTo[a,p]]];a
%t A337119 bcpQ[n_]:=Module[{b=Select[Range[n-2],CoprimeQ[n-1,#]&]},AllTrue[ b,PowerMod[ #,n-1,n-1]==1&]]; Select[Prime[Range[400]],bcpQ] (* _Harvey P. Dale_, Jan 01 2022 *)
%o A337119 (Python)
%o A337119 from math import gcd
%o A337119 from sympy import isprime
%o A337119 def ok(n):
%o A337119     if not isprime(n): return False
%o A337119     return all(pow(b, n-1, n-1) == 1 for b in range(2, n) if gcd(b, n-1)==1)
%o A337119 print([k for k in range(2594) if ok(k)]) # _Michael S. Branicky_, Apr 02 2022
%Y A337119 Cf. A124240.
%K A337119 nonn
%O A337119 1,1
%A A337119 _Francois R. Grieu_, Aug 17 2020