A332027 Savannah problem: number of distinct possible populations after n weeks, allowing populations after the empty set.
3, 7, 10, 15, 19, 23, 29, 34, 39, 44, 51, 57, 63, 69, 75, 83, 90, 97, 104, 111, 118, 127, 135, 143, 151, 159, 167, 175, 185, 194, 203, 212, 221, 230, 239, 248, 259, 269, 279, 289, 299, 309, 319, 329, 339, 351, 362, 373, 384
Offset: 1
Keywords
Examples
After one week, there are 3 possible populations, depending on which animal entered the savannah: one zebra (Z), one fed lion (F), one hungry lion (H). After two weeks, we have from Z: 2Z, ZF, and (ZH->) F; from F (which becomes H in the second step): (ZH->) F, FH and 2H; and from H (which becomes the empty set in the first step): Z, F and H. Overall, there are 7 distinct possible populations after the second week: 2Z, ZF, Z, FH, F, 2H and H.
Programs
-
Python
from math import isqrt def A332027(n): return (k:=(r:=isqrt(m:=n+1<<1))+int((m<<2)>(r<<2)*(r+1)+1)-1)*(6*n-2-k*(k+3))//6+(isqrt(n<<3)+1>>1)+(n<<1) # Chai Wah Wu, Jun 07 2025
Comments