Opened 6 years ago

Last modified 3 years ago

#15497 new defect

Make lcm() symbolic

Reported by: ppurka Owned by:
Priority: major Milestone: sage-6.4
Component: symbolics Keywords:
Cc: kcrisman, kbaut, jakobkroeker Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps: todo

Description

From google spreadsheet which no one reads X-(

sage: sum(lcm(10,x), x, 1, 10)  # Incorrect
550

sage: sum([lcm(10,i) for i in xrange(1,11)])  # Correct
320

Change History (10)

comment:1 Changed 6 years ago by kcrisman

  • Cc kcrisman added

comment:2 Changed 6 years ago by kcrisman

Here is the problem, presumably (lcm not being symbolic in this way):

sage: lcm(10,x)
10*x

We can all be Gauss with this.

sage: sum(lcm(1,x),x,1,100)
5050

The solution is to make sure that lcm(a,b) does something symbolic, or throws an error, when we feed it symbolic entries. Is there already a ticket for this, perhaps?

comment:3 Changed 6 years ago by jdemeyer

  • Summary changed from sum(lcm(10, i), i, 1, 10) gives incorrect answer to Make lcm() symbolic

comment:4 Changed 6 years ago by jdemeyer

  • Component changed from calculus to symbolics

comment:5 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:6 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:7 Changed 5 years ago by kcrisman

  • Cc kbaut added

comment:8 Changed 5 years ago by kcrisman

See also #16721.

comment:9 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:10 Changed 3 years ago by jakobkroeker

  • Cc jakobkroeker added
Note: See TracTickets for help on using tickets.