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.

A210640 a(n) = least integer m > 1 such that 2S_k^2 (k=1,...,n) are pairwise distinct modulo m, where S_k is the sum of the first k primes.

Original entry on oeis.org

2, 4, 9, 13, 17, 28, 37, 37, 37, 37, 37, 61, 61, 61, 151, 151, 151, 151, 151, 151, 151, 227, 227, 227, 227, 227, 307, 307, 307, 337, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, 509, 509, 509, 509, 509, 643, 727, 727, 761, 761, 761, 971, 971, 971
Offset: 1

Views

Author

Zhi-Wei Sun, Mar 26 2012

Keywords

Comments

If a(n) is an odd prime p_k then a(n)|2(S_k^2-S_{k-1}^2) and hence k>n. Zhi-Wei Sun conjectured that a(n) is a prime smaller than n^2 unless n divides 6.

Examples

			We have a(3)=9, because 2*2^2=8, 2*(2+3)^2=50, 2(2+3+5)^2=200 are pairwise distinct modulo m=9 but not pairwise distinct modulo any of 2, 3, 4, 5, 6, 7, 8.
		

Crossrefs

Programs

  • Mathematica
    s[n_] := s[n] = Sum[Prime[k], {k,1,n}]; f[n_] := f[n] = 2*s[n]^2; R[n_,m_] := Union[Table[Mod[f[k],m], {k,1,n}]]; Do[Do[If[Length[R[n,m]] == n, Print[n," ",m]; Goto[aa]], {m,2,Max[2,n^2]}]; Print[n]; Label[aa]; Continue, {n,1,5000}]