# Integer sequences

**URL:** <https://fortran-lang.discourse.group/t/integer-sequences/1081>\
**Category:** Uncategorized\
**Created:** [April 18, 2021, 3:38pm UTC](https://fortran-lang.discourse.group/t/integer-sequences/1081 "2021-04-18T15:38:53Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)\
**Post date:** [April 21, 2021, 5:11pm UTC](https://fortran-lang.discourse.group/t/integer-sequences/1081/6 "2021-04-21T17:11:53Z")

</div>

Now we should benchmark @FortranFan’s and @Arjen’s solutions. The complexity seems `O(n^2)` for both, but I would expect @FortranFan’s to be a lost faster, as there are no allocations/reallocations.

I think that must be why the Rosetta page has some solutions using a hash table, I guess then the complexity is only `O(n)`.

---

_[View the full topic](https://fortran-lang.discourse.group/t/integer-sequences/1081)._
