Post History
J, 17 bytes {{*./y|~*:2+i.y}} Try it online! A direct definition closest to Razetime's infuriatingly good train solution. Outputs a non-zero number for true and 0 for false.
Answer
#1: Initial revision
# [J](https://jsoftware.com/#/), 17 bytes ```J {{*./y|~*:2+i.y}} ``` [Try it online!](https://tio.run/##y/r/P83WSsFYwUpBXUtPv7KmTsvKSDtTr1KdKzU5I1/BTkEjWidNUyE1MTlDQcPOKlPP0EBTR8HQSFtDuS7aSlfPSK1GEyT4/z8A) A direct definition closest to Razetime's infuriatingly good train solution. Outputs a non-zero number for true and 0 for false.