<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>checks</title>
</head>
<body>
<div id="block">
</div>
</body>
<script>
// Тут просто генерируем 50 чекбоксов
let s = '';
let n = 50;
for (let i=0; i<n; i++) s+=`${i}: <input type='checkbox' name='check'><br>`;
document.getElementById('block').innerHTML = s;
</script>
<script>
(function () {
const checkbox = document.querySelectorAll("INPUT[type=checkbox]");
const length = checkbox.length;
// 10 отметить, 20 пропустить, 10 отметить, 7 пропустить, 2 отметить
let chsk = [10, 20, 10, 7, 2];
let n = chsk.shift();
for (let i = 0; i < length; ) {
if(n--) checkbox[i++].checked = true;
else if(chsk.length > 1){
i += chsk.shift();
n = chsk.shift();
}
else break;
}
})();
</script>
</html>