Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F62673156
untitled0.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
Tue, May 14, 19:00
Size
549 B
Mime Type
text/x-python
Expires
Thu, May 16, 19:00 (2 d)
Engine
blob
Format
Raw Data
Handle
17536979
Attached To
rJNAL Jupyter notebooks for Linear Algebra
untitled0.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