https://oeis.org/A004251
require'stats'
graphs=:verb define
r=. ,a:
if. 1 < y do.
m=. #pairs=. 2 comb y
for_n.1+i.m do.
raw=. pairs{~ n comb m
ndx=. (i. ~.) \:~@(#/.~)@,"2 raw
r=. r, ndx <@{ raw
end.
end.
)
#@graphs"0 i.8
1 1 2 4 11 31 102 342
This implementation is too inefficient, in my opinion, to go further than that.
Does anyone here have a more efficient implementation?
Thanks,
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm