Data update

This commit is contained in:
Ingy döt Net 2025-06-11 20:16:52 -04:00
parent 72eb4943cb
commit 4d5544505c
2347 changed files with 62432 additions and 16731 deletions

View file

@ -1,16 +1,12 @@
func gcd a b .
if b = 0
return a
.
if b = 0 : return a
return gcd b (a mod b)
.
proc remove_at i . a[] .
for j = i + 1 to len a[]
a[j - 1] = a[j]
.
proc remove_at i &a[] .
for j = i + 1 to len a[] : a[j - 1] = a[j]
len a[] -1
.
proc yellowstone count . yellow[] .
proc yellowstone count &yellow[] .
yellow[] = [ 1 2 3 ]
num = 4
while len yellow[] < count
@ -18,9 +14,7 @@ proc yellowstone count . yellow[] .
yell2 = yellow[len yellow[]]
for i to len notyellow[]
test = notyellow[i]
if gcd yell1 test > 1 and gcd yell2 test = 1
break 1
.
if gcd yell1 test > 1 and gcd yell2 test = 1 : break 1
.
if i <= len notyellow[]
yellow[] &= notyellow[i]

View file

@ -1,20 +0,0 @@
/*REXX program calculates any number of terms in the Yellowstone (permutation) sequence.*/
parse arg m . /*obtain optional argument from the CL.*/
if m=='' | m=="," then m= 30 /*Not specified? Then use the default.*/
!.= 0 /*initialize an array of numbers(used).*/
# = 0 /*count of Yellowstone numbers in seq. */
$= /*list " " " " " */
do j=1 until #==m; prev= # - 1
if j<5 then do; #= #+1; @.#= j; !.#= j; !.j= 1; $= strip($ j); iterate; end
do k=1; if !.k then iterate /*Already used? Then skip this number.*/
if gcd(k, @.prev)<2 then iterate /*Not meet requirement? Then skip it. */
if gcd(k, @.#) \==1 then iterate /* " " " " " " */
#= #+1; @.#= k; !.k= 1; $= $ k /*bump ctr; assign; mark used; add list*/
leave /*find the next Yellowstone seq. number*/
end /*k*/
end /*j*/
say $ /*display a list of a Yellowstone seq. */
exit /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
gcd: parse arg x,y; do until y==0; parse value x//y y with y x; end; return x

View file

@ -1,21 +0,0 @@
/*REXX program calculates any number of terms in the Yellowstone (permutation) sequence.*/
parse arg m . /*obtain optional argument from the CL.*/
if m=='' | m=="," then m= 30 /*Not specified? Then use the default.*/
!.= 0 /*initialize an array of numbers(used).*/
# = 0 /*count of Yellowstone numbers in seq. */
$ = /*list " " " " " */
do j=1 until #==m; prev= # - 1
if j<5 then do; #= #+1; @.#= j; !.#= j; !.j= 1; $= strip($ j); iterate; end
do k=1; if !.k then iterate /*Already used? Then skip this number.*/
if gcd(k, @.prev)<2 then iterate /*Not meet requirement? Then skip it. */
if gcd(k, @.#) \==1 then iterate /* " " " " " " */
#= # + 1; @.#= k; !.k= 1; $= $ k /*bump ctr; assign; mark used; add list*/
leave /*find the next Yellowstone seq. number*/
end /*k*/
end /*j*/
call $histo $ '(vertical)' /*invoke a REXX vertical histogram plot*/
exit /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
gcd: parse arg x,y; do until y==0; parse value x//y y with y x; end; return x

View file

@ -0,0 +1,56 @@
-- 25 Apr 2025
include Settings
numeric digits 100
arg xx
if xx = '' then
xx = 30
say 'YELLOWSTONE SEQUENCE'
say version
say
call GetYellow xx
call DisplayList xx
call Timer
exit
GetYellow:
procedure expose yell. work.
arg xx
say 'Get yellowstones...'
yell. = 0; work. = 0; n = 0
do i = 1 until n = xx
p = n-1
if i < 5 then do
n = n+1; yell.n = i; work.n = i; work.i = 1
iterate i
end
do j = 1
if work.j then
iterate j
if Gcd(j,yell.p) = 1 then
iterate j
if Gcd(j,yell.n) <> 1 then
iterate j
n = n+1; yell.n = j; work.j = 1
leave j
end
end
say
return xx
DisplayList:
procedure expose yell.
arg xx
say 'Yellowstone sequence...'
do i = 1 to xx
call Charout ,Right(yell.i,5)
if i//10 = 0 then
say
end
say
return
include Sequences
include Functions
include Helper
include Abend