OFFSET
1,11
COMMENTS
It appears that a(n)=0 for only the 30 numbers in A065428, which appears to be related to idoneal numbers, A000926. The graph shows a(n) can be quite small even for large n. For example, a(9240)=7. Observe that the graph up to n=10000 appears to have 5 components. Why?
The logarithmic plot of the first 10^6 terms shows seven components.
From Rémy Sigrist, Nov 28 2017: (Start)
Empirically, in the logarithmic plot of the sequence:
- the set of indices of the first component (starting from the top), say S_1, is the union of A061345 and of A278568,
- the set of indices of the n-th component (for n > 1), say S_n, contains the numbers k not in a previous component and such that (omega(k) = n-1) or (omega(k) = n and val(k) = 0 or 2) or (omega(k) = n+1 and val(k) = 1) (where omega(k) = A001221(k) and val(k) = A007814(k)),
- see logarithmic scatterplot colored according to this scheme in Links section.
(End)
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
EXAMPLE
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.
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 *)
PROG
(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
CROSSREFS
KEYWORD
AUTHOR
T. D. Noe, Aug 13 2007, Aug 17 2007
STATUS
approved