Svoboda | Graniru | BBC Russia | Golosameriki | Facebook
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A016726 Smallest k such that 1, 4, 9, ..., n^2 are distinct mod k. 8
1, 2, 6, 9, 10, 13, 14, 17, 19, 22, 22, 26, 26, 29, 31, 34, 34, 37, 38, 41, 43, 46, 46, 53, 53, 53, 58, 58, 58, 61, 62, 67, 67, 71, 71, 73, 74, 79, 79, 82, 82, 86, 86, 89, 94, 94, 94, 97, 101, 101, 103, 106, 106, 109, 113, 113, 118, 118, 118, 122, 122, 127, 127, 131, 131, 134 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
This is the sequence of discriminators of the squares A000290, in the terminology of Arnold et al. - M. F. Hasler, May 04 2016
LINKS
Arnold, L. K.; Benkoski, S. J.; and McCabe, B. J.; The discriminator (a simple application of Bertrand's postulate). Amer. Math. Monthly 92 (1985), 275-277.
FORMULA
For n > 4, a(n) is smallest k >= 2n such that k = p or k = 2p, p a prime.
MATHEMATICA
a[n_] := (k = 2n; While[ Not[PrimeQ[k] || PrimeQ[k/2]], k++]; k); a[1]=1; a[2]=2; a[3]=6; a[4]=9; Table[a[n], {n, 1, 66}] (* Jean-François Alcover, Nov 30 2011, after formula *)
sk[n_]:=Module[{k=2n, n2=Range[n]^2}, While[Max[Tally[Mod[n2, k]][[All, 2]]]> 1, k++]; k]; Join[{1, 2}, Array[sk, 70, 3]] (* Harvey P. Dale, Oct 16 2016 *)
PROG
(Haskell)
a016726 n = a016726_list !! (n-1)
a016726_list = [1, 2, 6, 9] ++ (f 5 $ drop 4 a001751_list) where
f n qs'@(q:qs) | q < 2*n = f n qs
| otherwise = q : f (n+1) qs'
-- Reinhard Zumkeller, Jun 20 2011
(PARI) A016726_vec(nMax)={my(S=[], a=1); vector(nMax, n, S=concat(S, n^2); while(#Set(S%a)<n, a++); a)} \\ M. F. Hasler, May 04 2016
(PARI) A016726(n)=if(n>4, min(nextprime(2*n), 2*nextprime(n)), [1, 2, 6, 9][n]) \\ M. F. Hasler, May 04 2016
CROSSREFS
Cf. A001751, A192419 (cubes), A192420 (4th powers), A347693.
Sequence in context: A325185 A285532 A350944 * A360136 A359821 A047396
KEYWORD
nonn,nice
AUTHOR
bernie(AT)wagnerpa.com (Bernie McCabe)
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 12 01:49 EDT 2024. Contains 375842 sequences. (Running on oeis4.)