Data update

This commit is contained in:
Ingy döt Net 2025-08-11 18:05:26 -07:00
parent 4d5544505c
commit 4924dd0264
3073 changed files with 55820 additions and 4408 deletions

View file

@ -0,0 +1,16 @@
create or replace function first_forward_diff(l) as (
with cte as (select unnest(l) as i, unnest(range(0,length(l))) as ix),
forward as (select ix, (lead(i) over () - i) as f from cte),
agg as (select array_agg(f order by ix) from forward)
select list_filter((from agg limit 1), x -> x is not null)
);
create or replace function ndiff_table(lst, mx) as table (
with recursive cte as (
select 0 as n, lst as diff
union all
select n+1, first_forward_diff(diff) as diff
from cte
where n < mx and diff != [] )
select n as order, diff from cte
);