In Mathematics several well-known sequences exist, like Fibonacci, Square numbers sequence, etc. One such sequence is Jacobsthal, which states that:
Jacobsthal(n)\ =\ \left\{\begin{matrix}0&n\ =\ 0\\1&n\ =\ 1\\2Jacobsthal(n-2)\ +\ Jacobsthal(n-1)&n\ \geq\ 2\\\end{matrix}\right.Another way to calculate the Jacobsthal number without using recursion on the Jacobsthal equation, is to use the Binet formula [4][5]:
Jacobsthal(m)=\frac{2^m-{(-1)}^m}{3}Using any of the forumalas above to generate the first 50 numbers in the sequence, the output is:
0, 1, 1, 3, 5, 11, 21, 43, 85, 171, 341, 683, 1365, 2731, 5461, 10923, 21845, 43691, 87381, 174763, 349525, 699051, 1398101, 2796203, 5592405, 11184811, 22369621, 44739243, 89478485, 178956971, 357913941, 715827883, 1431655765, 2863311531, 5726623061, 11453246123, 22906492245, 45812984491, 91625968981, 183251937963, 366503875925, 733007751851, 1466015503701, 2932031007403, 5864062014805, 11728124029611, 23456248059221, 46912496118443, 93824992236885, 187649984473771
References:
- Wikipedia contributors, “Jacobsthal number,” Wikipedia, The Free Encyclopedia,https://en.wikipedia.org/w/index.php?title=Jacobsthal_number&oldid=849904767 (accessed March 19, 2019).
- Weisstein, Eric W. “Jacobsthal Number.” From MathWorld–A Wolfram Web Resource. http://mathworld.wolfram.com/JacobsthalNumber.html (accessed March 19, 2019).
- Frey, Darrin D., and James A. Sellers. “Jacobsthal Numbers and Alternating Sign Matrices.” Journal of Integer Sequences 3 (2000). https://cs.uwaterloo.ca/journals/JIS/VOL3/SELLERS/sellers.pdf. (accessed March 19, 2019)
- Rabago, Julius Fergy. “A Note on Modified Jacobsthal and Jacobstal-Lucas Numbers.” Notes on Number Theory and Discrete Mathematics 19, no. 3 (2013): 15–20. http://nntdm.net/papers/nntdm-19/NNTDM-19-3-15-20.pdf. (accessed March 19, 2019)
- Szynal-Liana, Anetta and Włoch, Iwona. “A Note on Jacobsthal Quaternions.” Advances in Applied Clifford Algebra 26 (2016): 441–447. https://core.ac.uk/download/pdf/81813252.pdf. (accessed March 26, 2019)