Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,20 @@
/* Hofstrader Q sequence for any "n". */
H: procedure options (main); /* 28 January 2012 */
declare n fixed binary(31);
put ('How many values do you want? :');
get (n);
begin;
declare Q(n) fixed binary (31);
declare i fixed binary (31);
Q(1), Q(2) = 1;
do i = 1 upthru n;
if i >= 3 then Q(i) = ( Q(i - Q(i-1)) + Q(i - Q(i-2)) );
if i <= 20 then put skip list ('n=' || trim(i), Q(i));
end;
put skip list ('n=' || trim(i), Q(i));
end;
end H;

View file

@ -0,0 +1,6 @@
declare tally fixed binary (31) initial (0);
do i = 1 to n-1;
if Q(i) > Q(i+1) then tally = tally + 1;
end;
put skip data (tally);