CodeCogs - An iteractive open source Numerical library Welcome... Login
CodeCogs
shopping cart
OSXWindowsLinux
Search CodeCogs
Numerical Components

Valid RSS

MathsCombinatoricsSequences

Padovan Numbers List

Available under GPL (Free) and Commercial licence
get a GPL licence
COST (GBP)
this unit 0.21
sub units 0.00
add a commercial licence to your cart
0
viewed 1362 times and licensed 2 times

Calculates the Padovan numbers of orders 0 through \e n.

Controller: CodeCogs  Contact Controller
+View version details
Contents hide toc
buy now     get GPL     add to cart

Interface

#include <codecogs/maths/combinatorics/sequences/padovan_numbers_list.h>

using namespace Maths::Combinatorics::Sequences;

std::vector<int> padovan_numbers_list (int n)
Calculates the Padovan numbers of orders 0 through n.

Function Documentation

 
std::vector<int>padovan_numbers_listintn )
This function generates an array of Padovan numbers of orders 0 through n. The Padovan sequence is defined by the following recurrent formula:

P(i+1) = P(i-1) + P(i-2)

with initial values

P(0) = P(1) = P(2) = 1
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  12
References:
SUBSET, a C++ library of combinatorial routines, http://www.csit.fsu.edu/~burkardt/cpp_src/subset/subset.html
Returns:
the Padovan numbers of order 0 through n
Authors:
Lucian Bentea (August 2005)
Source Code:

To view or download source code you need either a GPL or Commercial Licence.

buy now     get GPL     add to cart

Not a member, then Register with CodeCogs. Already a Member, then Login.


Page Comments

Format Excel Equations

  You must login to leave a messge


Last Modified: 16 Nov 07 @ 08:45     Page Rendered: 2010-03-15 04:52:14

Valid CSS!   Valid XHTML 1.0 Transitional