Here you will find daily news and tutorials about R, contributed by over 750 bloggers.
There are many ways to follow us - By e-mail:On Facebook: If you are an R blogger yourself you are invited to add your own R content feed to this site (Non-English R bloggers should add themselves- here)

Following the presentation of the first Le Monde puzzle of the year, I tried a simulated annealing solution on an early morning in my hotel room. Here is the R code, which is unfortunately too rudimentary and too slow to be able to tackle n=1000.

#minimise sum_{i=1}^I x_i
#for 1le x_ile 2n+1, 1e ile I
# Ige n, x_i ne x_j
# a=x_i,b=x_j,i,jin I implies a+b=x_k for a kin I
n=6
m=2*n+1
complete=function(inde){
len=length(inde)
comp=outer(inde,inde,"+")
diag(comp)=inde
comp=sort(unique(comp[complen)&&(length(comp)n){
off=sample(ind,1,prob=ind)
newinde=sort(ind[ind!=off])
newinde=complete(newinde)
if (tempe*log(runif(1))

The solution to the puzzle (given in the next Le Monde issue) is to take only the even digits, resulting in a minimum sum equal to n(n+1).