while ($dd < $b2) {
$dd++;
$b1 *=2;
$n=$b1*3;
$total = $b1;
$total1 = $n;
}
let blueCount = 1, redCount = 0;
for (let i = 0; i < n; ++i) {
const nextBlueCount = blueCount * 2 + redCount * 3;
redCount = blueCount * 3 + redCount * 5;
blueCount = nextBlueCount;
}
let blueCount = 1, redCount = 0;
for (let i = 0; i < n; ++i) {
const nextBlueCount = blueCount * 2 + redCount * 3;
redCount = blueCount * 3 + redCount * 5;
blueCount = nextBlueCount;
}