OFFSET
1,2
LINKS
Reinhard Zumkeller, Antidiagonals n=1..150 of array, flattened
EXAMPLE
Array begins
1 3 9 26 73 194 ...
.2 6 17 47 121 ...
. 4 11 30 74 ...
.. 7 19 44 ...
... 12 25 ...
.... 13 ...
PROG
(Haskell)
import Data.List (intersect, union, (\\))
a056230 n k = a056230_tabl !! (n-1) !! (k-1)
a056230_tabl = [1] : f [1] [2..] [1] where
f adiag (a:as) us | null (adiag' `intersect` us) =
adiag' : f adiag' (as \\ adiag') (us `union` adiag')
| otherwise = f adiag as us
where adiag' = scanl (+) a adiag
-- Reinhard Zumkeller, Nov 19 2011
CROSSREFS
KEYWORD
AUTHOR
Jonas Wallgren, Jul 30, 2000.
STATUS
approved