0

First run the function b(n):

? b(n) = lcm(vector(n, i, i))/n

After function c(n):

? c(n)=sum(j=1,n,sum(i=1,n,(-1)^(i+j)/(i+j-1)))

Last run d(n):

? d(n)=factor(denominator(c(n))/b(n))~

and test with 202

? d(202)

The result is:

%8 =
[3 7 17 19 31 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 
307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401]

[1 1 1 1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]

What indicates the -1 in factoring results?

Uwe Allner
  • 3,399
  • 9
  • 35
  • 49

1 Answers1

2

You try to factor the rational number. Note, type(denominator(c(202))/b(202)) is t_FRAC instead of t_INT because of denominator(c(202))/b(202) = <some big number>/31. So -1 means just -1 power for divisor 31, and no bug is here.

Piotr Semenov
  • 1,761
  • 16
  • 24