unix - Checking if a returned number is an integer in GP/Pari? -


this first time using gp/pari , having trouble completing question.

i asked print if return of function 'wq()' integer. there function can determine if number passed in integer? if not how go checking? find syntax difficult , can't find information online it.

i have included have far, appreciated.

wq(x) = {     [(x-1)! + 1]/x }  test(r,s) = {     (i=r, s, if(isinteger(wq(i)), print("integer"), print("not interger"))); } 

if understand correctly want check if (x-1)! + 1 multiple of x. can modulo operation:

test(r,s) = {     (i=r, s, if(mod((i - 1)! + 1, i) == 0,           print("integer"),           print("not integer"))); } 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -