Van Eck sequence

by Ricardo Fernández Serrata

Version 5 (July 21, 2021)

Download (91 downloads)

Returns an array containing the VE seq. Supports custom initial (seed) and "padding" values for a richer set of sequences.

Thanks to Numberphile, I learned about this sequence and other Run Length Encoded sequences like Conway's Look And Say.

youtube.com/watch?v=etMJxB-igrc

I've optimized the algorithm by using more memory to avoid searches.

I used an array instead of a dictionary for faster access. Since the indices grow linearly, the extra memory used by the array is slightly higher, equal, or even less than a dictionary

4.0 average rating from 2 reviews

5 stars
0
4 stars
2
3 stars
0
2 stars
0
1 star
0
Reports
0

Rate and review within the app in the Community section.