login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A117535
Number of ways of writing n as a sum of powers of 3, each power being used at most 4 times.
7
1, 1, 1, 2, 2, 1, 2, 2, 1, 3, 3, 2, 4, 4, 2, 3, 3, 1, 3, 3, 2, 4, 4, 2, 3, 3, 1, 4, 4, 3, 6, 6, 3, 5, 5, 2, 6, 6, 4, 8, 8, 4, 6, 6, 2, 5, 5, 3, 6, 6, 3, 4, 4, 1, 4, 4, 3, 6, 6, 3, 5, 5, 2, 6, 6, 4, 8, 8, 4, 6, 6, 2, 5, 5, 3, 6, 6, 3, 4, 4, 1, 5, 5, 4, 8, 8, 4, 7, 7, 3, 9, 9, 6, 12, 12, 6, 9, 9, 3, 8, 8, 5, 10, 10
OFFSET
0,4
COMMENTS
It seems that this sequence can be calculated by constructing an insertion tree in which the insertion rules depend on the "age" of a term at a particular stage of the calculation. See the link for a discussion of this concept.
LINKS
P. de Castro et al., Counting binomial coefficients divisible by a prime power, Amer. Math. Monthly, 125 (2018), 531-540. See page 535.
John W. Layman, Ratio-Determined Insertion Sequences and the Tree of their Recurrence Types, June 2003 [local copy, corrected]
John W. Layman, Sequences Generated by Age-Determined Insertion Trees, Jan 2006 [Local copy]
FORMULA
G.f.: product((1+x^(3^j)+x^(2*(3^j))+x^(3*(3^j))+x^(4*(3^j))), j=0..infinity). - Emeric Deutsch, Apr 02 2006
For n>=1, a(3*n+2) = a(n); a(3*n+1) = a(n) + a(n-1); a(3*n) = a(n) + a(n-1). - Tom Edgar, Jun 21 2017
G.f. A(x) satisfies: A(x) = (1 + x + x^2 + x^3 + x^4) * A(x^3). - Ilya Gutkovskiy, Jul 09 2019
EXAMPLE
a(12) = 4 because 12=9+3=9+1+1+1=3+3+3+3=3+3+3+1+1+1.
MAPLE
g:= product((1+x^(3^j)+x^(2*(3^j))+x^(3*(3^j))+x^(4*(3^j))), j=0..10): gser:= series(g, x=0, 106): seq(coeff(gser, x, n), n=0..103); # Emeric Deutsch, Apr 02 2006
# second Maple program:
b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<0, 0,
add(`if`(n-j*3^i<0, 0, b(n-j*3^i, i-1)), j=0..4)))
end:
a:= n-> b(n, ilog[3](n)):
seq(a(n), n=0..100); # Alois P. Heinz, Jun 21 2012
MATHEMATICA
b[n_, i_] := b[n, i] = If[n == 0, 1, If[i < 0, 0, Sum[If[n - j*3^i < 0, 0, b[n - j*3^i, i - 1]], {j, 0, 4}]]]; a[n_] := b[n, Floor[Log[3, n]]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Dec 22 2016, after Alois P. Heinz *)
CROSSREFS
Cf. A054390.
Sequence in context: A280153 A023671 A302243 * A270747 A214517 A230594
KEYWORD
nonn,look
AUTHOR
John W. Layman, Mar 27 2006
STATUS
approved