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.

A103309 Smallest prime primitive root of n that is less than n, or 0 if none exists.

This page as a plain text file.
%I A103309 #24 Feb 16 2025 08:32:56
%S A103309 0,0,0,2,3,2,5,3,0,2,3,2,0,2,3,0,0,3,5,2,0,0,7,5,0,2,7,2,0,2,0,3,0,0,
%T A103309 3,0,0,2,3,0,0,7,0,3,0,0,5,5,0,3,3,0,0,2,5,0,0,0,3,2,0,2,3,0,0,0,0,2,
%U A103309 0,0,0,7,0,5,5,0,0,0,0,3,0,2,7,2,0,0,3,0,0,3,0,0,0,0,5,0,0,5,3,0,0,2,0,5,0
%N A103309 Smallest prime primitive root of n that is less than n, or 0 if none exists.
%C A103309 Differs from A046145 only for indices n = 2, 41, 109, 151, 229, ...; see A103335. - _Jeppe Stig Nielsen_, Mar 06 2020
%H A103309 Robert Israel, <a href="/A103309/b103309.txt">Table of n, a(n) for n = 0..10000</a>
%H A103309 G. Martin, <a href="http://arxiv.org/abs/math/9807104">The Least Prime Primitive Root and the Shifted Sieve</a>, Acta Arith. 80 (1997), no. 3, 277-288; arXiv:math/9807104 [math.NT], 1998.
%H A103309 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PrimitiveRoot.html">Primitive Root.</a>
%p A103309 F:= proc(n)
%p A103309   local r;
%p A103309   r:= numtheory:-primroot(n);
%p A103309   while r::integer and not isprime(r) do
%p A103309     r:= numtheory:-primroot(r,n);
%p A103309   od:
%p A103309   if r = FAIL then 0 else r fi
%p A103309 end proc:
%p A103309 seq(F(n),n=0..200); # _Robert Israel_, May 18 2015
%t A103309 a[n_] := SelectFirst[PrimitiveRootList[n], PrimeQ[#] && # < n&] /. Missing["NotFound"] -> 0;
%t A103309 Table[a[n], {n, 0, 104}] (* _Jean-François Alcover_, Nov 15 2017 *)
%Y A103309 Cf. A001918, A046144, A046145, A046146, A103310, A103335.
%K A103309 easy,nonn
%O A103309 0,4
%A A103309 _Harry J. Smith_, Jan 29 2005