A181901 a(n) = least positive integer m such that 2(s_k)^2 for k=1,...,n are pairwise distinct modulo m where s_k = Sum_{j=1..k} (-1)^(k-j)*p_j and p_j is the j-th prime.
1, 4, 7, 9, 13, 17, 19, 23, 25, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233
Offset: 1
Keywords
Examples
We have a(4)=9 since 2(s_1)^2=8, 2(s_2)^2=2, 2(s_3)^2=32, 2(s_4)^2=18 are pairwise distinct modulo 9 but not pairwise distinct modulo any of 1,...,8.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..600
- Zhi-Wei Sun, An amazing recurrence for primes, a message to Number Theory List, March 31, 2012.
- Zhi-Wei Sun, On functions taking only prime values, J. Number Theory 133(2013), no.8, 2794-2812.
Crossrefs
Programs
-
Mathematica
s[n_]:=Sum[(-1)^k*Prime[k],{k,1,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,1,Prime[n+1]}]; Print[n];Label[aa];Continue,{n,1,600}]
Comments