Opened 6 years ago

Closed 6 years ago

#20025 closed defect (fixed)

is_prime_power fails on powers of 30011

Reported by: jpflori Owned by:
Priority: critical Milestone: sage-7.1
Component: basic arithmetic Keywords:
Cc: vdelecroix Merged in:
Authors: Jeroen Demeyer Reviewers: Jean-Pierre Flori
Report Upstream: Fixed upstream, but not in a stable release. Work issues:
Branch: 9c5d20c (Commits, GitHub, GitLab) Commit: 9c5d20c2e9a44f8503bca15dc64f04453929a552
Dependencies: Stopgaps:

Status badges

Description (last modified by jdemeyer)

Playing with finite fields on Sage 6.10 or 7.0:

GF(30011**(19*3), name='z')
...
ValueError: the order of a finite field must be a prime power

Apparently is_prime_power returns False for that cardinality.

PARI bug report: http://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=1782

Tarball: http://sage.ugent.be/www/jdemeyer/sage/pari-2.8-2341-g61b65cc.tar.gz

Change History (19)

comment:1 Changed 6 years ago by ncohen

:-P

sage: print [i for i in range(1,100) if not is_prime_power(30011**i)]
[22, 26, 33, 34, 38, 39, 44, 46, 51, 52, 55, 57, 58, 62, 65, 66, 68, 69, 74, 76, 77, 78, 82, 85, 86, 87, 88, 91, 92, 93, 94, 95, 99]

comment:2 Changed 6 years ago by jpflori

Thanks, I was building the latest beta to see if the PARI update changed anything (though I could not say at this point if PARI is involved). It seems its not the case.

comment:3 Changed 6 years ago by ncohen

Funny

sage: set([p for i in range(1,100) for p in primes(200000) if not is_prime_power(p**i)])
{30011}
Last edited 6 years ago by ncohen (previous) (diff)

comment:4 Changed 6 years ago by jpflori

So it is an issue in the PARI versions we ship (at least the one in 7.0):

? isprimepower(30011^(17*3))
OddPwrs: examining 758-bit integer
OddPwrs: examining 252-bit integer

OddPwrs: not a power
Z_isanypower: now k=3, x=252-bit

OddPwrs: [17] passed modular checks
%1 = 0

comment:5 Changed 6 years ago by jpflori

I attempted to send a bug report upstream. If it appears on their bugtracker, I'll report here.

comment:6 Changed 6 years ago by jpflori

  • Report Upstream changed from N/A to Reported upstream. No feedback yet.

comment:7 Changed 6 years ago by jpflori

  • Description modified (diff)

comment:8 Changed 6 years ago by jdemeyer

I tried all primes up to 106 and still only 30011 fails.

comment:9 Changed 6 years ago by jpflori

  • Report Upstream changed from Reported upstream. No feedback yet. to Fixed upstream, but not in a stable release.

Fixed in master according to Karim, though he did not push the commit yet :)

comment:10 Changed 6 years ago by jdemeyer

Let's me know when it's fixed in PARI master, then I can make a package.

comment:12 Changed 6 years ago by jdemeyer

  • Authors set to Jeroen Demeyer
  • Summary changed from is_prime_power fails on some inputs to is_prime_power fails on powers of 30011

comment:13 Changed 6 years ago by jdemeyer

  • Description modified (diff)

comment:14 Changed 6 years ago by jdemeyer

  • Branch set to u/jdemeyer/is_prime_power_fails_on_some_inputs

comment:15 Changed 6 years ago by jdemeyer

  • Commit set to ddf018bf6ade9ddc4bd2fcf0e0345e2ff8a783ec
  • Status changed from new to needs_review

I did not yet run full doctests, but otherwise this seems to work.


New commits:

ddf018bUpgrade PARI to latest master

comment:16 Changed 6 years ago by git

  • Commit changed from ddf018bf6ade9ddc4bd2fcf0e0345e2ff8a783ec to 9c5d20c2e9a44f8503bca15dc64f04453929a552

Branch pushed to git repo; I updated commit sha1. New commits:

9c5d20cFix gamma_inc doctest

comment:17 Changed 6 years ago by jdemeyer

Doctests pass now.

comment:18 Changed 6 years ago by jpflori

  • Reviewers set to Jean-Pierre Flori
  • Status changed from needs_review to positive_review

Thanks, looks ok.

comment:19 Changed 6 years ago by vbraun

  • Branch changed from u/jdemeyer/is_prime_power_fails_on_some_inputs to 9c5d20c2e9a44f8503bca15dc64f04453929a552
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.