void generate_vietoris_sequence(sequence& a) { if (a.empty()) return; a[0] = 1; if (a.size() < 2) return; a[1] = .5; for (int k = 2; k < a.size(); k++) { a[k] = a[k - 1] * (k - 1) / k; } }
void generate_vietoris_sequence(sequence& a) { if (a.empty()) return; a[0] = rdm(0, MAX_VAL); if (a.size() < 2) return; a[1] = rdm(0, a[0]); for (int k = 2; k < a.size(); k++) { a[k] = rdm(0, (1.0 * k - 1) / k) * a[k - 1]; } }