First time here? Check out the FAQ!

Ask Your Question
1

n*1/n^2 for n = 1,2,3,50.

asked 1 year ago

Learner2023 gravatar image

new to sage math trying to practice and need some help generating a list for 1/n^2 where n = 1,2,3,...50 any help is appreciated

Preview: (hide)

Comments

List comprehension:

[1/n^2 for n in [1..50]]
dan_fulea gravatar imagedan_fulea ( 1 year ago )

1 Answer

Sort by » oldest newest most voted
2

answered 1 year ago

tolga gravatar image

updated 1 year ago

Please check this:

v=[1/n^2 for n in range(1,51)]
print(v)
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 1 year ago

Seen: 254 times

Last updated: Sep 10 '23