Data update

This commit is contained in:
Ingy döt Net 2024-07-13 15:19:22 -07:00
parent 29a5eea0d4
commit 5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions

View file

@ -1,10 +1,24 @@
/*REXX pgm generates/displays the 'start ──► end' elements of the Van Eck sequence.*/
parse arg LO HI $ . /*obtain optional arguments from the CL*/
if LO=='' | LO=="," then LO= 1 /*Not specified? Then use the default.*/
if HI=='' | HI=="," then HI= 10 /* " " " " " " */
if $=='' | $=="," then $= 0 /* " " " " " " */
$$=; z= $ /*$$: old seq: $: initial value of seq*/
do HI-1; z= wordpos( reverse(z), reverse($$) ); $$= $; $= $ z
end /*HI-1*/ /*REVERSE allows backwards search in $.*/
/*stick a fork in it, we're all done. */
say 'terms ' LO " through " HI ' of the Van Eck sequence are: ' subword($,LO,HI-LO+1)
/*REXX pgm generates/displays the 'start --> end' elements of the Van Eck sequence.*/
Parse Arg lo hi d . /*obtain optional arguments from the CL*/
If lo=='' | lo==',' Then lo= 1 /*Not specified? Then use the default.*/
If hi=='' | hi==',' Then hi= 10 /* " " " " " " */
If d=='' | d==',' Then d= 0 /* " " " " " " */
dd=''
z=d /*dd: old seq: d: initial value of seq*/
Do i=1 To hi-1
za=wordpos(reverse(z),reverse(dd))
zb=0
wdd=words(dd)
Do zz=wdd To 1 By -1
If z=word(dd,zz) Then Do
zb=wdd-zz+1
Leave
End
End
z=za
dd=d
d=d z
End /*HI-1*/ /*REVERSE allows backwards search in d.*/
Say 'terms ' lo ' through ' hi ' of the Van Eck sequence are: ' subword(d,lo,hi-lo+1)
Exit
/*stick a fork in it, we're all done. */

View file

@ -1,14 +1,30 @@
/*REXX pgm generates/displays the 'start ──► end' elements of the Van Eck sequence.*/
parse arg LO HI sta . /*obtain optional arguments from the CL*/
if LO=='' | LO=="," then LO= 1 /*Not specified? Then use the default.*/
if HI=='' | HI=="," then HI= 10 /* " " " " " " */
if sta=='' | sta=="," then sta= 0 /* " " " " " " */
$.0= sta; x= sta; @.=. /*$.: the Van Eck sequence as a list.*/
do #=1 for HI-1 /*X: is the last term being examined. */
if @.x==. then do; @.x= #; $.#= 0; x= 0; end /*new term.*/
else do; z= # - @.x; $.#= z; @.x= #; x= z; end /*old term.*/
end /*#*/ /*Z: the new term being added to list.*/
LOw= LO - 1; out= $.LOw /*initialize the output value. */
do j=LO to HI-1; out= out $.j /*build a list for the output display. */
end /*j*/ /*stick a fork in it, we're all done. */
say 'terms ' LO " through " HI ' of the Van Eck sequence are: ' out
/*REXX pgm generates/displays the 'start --? end' elements of the Van Eck sequence.*/
Parse Arg lo hi sta . /*obtain optional arguments from the CL*/
If lo=='' | lo==',' Then lo= 1 /*Not specified? Then use the default.*/
If hi=='' | hi==',' Then hi= 10 /* " " " " " " */
If sta=='' | sta==',' Then sta= 0 /* " " " " " " */
d.0=sta /*d.: the Van Eck sequence as a list.*/
x=sta
a.=.
out='0'
Do n=1 For hi-1 /*X: is the last term being examined. */
If a.x==. Then Do /* new term. */
a.x=n
d.n=0
x=0
End
Else Do /* old term. */
z=n-a.x
d.n=z
a.x=n
x=z
End
out=out d.n
End /*n*/ /*Z: the new term being added To list.*/
low=lo-1
out=d.low /* initialize the output list */
Do j=lo To hi-1
out=out d.j /*build a list For the output display. */
End /*j*/
Say 'terms ' lo ' through ' hi ' of the Van Eck sequence are: ' out
/*stick a fork in it, we're all done. */