Math::N...bstinate(3)
π Math::N...bstinate(3) π
okay so bestie, we're reading the User Contributed Perl Documentation for Math::NumSeq::PolignacObstinate and honestly? it's giving niche math baddie energy and I am obsessed. pull up a chair, we're doing number theory πΈ
β¨ NAME β¨
Math::NumSeq::PolignacObstinate β odd integers that are not prime+2^k π¦
β¨ SYNOPSIS β¨
use Math::NumSeq::PolignacObstinate;
my $seq = Math::NumSeq::PolignacObstinate->new;
my ($i, $value) = $seq->next;
literally three lines and you're in, no cap π
β¨ DESCRIPTION β¨
so this sequence is integers that cannot be written as prime+2^k, for an integer k. and likeβ¦ they're the counter-examples to a conjecture by Prince de Polignac that every odd integer shows up as prime+2^k. Andy Edwards calls them "obstinate" numbers because they simply will not cooperate π iconic behaviour honestly.
1, 127, 149, 251, 331, 337, ...
for example, 149 is obstinate because there's no way to write it as prime+2^k. working backwards, you can see that none of 149-1, 149-2, 149-4, 149-8, ... 149-128 are primes. she checked every single one and said nope π
a theorem by Erdos says there are infinitely many such obstinate integers (in an arithmetic progression). infinite obstinacy. main character energy fr fr π
and btw 3 is not in the sequence, because it can be written prime+2^k β with prime=2 and k=0. so sorry to 3, she's just not obstinate, she's cooperative π
β¨ FUNCTIONS β¨
peep "FUNCTIONS" in Math::NumSeq for the behaviour that's common to all the sequence classes, bestie.
$seq = Math::NumSeq::PolignacObstinate->new ()β creates and returns a brand new sequence object β¨$bool = $seq->pred($value)β returns true if$valueis obstinate, meaning there's no$k >= 0for which$value - 2**$kis a prime.
okay important tea π«: this check needs prime testing all the way up to$value, and in the current code there's a hard limit of2**32on the$valueyou can check. why? because they're in the interests of not going into a near-infinite loop. so do not come for this function with a giant number unless you want to be there forever π
β¨ SEE ALSO β¨
Math::NumSeqMath::NumSeq::Primes- Clifford Pickover, "The Grand Internet Obstinate Number Search"
<http://sprott.physics.wisc.edu/pickover/obstinate.html>
β¨ 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/>.
and that's the whole page bestie π«Ά this was perl v5.42.0, dated 2025-07-25, from the Math::N...bstinate(3) files, mwah π go be obstinate, stan Erdos, and remember: not every odd integer wants to be prime+2^k and that's her prerogative πβ
π¦ where this page comes from
- fedora 43: perl-Math-NumSeq 75-11.fc43 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms