Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
30
Task/Yellowstone-sequence/11l/yellowstone-sequence-1.11l
Normal file
30
Task/Yellowstone-sequence/11l/yellowstone-sequence-1.11l
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
T YellowstoneGenerator
|
||||
min_ = 1
|
||||
n_ = 0
|
||||
n1_ = 0
|
||||
n2_ = 0
|
||||
Set[Int] sequence_
|
||||
|
||||
F next()
|
||||
.n2_ = .n1_
|
||||
.n1_ = .n_
|
||||
I .n_ < 3
|
||||
.n_++
|
||||
E
|
||||
.n_ = .min_
|
||||
L !(.n_ !C .sequence_ & gcd(.n1_, .n_) == 1 & gcd(.n2_, .n_) > 1)
|
||||
.n_++
|
||||
.sequence_.add(.n_)
|
||||
L
|
||||
I .min_ !C .sequence_
|
||||
L.break
|
||||
.sequence_.remove(.min_)
|
||||
.min_++
|
||||
R .n_
|
||||
|
||||
print(‘First 30 Yellowstone numbers:’)
|
||||
V ygen = YellowstoneGenerator()
|
||||
print(ygen.next(), end' ‘’)
|
||||
L(i) 1 .< 30
|
||||
print(‘ ’ygen.next(), end' ‘’)
|
||||
print()
|
||||
13
Task/Yellowstone-sequence/11l/yellowstone-sequence-2.11l
Normal file
13
Task/Yellowstone-sequence/11l/yellowstone-sequence-2.11l
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
F yellow(n)
|
||||
V a = [1, 2, 3]
|
||||
V b = Set([1, 2, 3])
|
||||
V i = 4
|
||||
L n > a.len
|
||||
I i !C b & gcd(i, a.last) == 1 & gcd(i, a[(len)-2]) > 1
|
||||
a.append(i)
|
||||
b.add(i)
|
||||
i = 4
|
||||
i++
|
||||
R a
|
||||
|
||||
print(yellow(30))
|
||||
Loading…
Add table
Add a link
Reference in a new issue