FUNCTION
Padovan_Numbers_List
Calculates the Padovan numbers of orders 0 through \e n.
Interface
#include <codecogs/maths/combinatorics/sequences/padovan_numbers_list.h>
using namespace Maths::Combinatorics::Sequences;
This function generates an array of Padovan numbers of orders 0 through n. The Padovan sequence is defined by the following recurrent formula:
(1)
with initial values
(2)
Example 1
#include <codecogs/maths/combinatorics/sequences/padovan_numbers_list.h>
#include <iostream>
int main() {
std::vector<int> result = Maths::Combinatorics::Sequences::padovan_numbers_list(11);
std::cout << "Number of values: " << result.size() << std::endl;
for (int i = 0; i < result.size(); i++)
std::cout << result[i] << " ";
std::cout << std::endl;
return 0;
}Output:
Number of values: 11
1 1 1 2 2 3 4 5 7 9 12Returns
the Padovan numbers of order 0 through n
References
SUBSET, a C++ library of combinatorial routines, http://www.csit.fsu.edu/~burkardt/cpp\_src/subset/subset.html
This function's source code is only visible to registered users — documentation and the calculator above are free to use either way. Sign in to see it.