Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F104816150
untitled0-checkpoint.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Mar 12, 15:26
Size
549 B
Mime Type
text/x-python
Expires
Fri, Mar 14, 15:26 (2 d)
Engine
blob
Format
Raw Data
Handle
24846808
Attached To
rJNAL Jupyter notebooks for Linear Algebra
untitled0-checkpoint.py
View Options
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 4 16:26:30 2019
@author: jecker
"""
from
bokeh.plotting
import
figure
,
output_file
,
show
def
syracuse
(
N
):
suite
=
[
N
]
i
=
0
ind
=
[
i
]
while
N
!=
1
:
i
+=
1
ind
.
append
(
i
)
if
N
%
2
==
0
:
N
=
N
/
2
else
:
N
=
3
*
N
+
1
suite
.
append
(
N
)
return
(
suite
,
ind
)
suite
,
ind
=
syracuse
(
121
)
p
=
figure
(
plot_width
=
400
,
plot_height
=
400
)
p
.
line
(
ind
,
suite
,
line_width
=
2
)
#p.circle(ind, suite, fill_color="white", size=8)
show
(
p
)
Event Timeline
Log In to Comment