A332028 Savannah problem: number of distinct possible populations after n weeks, not allowing new populations after the empty set.
3, 5, 7, 11, 14, 17, 22, 26, 30, 34, 40, 45, 50, 55, 60, 67, 73, 79, 85, 91, 97, 105, 112, 119, 126, 133, 140, 147, 156, 164, 172, 180, 188, 196, 204, 212, 222, 231, 240, 249, 258, 267, 276, 285, 294, 305, 315, 325, 335, 345
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; and from F (which becomes H in the second step): (ZH->) F, FH and 2H. Population which follow from H (which becomes the empty set in the first step), are not allowed. Overall, there are 5 distinct possible populations after the second week: 2Z, ZF, FH, F and 2H.
Programs
-
Python
from math import isqrt def A332028(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 if n>1 else 3 # Chai Wah Wu, Jun 07 2025
Comments