1, 3, 7, 12, 18, ...Sequence $S$ starts:
2, 4, 5, 6, 8, ...
ffr
and ffs
that when given n
return R(n)
or S(n)
respectively. (Note that R(1) = 1 and S(1) = 2 to avoid off-by-one errors).
No maximum value for n
should be assumed.
References
ffr
should be a function.
testString: assert(typeof ffr === 'function');
- text: ffs
should be a function.
testString: assert(typeof ffs === 'function');
- text: ffr
should return integer.
testString: assert(Number.isInteger(ffr(1)));
- text: ffs
should return integer.
testString: assert(Number.isInteger(ffs(1)));
- text: ffr(10)
should return 69
testString: assert.equal(ffr(ffrParamRes[0][0]), ffrParamRes[0][1]);
- text: ffr(50)
should return 1509
testString: assert.equal(ffr(ffrParamRes[1][0]), ffrParamRes[1][1]);
- text: ffr(100)
should return 5764
testString: assert.equal(ffr(ffrParamRes[2][0]), ffrParamRes[2][1]);
- text: ffr(1000)
should return 526334
testString: assert.equal(ffr(ffrParamRes[3][0]), ffrParamRes[3][1]);
- text: ffs(10)
should return 14
testString: assert.equal(ffs(ffsParamRes[0][0]), ffsParamRes[0][1]);
- text: ffs(50)
should return 59
testString: assert.equal(ffs(ffsParamRes[1][0]), ffsParamRes[1][1]);
- text: ffs(100)
should return 112
testString: assert.equal(ffs(ffsParamRes[2][0]), ffsParamRes[2][1]);
- text: ffs(1000)
should return 1041
testString: assert.equal(ffs(ffsParamRes[3][0]), ffsParamRes[3][1]);
```