anchor.diff:  
   swap_2500_test_() ->
       {"N Swap Permutations '[1..2500], 2500' must halt", 
  -    ?_assertEqual({2501, 7500}, swp_perms(lists:seq(1, 2500), 2500))}.
  +   ?_assertEqual({2501, 229904293}, swp_perms(lists:seq(1, 2500), 2500))}.
   
   swp_perms_1_to_19_4k_test_() ->
  -    {"swp perms of '[1..19] and 4' must yield in '{22, 88}'", ?_assertEqual({5,12}, swp_perms(lists:seq(1, 19), 4))}.
  -
  +    {"swp perms of '[1..19] and 4' must yield in '{22, 88}'", ?_assertEqual({5,15552}, swp_perms(lists:seq(1, 19), 4))}.
   
   swp_perms(L, K) ->
       S1 = length(nas(L, K)),
  -    S2 = length(swp(L, K)),
  +    S2 = swap_tail2(L, K),
       {mod(S1, ?MOD), mod(S2, ?MOD)}.
   
   nas(L, 0) ->
  
positive.code: swap_adjacent([H, Hn|T]) ->
      [Hn, H| swap_adjacent(T)].
  
  swp(L, K) ->
      nswp(L, K, 0, []). 
  
  nswp([], _, _, S) ->
      S;
  %nswp(L, 0, _, []) ->
  %    L;
  nswp(_L, K, K, S) ->
      S;
  %% This logic consumes a lot of memory yields in a runtime error
  nswp([L|T], K, I, S) when is_list(L) ->
      nswp(T, K, I, concat(S, nswp(L, K, I, S)));
  nswp(L, K, I, _S) ->
      Swpd = swp(L),
      nswp(Swpd, K, I + 1, Swpd).
  
  concat([], L) ->
      L;
  concat([HoL|ToL], L) ->
      concat(ToL, [HoL|L]).
  
  swp(L) ->
      swp(L, length(L), 1, []).
  
  swp([], _, _, Slts) ->
      Slts;
  swp(_L, M, M, Slts) ->
      Slts;
  swp(L, M, J, Slts) ->
      ElemJ = lists:nth(J, L), 
      ElemM = lists:nth(M, L),
      SwpdJ = concat(ElemM, lists:delete(ElemM, lists:delete(ElemJ, L)), ElemJ),
      swp(L, M, J + 1, [SwpdJ|Slts]).
  
  concat(L1, L2, L3) when is_list(L2) ->
      [L1|[L3|L2]].
  
  main() ->
      {ok, [N, K]} = io:fread("", "~d~d"),
      [io:fwrite("~p ", [Fet]) || Fet <- tuple_to_list(swp_perms(lists:seq(1, N), K))],
      true.
  
  
  mod(0,0) ->
      undefined; %% The divisor must not be 0.
  
negative.code: nas(L, K, I, S) ->
      Swpith = swap_adjacent(L), 
      nas(Swpith, K - 1, I, [Swpith|S]).
  
  swap_adjacent([]) ->
      [];
  