A132213 Number of distinct primes among the squares mod n.
0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 2, 0, 1, 3, 0, 0, 2, 2, 4, 1, 1, 3, 3, 0, 2, 4, 3, 0, 4, 1, 4, 1, 2, 4, 2, 1, 3, 6, 2, 0, 5, 2, 6, 2, 2, 7, 5, 0, 6, 5, 3, 3, 8, 6, 3, 0, 3, 6, 8, 0, 6, 8, 3, 2, 2, 3, 7, 3, 3, 2, 7, 0, 9, 10, 3, 4, 6, 4, 9, 1, 10, 10, 11, 1, 2, 13, 3, 0, 10, 4, 5, 4, 4, 13, 4, 1, 11, 10, 4, 4
Offset: 1
Examples
For n=14, the squares (mod n) repeat 0,1,4,9,2,11,8,7,8,11,2,9,4,1,0,..., a sequence containing three distinct primes: 2, 7 and 11. Hence a(14)=3.
Links
- T. D. Noe, Table of n, a(n) for n = 1..10000
- T. D. Noe, Logarithmic plot of 10^6 terms
- Rémy Sigrist, Colored logarithmic plot of 2*10^6 terms
Crossrefs
Programs
-
Haskell
import Data.List (nub, genericTake) a132213 n = sum $ map a010051' $ nub $ genericTake n $ map (`mod` n) $ tail a000290_list -- Reinhard Zumkeller, Jun 23 2015, Oct 15 2011
-
Mathematica
Table[s=Union[Mod[Range[n]^2,n]]; Length[Select[s,PrimeQ]], {n,10000}] Table[Count[Union[PowerMod[Range[n],2,n]],?PrimeQ],{n,100}] (* _Harvey P. Dale, Mar 02 2018 *)
Comments