OEIS

 view release on metacpan or  search on metacpan

lib/OEIS/A000045.pm  view on Meta::CPAN

package OEIS::A000045;

use 5.032;

use strict;
use warnings;
no  warnings 'syntax';

use experimental 'signatures';

our $VERSION = '2021041201';

my $values;

sub new  ($class) {bless do {\my $v} => $class}
sub init ($self, $initial_values) {
    @$values = @$initial_values;
    $self
}

sub oeis ($self, $to) {
    use bigint;
    $$values [0] //= 0;
    $$values [1] //= 1;
    for (my $i = @$values; $i < $to; $i ++) {
        $$values [$i] = $$values [$i - 1] + $$values [$i - 2];
    }
    @$values;
}


1;

__END__

=head1 NAME

OEIS::A000045 - Calculate Fibonacci numbers.

=head1 SYNOPSIS

use OEIS;
my @list = oeis (A000045 => 50);

=head1 DESCRIPTION

This module is used to calculate Fibonacci numbers which are not
listed at the OEIS. 

This module should not be called directly -- use C<< OEIS >> itself.
This will call C<< OEIS::A00045 >> when needed.

=head1 BUGS

=head1 TODO

=head1 SEE ALSO

L<< Fibonacci numbers|https://oeis.org/A000045 >>

=head1 DEVELOPMENT

The current sources of this module are found on github,
L<< git://github.com/Abigail/OEIS.git >>.

=head1 AUTHOR

Abigail, L<< mailto:cpan-oeis@abigail.freedom.nl >>.

=head1 COPYRIGHT and LICENSE

Copyright (C) 2021 by Abigail.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),   

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.378 second using v1.00-cache-2.02-grep-82fe00e-cpan-f5108d614456 )