Build a drug testing scheduler In this problem on Puzzling.SE, I ask a question about determining the amounts of drug to use in a clinical test to minimize total drug usage and fulfill the requirements of the testing procedure.
The problem is as follows, for those of you who currently don't have access to the private beta:

A medical researcher is trying to test the effect of a certain drug on mice. He is supposed to collect data for all doses from 1 to 2N units, but only has the data collection resources for N tests. He has decided to only test dose amounts that are not multiples or factors of each other (for example, if he decided to use a dose of 15 units for a specific test, that would preclude tests for 1, 3, 5, 30, 45, etc. units). Moreover, because the drug is relatively expensive, he wants to use as little of the drug as he can manage to run these tests.
How can he arrange the dosage amounts so that he ends up using all N test packages, and the total units of dosage used in the tests are as low as possible?

The original problem states N = 25. Your task is to build a program than can answer this question for any number of tests up to N = 2500.
Your program will take a number N from 1 to 2500 as input, and return a set of N integers between 1 and 2N inclusive such that none of the N numbers are multiples of each other, each number from 1 to 2N is a factor or multiple of at least one of the numbers in the set, and the sum of all the numbers in the set is as low as you can manage.
Your program must return a valid result for each value of N to be valid.
Your program will be scored by the sum of all the returned numbers for each scenario from N = 1 to N = 2500. In the event of a tie, the shorter solution will win.
Javascript 5,955,958,211

I'm not sure if it is the optimal solution.
I used a brute-force method.



function f(n) {
  var o=[];
  for(var i=n;i--;) o.push(2*n-i); //init array from n+1 to 2*n

  for(i=n;i&gt;0;i--) { //bruteforce on number from n to 1
    var index=0;
    var nbFactor=0;
    for(j=0;j&lt;n;j++) {
      if((o[j]/i)%1==0) {
        index=j;
        nbFactor++;
      }
    }
    if(nbFactor==1) { //if there is only 1 factor, replace it by the new number
      o[index]=i;
    }
  }
  return o.sort(function(a,b){return a-b;});
}


Golfed (130) :

function f(n){o=[];for(i=n;i++&lt;2*n;)o.push(i);for(i=n;i;i--){for(d=c=j=0;j&lt;n;j++)if((o[j]/i)%1==0)d=j,c++;if(c==1)o[d]=i}return o}


Here is the result found by my algorithm for 25 :  


  [8, 12, 14, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 29, 30, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49]


Little piece of code to compute the score (takes approx. 200 seconds on Chrome) :

var result=0;
var t = Date.now();
for(var j=1;j&lt;2501;j++) {
  result += f(j).reduce(function(r,e){return r+e;});
}
console.log("Score : " + result + "\nCompute time : " + ((Date.now()-t)/1000) + " seconds");