Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public BigInteger iterativeF(int n) {
- BigInteger a = BigInteger.ONE;
- BigInteger b = BigInteger.ZERO;
- for (int i = 0; i < n; i++) {
- b = b.add(a);
- a = b.subtract(a);
- }
- return b;
- }
- public BigInteger sumOfOperations(BigInteger lastFiboNumber) {
- return BigInteger.ONE.add(lastFiboNumber).divide(BigInteger.TWO).multiply(BigInteger.valueOf(5));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement