Math::N...bstinate(3)

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

πŸ’– 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 $value is obstinate, meaning there's no $k >= 0 for which $value - 2**$k is 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 of 2**32 on the $value you 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::NumSeq
  • Math::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