OFFSET
1,2
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
MAPLE
a[1] := 1:su := 1:for n from 2 to 112 do i := 1: if(isprime(n)) then i := i+1:fi:while(not isprime(i*n+su)) do i := i+1:od:a[n] := i*n:su := su+a[n]:od:seq(a[j], j=1..112);
MATHEMATICA
a[1]=s[1]=1; s[n_] := s[n]=s[n-1]+a[n]; a[n_] := a[n]=For[i=1, True, i++, If[ !PrimeQ[i*n]&&PrimeQ[s[n-1]+i*n], Return[i*n]]]
PROG
(PARI) first(L)=my(v=vector(L), s, k); s=v[1]=1; for(n=2, #v, k=n; while(isprime(k) || !isprime(s+k), k+=n); s+=k; v[n]=k); v \\ Charles R Greathouse IV, Apr 24 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Aug 11 2002
EXTENSIONS
Corrected and extended by Sascha Kurz, Jan 30 2003
STATUS
approved