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.
%I A016726 #31 Oct 04 2021 23:57:26 %S A016726 1,2,6,9,10,13,14,17,19,22,22,26,26,29,31,34,34,37,38,41,43,46,46,53, %T A016726 53,53,58,58,58,61,62,67,67,71,71,73,74,79,79,82,82,86,86,89,94,94,94, %U A016726 97,101,101,103,106,106,109,113,113,118,118,118,122,122,127,127,131,131,134 %N A016726 Smallest k such that 1, 4, 9, ..., n^2 are distinct mod k. %C A016726 This is the sequence of discriminators of the squares A000290, in the terminology of Arnold et al. - _M. F. Hasler_, May 04 2016 %H A016726 T. D. Noe, <a href="/A016726/b016726.txt">Table of n, a(n) for n=1..1000</a> %H A016726 Arnold, L. K.; Benkoski, S. J.; and McCabe, B. J.; <a href="http://www.jstor.org/stable/2323651">The discriminator (a simple application of Bertrand's postulate)</a>. Amer. Math. Monthly 92 (1985), 275-277. %F A016726 For n > 4, a(n) is smallest k >= 2n such that k = p or k = 2p, p a prime. %t A016726 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 *) %t A016726 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 *) %o A016726 (Haskell) %o A016726 a016726 n = a016726_list !! (n-1) %o A016726 a016726_list = [1,2,6,9] ++ (f 5 $ drop 4 a001751_list) where %o A016726 f n qs'@(q:qs) | q < 2*n = f n qs %o A016726 | otherwise = q : f (n+1) qs' %o A016726 -- _Reinhard Zumkeller_, Jun 20 2011 %o A016726 (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 %o A016726 (PARI) A016726(n)=if(n>4,min(nextprime(2*n),2*nextprime(n)),[1,2,6,9][n]) \\ _M. F. Hasler_, May 04 2016 %Y A016726 Cf. A001751, A192419 (cubes), A192420 (4th powers), A347693. %K A016726 nonn,nice %O A016726 1,2 %A A016726 bernie(AT)wagnerpa.com (Bernie McCabe)