Please in order to save solutions and appear on the leaderboards.

Van Eck Sequence Authors

Van Eck Sequence

Details

The rules of the Van Eck sequence are as follows:

  1. The first term is zero.
  2. If the last term is new then the next term is zero.
  3. Otherwise the next term is how far back the term occurred previously.

The first few terms are as follows:

0         (using a)
0 0       (using b)
0 0 1     (using c)
0 0 1 0   (using b)
0 0 1 0 2 (using c)

Print the first 1,000 terms of the Van Eck sequence, with each term on a new line.

0 bytes, 0 chars
Restore solution
All
Compiled from AT&T syntax to x86-64 Linux. Use syscalls to write output.
Fennel is an experimental language, no solutions will be saved. Please leave feedback on the GitHub issue.
ctrl + enter or

Delete Solution

Are you sure you want to delete your solution(s) for Van Eck Sequence?

If you have seperate bytes and chars solutions then both will be deleted.

This is irreversible, please backup any code you care about.

Type I understand and press confirm to continue.