Ask Your Question
0

Can you help me with digits of pi?

asked 2017-11-13 13:22:11 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

I want to put the first n digits of pi into a list. I have tried numerical approximation but I was not able to figure out if it could help me .Neither did I find a function for it.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-11-14 04:14:12 -0600

At least there is the following workaround

sage: map(ZZ, pi.n(digits=20).str()[2:])
[1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8, 9, 7, 9, 3, 2, 3, 8, 4, 6, 2, 0]

If you want more digits, just increase 20 to something else.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2017-11-13 13:22:11 -0600

Seen: 34 times

Last updated: Nov 14