Platform
Resources
Pricing
Sign in
Contact us
Nat Alison
I am a very very creative app but it seems to have work hard and it doesn't even open. (written using predictive text)
Workspace
Fork
Public
By
Nat Alison
Edited
Jun 23, 2023
Insert cell
Insert cell
function
gcd
(
a
,
b
)
{
let
t
;
while
(
b
!==
0
)
{
t
=
b
;
b
=
a
%
b
;
a
=
t
;
}
return
a
;
}
Insert cell
function
*
alternating
(
)
{
let
n
=
4
;
let
order
=
24n
;
while
(
true
)
{
yield
{
n
,
order
}
;
n
++
;
order
*=
BigInt
(
n
)
;
}
}
Insert cell
[
...
takeWhile
(
suzuki_B2
(
)
,
(
n
)
=>
n
.
order
<
10n
**
53n
)
]
Insert cell
function
suzuki_B2
(
)
{
return
mapIter
(
naturals
(
1
)
,
(
n
)
=>
{
let
q
=
BigInt
(
2
**
(
2
*
n
+
1
)
)
;
return
{
q
,
order
:
q
**
2n
*
(
q
**
2n
+
1n
)
*
(
q
-
1n
)
}
;
}
)
;
}
Insert cell
function
ree_F4
(
)
{
return
mapIter
(
naturals
(
1
)
,
(
n
)
=>
{
let
q
=
BigInt
(
2
**
(
2
*
n
+
1
)
)
;
return
{
q
,
order
:
q
**
12n
*
(
q
**
6n
+
1n
)
*
(
q
**
4n
-
1n
)
*
(
q
**
3n
+
1n
)
*
(
q
-
1n
)
}
;
}
)
;
}
Insert cell
function
ree_G2
(
)
{
return
mapIter
(
naturals
(
1
)
,
(
n
)
=>
{
let
q
=
BigInt
(
3
**
(
2
*
n
+
1
)
)
;
return
{
q
,
order
:
q
**
3n
*
(
q
**
3n
+
1n
)
*
(
q
-
1n
)
}
;
}
)
;
}
Insert cell
function
*
powers
(
n
)
{
n
=
BigInt
(
n
)
;
let
total
=
n
;
while
(
true
)
{
yield
total
;
total
*=
n
;
}
}
Insert cell
function
*
naturals
(
start
)
{
let
n
=
start
;
while
(
true
)
{
yield
n
;
n
++
;
}
}
Insert cell
function
*
mapIter
(
generator
,
predicate
)
{
for
(
let
item
of
generator
)
{
yield
predicate
(
item
)
;
}
}
Insert cell
function
*
takeWhile
(
generator
,
pred
)
{
while
(
true
)
{
const
next
=
generator
.
next
(
)
.
value
;
if
(
!
pred
(
next
)
)
{
break
;
}
yield
next
;
}
}
Insert cell
import
{
primes
}
from
"@mourner/fast-prime-generator"
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
gcd
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
alternating
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
suzuki_B2
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
ree_F4
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
ree_G2
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
powers
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
naturals
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
mapIter
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
takeWhile
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML