A176873 Smallest possible integer m>=3 such that n is the sum of an m-gonal number and a k-gonal number for some k<=m.
3, 3, 3, 3, 3, 4, 3, 3, 4, 3, 3, 3, 3, 3, 4, 3, 3, 4, 3, 4, 3, 3, 3, 5, 3, 3, 4, 3, 3, 3, 3, 3, 4, 5, 3, 4, 3, 3, 3, 3, 4, 4, 3, 3, 4, 3, 3, 5, 3, 3, 4, 3, 4, 4, 4, 3, 3, 3, 3, 4, 3, 3, 7, 5, 3, 3, 3, 3, 4, 3, 3, 4, 3, 3, 4, 4, 3, 4, 3, 3, 4, 3, 4, 3, 3, 4, 5, 3, 3, 4, 3, 3, 3, 3, 3, 4, 4, 3, 4, 3, 3, 3, 3, 4, 4
Offset: 0
Keywords
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 0..10000
Programs
-
PARI
a(n)=if(ispolygonal(n,3) || ispolygonal(n-1,3), return(3)); for(m=3,if(n>5,(n+1)\2,4), my(i=2,t); while((t=n-(m-2)*binomial(i,2)-i)>=0, for(k=3,m, if(ispolygonal(t,k), return(m))); i++)) \\ Charles R Greathouse IV, Dec 11 2015