Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Search: a007728 -id:a007728
     Sort: relevance | references | number | modified | created      Format: long | short | data
Square array T(n,k) (n >= 0, k >= 2) read by antidiagonals, where T(n,k) is the number of ways of writing n as Sum_{i>=0} c_i 2^i, c_i in {0,1,...,k-1}.
+10
13
1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 3, 2, 2, 1, 1, 1, 2, 3, 2, 2, 1, 1, 1, 3, 3, 4, 2, 2, 1, 1, 1, 1, 4, 3, 4, 2, 2, 1, 1, 1, 4, 4, 5, 4, 4, 2, 2, 1, 1, 1, 3, 5, 4, 5, 4, 4, 2, 2, 1, 1, 1, 5, 5, 8, 5, 6, 4, 4, 2, 2, 1, 1, 1, 2, 6, 6, 8, 5, 6, 4, 4, 2, 2, 1, 1, 1, 5, 6, 9, 8, 9, 6, 6, 4, 4, 2, 2, 1, 1
OFFSET
0,8
COMMENTS
k-th column is k-th binary partition function.
The sequence data corresponds (via the table link) to the transpose of the array shown in example and given by the definition. - M. F. Hasler, Feb 14 2019
LINKS
B. Reznick, Some binary partition functions, in "Analytic number theory" (Conf. in honor P. T. Bateman, Allerton Park, IL, 1989), 451-477, Progr. Math., 85, Birkhäuser Boston, Boston, MA, 1990.
FORMULA
T(n,k) = T(n,n+1) = T(n,n)+1 = A000123(floor(n/2)) for all k >= n+1. - M. F. Hasler, Feb 14 2019
EXAMPLE
Array begins: (rows n >= 0, columns k >= 2)
1 1 1 1 1 1 1 1 ...
1 1 1 1 1 1 1 1 ...
1 2 2 2 2 2 2 2 ...
1 1 2 2 2 2 2 2 ...
1 3 3 4 4 4 4 4 ...
1 2 3 3 4 4 4 4 ...
1 3 4 5 5 6 6 6 ...
MAPLE
b:= proc(n, i, k) option remember;
`if`(n=0, 1, `if`(i<0, 0, add(`if`(n-j*2^i<0, 0,
b(n-j*2^i, i-1, k)), j=0..k-1)))
end:
T:= (n, k)-> b(n, ilog2(n), k):
seq(seq(T(d+2-k, k), k=2..d+2), d=0..14); # Alois P. Heinz, Jun 21 2012
MATHEMATICA
b[n_, i_, k_] := b[n, i, k] = If[n == 0, 1, If[i < 0, 0, Sum[If[n-j*2^i < 0, 0, b[n-j*2^i, i-1, k]], {j, 0, k-1}]]];
t[n_, k_] := b[n, Length[IntegerDigits[n, 2]] - 1, k];
Table[Table[t[d+2-k, k], {k, 2, d+2}], {d, 0, 14}] // Flatten (* Jean-François Alcover, Jan 14 2014, translated from Alois P. Heinz's Maple code *)
PROG
(PARI) M72170=[[]]; A072170(n, k, i=logint(n+!n, 2), r=1)={if( !i, k>n, r&&(k<5||k>=n), if(k>4, A000123(n\2)-(k==n), k<3, 1, k<4, A002487(n), n\2+1), M72170[r=setsearch(M72170, [n, k, i, ""], 1)-1][^-1]==[n, k, i], M72170[r][4], M72170=setunion(M72170, [[n, k, i, r=sum(j=0, min(k-1, n>>i), A072170(n-j*2^i, k, i-1, 0))]]); r)} \\ Code for k<5 (using A002487 for k=3) and k>=n (using A000123) is optional but makes it about 3x faster. - M. F. Hasler, Feb 14 2019
CROSSREFS
k=3 column is A002487, k=4 is A008619 (positive integers repeated), k = 5, 6, 7 are A007728, A007729, A007730, limiting (infinity) column is A000123 doubled up.
KEYWORD
nonn,tabl
AUTHOR
N. J. A. Sloane, Jun 29 2002
STATUS
approved
a(n) is the number of ways to represent 2*n in the decibinary system.
+10
0
1, 2, 4, 6, 10, 13, 18, 22, 30, 36, 45, 52, 64, 72, 84, 93, 110, 122, 140, 154, 177, 192, 214, 230, 258, 277, 304, 324, 356, 376, 405, 426, 464, 490, 528, 557, 604, 634, 678, 710, 765, 802, 854, 892, 952, 989, 1042, 1080, 1146, 1190, 1253, 1300, 1374, 1420, 1486, 1533, 1612, 1664
OFFSET
0,2
COMMENTS
It appears that a(n) is the number of decibinary numbers that can be constructed to represent the decimal numbers 2n-2 and 2n-1. To make this more clear let's consider n = 5: a(5) = 10 means that there are 10 decibinary numbers that represent the decimal numbers 2*5 - 2 = 8 and 2*5 - 1 = 9.
Furthermore, a(n) is the number of k such that A028897(k)=2*n.
FORMULA
a(1) = 1. a(n) = a(n-1) + a(ceiling(n/2)) if 1 < n <= 5.
Conjecture: a(n) = a(n-1) + a(ceiling(n/2)) - a(ceiling((n-5)/2)) if n > 5.
I think this sequence is closely related to the 10th binary partition function. The only difference is that every second number is omitted. At the moment, the 10th binary partition function is not in the OEIS. However, my experiments strongly suggest that the 10th binary partition function would indeed look like 1, 1, 2, 2, 4, 4, 6, 6, 10, 10, 13, 13, ...
EXAMPLE
a(1) = 1.
a(2) = a(2-1) + a(ceiling(2/2)) = a(1) + a(1) = 1 + 1 = 2.
a(3) = a(3-1) + a(ceiling(3/2)) = a(2) + a(2) = 2 + 2 = 4.
a(4) = a(4-1) + a(ceiling(4/2)) = a(3) + a(2) = 4 + 2 = 6.
a(5) = a(5-1) + a(ceiling(5/2)) = a(4) + a(3) = 6 + 4 = 10.
a(6) = a(6-1) + a(ceiling(6/2)) - a(ceiling((6-5)/2)) = a(5) + a(3) - a(1) = 10 + 4 - 1 = 13.
a(7) = a(7-1) + a(ceiling(7/2)) - a(ceiling((7-5)/2)) = a(6) + a(4) - a(1) = 13 + 6 - 1 = 18.
a(8) = a(8-1) + a(ceiling(8/2)) - a(ceiling((8-5)/2)) = a(7) + a(4) - a(2) = 18 + 6 - 2 = 22.
a(9) = a(9-1) + a(ceiling(9/2)) - a(ceiling((9-5)/2)) = a(8) + a(5) - a(2) = 22 + 10 - 2 = 30.
a(10) = a(10-1) + a(ceiling(10/2)) - a(ceiling((10-5)/2)) = a(9) + a(5) - a(3) = 30 + 10 - 4 = 36.
MATHEMATICA
Nest[Append[#1, #1[[-1]] + #1[[Ceiling[#2/2] ]] - If[#2 > 5, #1[[Ceiling[(#2 - 5)/2] ]], 0 ]] & @@ {#, Length@ # + 1} &, {1}, 57] (* Michael De Vlieger, Sep 29 2019 *)
PROG
(C++) int a(int n) {
std::vector<int> seq;
int a = 1;
seq.push_back(a);
for (int i = 1; i < n; i++) {
a += seq.at(i / 2);
a -= (i >= 5) ? seq.at((i - 5) / 2) : 0;
seq.push_back(a);
}
return seq.back();
}
CROSSREFS
Cf. A007728: superseeker found that the deltas of the sequence a(n+1) - a(n) match transformations of the original query.
Cf. A028897.
KEYWORD
nonn,base
AUTHOR
Jonas Hollm, Aug 10 2019
EXTENSIONS
Name corrected by Rémy Sigrist, Oct 15 2019
STATUS
approved

Search completed in 0.008 seconds