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.

A213052 Increasing sequence of primes p such that all of 2,3,5,...,prime(n) are primitive roots mod p.

This page as a plain text file.
%I A213052 #30 Jul 13 2018 08:20:12
%S A213052 3,5,53,173,293,2477,9173,22613,27653,61613,74093,92333,170957,360293,
%T A213052 679733,847997,2004917,69009533,76553573,138473837,237536213,
%U A213052 777133013,883597853,1728061733,2050312613,5534091197,9447241877,49107823133,65315700413
%N A213052 Increasing sequence of primes p such that all of 2,3,5,...,prime(n) are primitive roots mod p.
%C A213052 a(32) > 10^12. - _Dana Jacobsen_, Jul 13 2018
%H A213052 Dana Jacobsen, <a href="/A213052/b213052.txt">Table of n, a(n) for n = 1..31</a>
%o A213052 (PARI)
%o A213052 N=10^10;
%o A213052 default(primelimit,N);
%o A213052 A=2;
%o A213052 { forprime (p=3, N,
%o A213052     q = 1;
%o A213052     forprime (a=2, A,
%o A213052         if ( znorder(Mod(a,p)) != p-1,  q=0; break() );
%o A213052     );
%o A213052     if ( q, A=nextprime(A+1); print1(p,", ") );
%o A213052 );}
%o A213052 (Perl)
%o A213052 use Math::Prime::Util ":all";
%o A213052 my($N,$A,$p,$a,@P7) = (10**11,2);
%o A213052 forprimes { $p=$_;
%o A213052   if (   is_primitive_root(2,$p)
%o A213052       && ($A < 3 || is_primitive_root(3,$p))
%o A213052       && ($A < 5 || is_primitive_root(5,$p))
%o A213052       && ($A < 7 || vecall { is_primitive_root($_,$p) } @P7)
%o A213052     ) {
%o A213052       print "$p\n";
%o A213052       $A = next_prime($A);
%o A213052       push @P7, $A if $A >= 7;
%o A213052     }
%o A213052 } 3,$N;
%o A213052 # _Dana Jacobsen_, Jul 11 2018
%K A213052 nonn,hard
%O A213052 1,1
%A A213052 _Joerg Arndt_, Jun 03 2012
%E A213052 a(20)-a(27) from _Joerg Arndt_, Apr 10 2016
%E A213052 a(28)-a(29) from _Dana Jacobsen_, Jul 11 2018