|
|
A083178
|
|
Numbers with a digit sum of n and a maximum product of digits. In case of two identical products choose the largest number.
|
|
2
|
|
|
1, 2, 3, 22, 32, 33, 322, 332, 333, 3322, 3332, 3333, 33322, 33332, 33333, 333322, 333332, 333333, 3333322, 3333332, 3333333, 33333322, 33333332, 33333333, 333333322, 333333332, 333333333, 3333333322, 3333333332, 3333333333
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Except for the first term, terms in the sequence are exactly those numbers formed by sequence of digits 3 followed by either zero, one or two digits 2. - Chai Wah Wu, Dec 11 2015
|
|
LINKS
|
|
|
FORMULA
|
Conjecture: a(n) = 10*a(n-3)+a(n-6)-10*a(n-9) for n>10. - Colin Barker, Oct 14 2014
Empirical g.f.: x*(90*x^6+10*x^4+11*x^3+3*x^2+2*x+1) / ((x-1)*(x^2+x+1)*(10*x^3-1)). - Colin Barker, Oct 14 2014
For n > 7, a(n) = 11*a(n-3)-10*a(n-6). For n > 4, a(n-3) + 3*10^(floor((n-1)/3)). For n > 1, (2*10^(floor((n+2)/3))+(63*m^2-129*m-2))/6, where m is the least nonnegative residue of n mod 3. - Chai Wah Wu, Dec 11 2015
|
|
PROG
|
(Python)
from __future__ import division
return 1 if n == 1 else (2*10**((n+2)//3)+(63*(n%3)**2-129*(n%3)-2))//6 # Chai Wah Wu, Dec 11 2015
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|