NB. written by T.Nishikawa (c)apr_2022 func =: 3 : 0 NB. 'a n' =. y. a =. y. n =. (%: a) +1 AA =. '' i =. 0 while. i < n do. i, (a + i) A =. a * i + (i + 1) AA =. AA , ": a + i i =. i + 1 end. AAA =: AA if. a >: 16 do. AAAA =. }: , (((-: #AAA),2)$AAA) ,"(1)'+' else. if. a = 9 do. AAAA =. }: , ((4, 2)$ ' ', AAA) ,"(1)'+' end. if. a = 4 do. AAAA =. }: , (,. AAA) ,"(1) '+' end. if. a = 1 do. AAAA =. }: , (,. AAA) ,"(1) '+' end. end. b =. a + i BB =. '' j =. 0 while. j < (n-1) do. j, (b + j) B =. b * j + (j + 1) BB =. BB , ": b + j j =. j + 1 end. BBB =: BB if. a >: 16 do. BBBB =. }: , (((-: #BBB),2)$BBB) ,"(1)'+' else. if. a = 9 do. BBBB =. }: , ((3, 2)$BBB),"(1) '+' end. if. a = 4 do. BBBB =. }: , (,. BBB) ,"(1) '+' end. if. a = 1 do. BBBB =. }: , (,. BBB) ,"(1) '+' end. end. RES =. AAAA, '=', BBBB '*** end ***' ) run =: 3 : 0 N =. y. i =. 1 while. i <: N do. ii =. *: i res =: func ii keta =. res i. '=' wr ((30-keta)#' '), res i =. i + 1 end. '*** end ***' )