Math::N...equence(3)

πŸ“¦
version 75 Β· 2 versions
, in fedora 43

πŸ’– Math::N...equence(3) β€” bestie edition πŸ’–

okay so you found the Math::N...equence(3) page, which is the User Contributed Perl Documentation for Math::NumSeq::UlamSequence, and honestly? we're about to have the best time. grab a snack. πŸ“


✨ NAME ✨

Math::NumSeq::UlamSequence β€” integers that are uniquely the sum of two previous terms. no cap, that's the whole vibe. πŸ‘‘


🌸 SYNOPSIS 🌸

use Math::NumSeq::UlamSequence;
my $seq = Math::NumSeq::UlamSequence->new;
my ($i, $value) = $seq->next;

look at that. two lines and you're already slaying. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

Ulam sequences are integers that are the sum of two previous terms in just one way. like, exactly one way. not two. not three. one. πŸ’€

The default starting values are 1,2, which gives you:

1, 2, 3, 4, 6, 8, 11, 13, 16, 18, 26, ...

For example, 11 is in the sequence because it's the sum of two previous terms 3+8, and no other such sum. iconic behaviour. ✨

Whereas 12 is not in the sequence, because there's two sums: 4+8 and 1+11. two ways?? not today. not on our watch. the gate is CLOSED. πŸ™ˆ


πŸŽ€ FUNCTIONS πŸŽ€

See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence classes. (yes bestie, the family traits. iykyk.)

  • $seq = Math::NumSeq::UlamSequence->new () β€” create and return a new sequence object. that's it. that's the move. 🫢
  • $seq = Math::NumSeq::UlamSequence->new (start_values => '2,5') β€” same thing but you get to pick your own starting values, main character energy, your sequence your rules. 🌈

πŸ’œ SEE ALSO πŸ’œ

  • Math::NumSeq

🌟 HOME PAGE 🌟

<http://user42.tuxfamily.org/math-numseq/index.html>

go. click. stan. πŸ”₯


πŸ‘‘ LICENSE πŸ‘‘

Copyright 2010, 2011, 2012, 2013, 2014, 2016, 2019, 2020 Kevin Ryde

Math-NumSeq is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

Math-NumSeq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Math-NumSeq. If not, see <http://www.gnu.org/licenses/>.

real talk: free software, no warranty, read the license, that part is not a vibe, that part is a legally binding vibe. πŸ’€

and that's the whole page, bestie. this was perl v5.42.0, dated 2025-07-25, filed under Math::N...equence(3), and you absolutely ate. periodt. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from