OFFSET
2,1
COMMENTS
The sequence is monotonic for its first million terms. Does there exist n with a(n) < a(n-1)? [Charles R Greathouse IV, Aug 24 2011]
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 2..10000
EXAMPLE
a(2) = 9 because 9 = 2+7=9 = 3*3;
a(3) = 10 because 10 = 2+3+5 = 2*5;
a(4) = 21 because 21 = 2+3+5+11 = 3*7.
PROG
(PARI) issemi(n)=bigomega(n)==2
a(n)={
my(v=primes(n+3), s=sum(i=1, n+1, v[i]), m, t, t1);
m=s+v[n+2]-5;
forstep(i=n+1, 1, -1,
t=s-v[i];
if(t >= m, break);
if(issemi(t), return(t))
);
s+=v[n+2];
m=s+v[n+3]-10;
for(i=2, n+2,
t=s-v[i];
for(j=1, i-1,
t1=t-v[j];
if(t1 >= m, break);
if(issemi(t1), m=t1)
)
);
if(issemi(m), return(m));
error("could not find a("n")")
}; \\ Charles R Greathouse IV, Aug 24 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
Giovanni Teofilatto, Apr 21 2005
EXTENSIONS
a(6) corrected, a(7)-a(50) by Charles R Greathouse IV, Aug 24 2011
STATUS
approved