OFFSET
2,1
LINKS
EXAMPLE
a(7) = 7 because 7 built by the rules is 2*2+3 or 2+2+3, and in both cases the sum is 7 and there is no other combination with a lesser sum.
a(17) = 10 because 17 = (2+3)*3+2, with 10 being the minimal sum.
a(22) = 10 because 22 = 2*(3*3+2) and these 2's and 3's add up to 10, which is the least possible sum.
a(44) = 12 because 44 = 2*2*(3*3+2), with the least possible sum being 12.
PROG
(PARI) seq(n)=my(a=vector(n)); for(n=1, #a, my(m=if(n==2||n==3, n, oo)); for(k=2, n-2, m=min(m, a[k]+a[n-k])); fordiv(n, d, if(d>1&&d<n, m=min(m, a[d]+a[n/d]))); a[n]=m); a[2..n] \\ Andrew Howroyd, Jan 31 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Tamas Sandor Nagy, Jan 31 2023
EXTENSIONS
Terms a(46) and beyond from Andrew Howroyd, Feb 01 2023
STATUS
approved