Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is_squarefree #23577

Open
roed314 opened this issue Aug 3, 2017 · 0 comments
Open

is_squarefree #23577

roed314 opened this issue Aug 3, 2017 · 0 comments

Comments

@roed314
Copy link
Contributor

roed314 commented Aug 3, 2017

sage: is_squarefree(6/1)
True
sage: is_squarefree(12/1)
False
sage: is_squarefree(2/3)
False
sage: (2/3).is_squarefree()
Traceback (most recent call last):
...
AttributeError: 'sage.rings.rational.Rational' object has no attribute 'is_squarefree'

The implementation of the global is_squarefree method eventually uses return all(r[1] == 1 for r in factor(n)). A more mathematically sensible definition is that x is squarefree if and only if it is not divisible by the square of any non-unit. For fields, this means that 0 is not squarefree and everything else is squarefree.

Of course, this can be confusing for beginners who now have to deal with (4/1).is_squarefree() returning True.

See also #23510.

CC: @saraedum @xcaruso @kedlaya @sagetrac-alina

Component: basic arithmetic

Issue created by migration from https://trac.sagemath.org/ticket/23577

@roed314 roed314 added this to the sage-8.1 milestone Aug 3, 2017
@mkoeppe mkoeppe removed this from the sage-8.1 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants