askinteger/featurep(...,integer) is very weak.
makelist(featurep(q,'integer),
[(-1)^ii, ii*(ii+1)/2, sin(ii*%pi/2), ii+1/2, %pi*ii,
sin(ii), log(ii), %e^ii, %i*%pi])
=> [false, false, false, false, false,
false, false, false, false]
~~~
``askinteger`` is equally weak.
This is OK:
(%i2) featurep(%i*%pi,'integer);
(%o2) false
Maybe askinteger should check the imagpart of the expression and say "no" when it's certain to be non-zero.
askinteger is extremely weak. With declare(ii,integer)$ ,
it doesn't know that all of the following are always integer-valued:
(-1)^ii
ii*(ii+1)/2
sin(ii*%pi/2)
and that the following are never integer-valued:
ii+1/2
%pi*ii
sin(ii)
log(ii)
%e^ii
All of these seem much more likely to arise "in the wild" and be useful to
users than the %i*%pi case. I have generalized
https://sourceforge.net/p/maxima/bugs/4605/ to include them.
On Wed, Sep 3, 2025 at 1:26 PM David Scherfgen via Maxima-bugs maxima-bugs@lists.sourceforge.net wrote:
Related
Bugs: #4605
Diff: