Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> There may be a recurrence that does all three at once, not sure.

Now that we know the start of the sequence, we can just dump it into OEIS to look up the answer! :)

The sequence is A046180 (https://oeis.org/A046180) titled "Hexagonal pentagonal numbers" with a nice and easy recurrence relation:

    a(n) = 37635*a(n-1) - 37635*a(n-2) + a(n-3).
Also, according to the comments on OEIS, all hexagonal numbers are triangular, so we could have just skipped that requirement entirely.


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: