Math-MatrixLUP
view release on metacpan or search on metacpan
examples/faulhaber_coefficients.pl view on Meta::CPAN
#!/usr/bin/perl
# Compute the Faulhaber triangle of coffiecients.
# See also:
# https://en.wikipedia.org/wiki/Faulhaber's_formula
# https://en.wikipedia.org/wiki/Vandermonde_matrix
use 5.014;
use lib qw(../lib);
use experimental qw(signatures);
use Math::MatrixLUP;
use Math::AnyNum qw(:overload ipow);
sub faulhaber_coefficients ($n) {
examples/fibonacci_of_k-th_order.pl view on Meta::CPAN
#!/usr/bin/perl
# General formula for computing the k-th order Fibonacci numbers, using exponentation by squaring.
# OEIS sequences:
# https://oeis.org/A000045 (2-nd order: Fibonacci numbers)
# https://oeis.org/A000073 (3-rd order: Tribonacci numbers)
# https://oeis.org/A000078 (4-th order: Tetranacci numbers)
# https://oeis.org/A001591 (5-th order: Pentanacci numbers)
# See also:
# https://en.wikipedia.org/wiki/Generalizations_of_Fibonacci_numbers
# https://en.wikipedia.org/wiki/Exponentiation_by_squaring
( run in 0.491 second using v1.01-cache-2.11-cpan-26ccb49234f )