Advertisement
MatsGranvik

Sequence A030230 in the OEIS

Apr 21st, 2013
523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. (*Mathematica 8*)
  2. (*program start*)
  3. Clear[t];
  4. nn = 149;
  5. t[n_, 1] = 1;
  6. t[1, k_] = 1;
  7. t[n_, k_] :=
  8. t[n, k] =
  9. If[n < k,
  10. If[And[n > 1, k > 1], Sum[-t[k - i, n], {i, 1, n - 1}], 0],
  11. If[And[n > 1, k > 1], Sum[-t[n - i, k], {i, 1, k - 1}], 0]];
  12. Flatten[Position[
  13. Sign[Table[
  14. Total[(Table[Table[t[n, k], {k, 1, n}], {n, 1, nn}]*
  15. Table[Reverse[Table[t[n, k], {k, 1, n}]], {n, 1,
  16. nn}])[[j]]], {j, 1, nn}]], -1]]
  17. (*program start*)
  18.  
  19. {2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, \
  20. 30, 31, 32, 37, 41, 42, 43, 47, 49, 53, 59, 60, 61, 64, 66, 67, 70, \
  21. 71, 73, 78, 79, 81, 83, 84, 89, 90, 97, 101, 102, 103, 105, 107, 109, \
  22. 110, 113, 114, 120, 121, 125, 126, 127, 128, 130, 131, 132, 137, 138, \
  23. 139, 140, 149}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement