[go: up one dir, main page]

login
A073669
a(1) = 1, a(n) = the smallest composite multiple of n such that every partial sum is prime.
2
1, 4, 6, 8, 10, 12, 42, 24, 72, 20, 132, 36, 52, 14, 30, 16, 68, 54, 76, 80, 126, 88, 92, 24, 100, 26, 108, 112, 116, 30, 310, 128, 66, 204, 70, 36, 74, 76, 78, 120, 902, 84, 430, 44, 360, 460, 188, 240, 294, 100, 204, 104, 106, 54, 110, 280, 342, 116, 708, 60, 244, 62
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
Sequence in context: A096160 A181055 A225506 * A073670 A090169 A190330
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Aug 11 2002
EXTENSIONS
Corrected and extended by Sascha Kurz, Jan 30 2003
STATUS
approved