login
A161490
a(n) = smallest prime of the form k*n+s(n) where s(n) is the sum of the first n primes, or a(n) = 0 if no such prime exists.
0
3, 7, 13, 29, 43, 47, 79, 101, 109, 139, 193, 233, 251, 337, 373, 397, 457, 0, 587, 659, 733, 857, 0, 0, 0, 1187, 1291, 1399, 1567, 0, 1999, 1979, 2087, 2161, 2311, 0, 2621, 2861, 2953, 3167, 3307, 0, 3767, 3919, 4073, 4273, 4673, 5189, 4937, 5167, 5503
OFFSET
1,1
COMMENTS
Sequence of corresponding values k (see definition; 0 if no prime exists) is 1, 1, 1, 3, 3, 1, 3, 3, 1, 1, 3, 3, 1, 4, 3, 1, 1, 0, 1, 1, 1, 3, 0, 0, 0, 1, 1, 1, 3, 0, 9, 4, 3, 1, 1, 0, 1, 3, 1, 2, 1, 0, 3, 2, 1, 1, 5, 11, 1, 1, 3.
a(n) = 0 if n and s(n) are not coprime, otherwise there are infinitely many primes in the arithmetic progression k*n+s(n) for k >= 1 (Dirichlet's theorem).
Even if the zero terms are ignored, the sequence is not monotone increasing: a(31) = 1999 > a(32) = 1979, a(48) = 5189 > a(49) = 4937.
LINKS
Eric Weisstein's World of Mathematics, Dirichlet's Theorem
EXAMPLE
For n = 1 we have s(n) = 2; 1*n+s(n) = 3 is prime, hence a(1) = 3.
For n = 4 we have s(n) = 17; 1*n+s(n) = 21 and 2*n+s(n) = 25 are composite, but 3*n+s(n) = 29 is prime, hence a(4) = 29.
For n = 18 we have s(n) = 501; 18 and 501 have common divisor 3, hence k*n+s(n) is divisible by 3 for k >= 1 and a(18) = 0.
For n = 48 we have s(n) = 4661; k*n+s(n) is composite for k <= 10, but 11*n+s(n) = 5189 is prime, hence a(48) = 5189.
MATHEMATICA
s[1] = 2; s[n_] := s[n] = s[n-1] + Prime[n]; a[n_ /; !CoprimeQ[n, s[n]]] = 0; a[n_] := For[k = 1, True, k++, If[PrimeQ[p = k*n + s[n]], Return[p]]]; Table[a[n], {n, 1, 51}] (* Jean-François Alcover, Oct 02 2013 *)
PROG
(Magma) smallest:=function(n, s) if Gcd(n, s) gt 1 then return 0; else a:=n+s; while not IsPrime(a) do a+:=n; end while; return a; end if; end function; S:=[]; s:=0; for n in [1..51] do s+:=NthPrime(n); Append(~S, smallest(n, s)); end for; S; // Klaus Brockhaus, Jun 12 2009
CROSSREFS
Cf. A000040 (primes), A007504 (sum of first n primes).
Sequence in context: A093575 A080166 A116872 * A283587 A283705 A284401
KEYWORD
nonn
AUTHOR
Ulrich Krug (leuchtfeuer37(AT)gmx.de), Jun 11 2009
EXTENSIONS
Edited by Klaus Brockhaus, Jun 12 2009
STATUS
approved