---
# System prepended metadata

title: Untitled

---

```javascript=

// alt_ones
const alt_ones0 = pair(1, () => stream_map(x => -x , alt_ones0));
const alt_ones1 = pair(1, () => pair(-1, () => alt_ones1));
const alt_ones2 = pair(1, () => scale_stream(-1, alt_ones2));
const alt_ones3 = pair(1,
                    () => pair(-1,
                            () => mul_streams(alt_ones3,
                            stream_tail(alt_ones3))));
const alt_ones4 = pair(1, () => pair(-1, () => alt_ones4));

const alt_ones5 = pair(1, () => stream_map(x => -x, alt_ones5));
const alt_ones6 = pair(1, () => stream_map(x => -x, alt_ones6));
//7th soln: create a stream of 1, 1, 1...
// and use negate series to create -1, -1, -1...
// use merge stream from path to combine the 2 streams

    


// zeroes

function add_consecutive(s1) {
    return pair(head(s1) + head(stream_tail(s1)),
            () => add_consecutive(stream_tail(s1)));
}
const zeros1 = add_streams(alt_ones, stream_tail(alt_ones));
const zeros2 = add_consecutive(alt_ones); 
const zeros3 = scale_stream(0, alt_ones);

const zeros = pair(0, () => zeros);
const zeros4 = add_streams(alt_ones, negate_series(alt_ones));

//s1

const Stream1 = stream_map(x => 1, non_neg_integers);
const s1 = pair(1, () => s1);

//s2
function s2(){
    function help(k){
        return pair(k, () => help(k + 1));
    }
    return help(1);
}
const Stream2 = stream_map(x => x + 1, non_neg_integers);
const s2 = integers_from(1);






```
