|
|
A180969
|
|
Array read by antidiagonals: a(k,n) = natural numbers each repeated 2^k times.
|
|
11
|
|
|
0, 1, 0, 2, 0, 0, 3, 1, 0, 0, 4, 1, 0, 0, 0, 5, 2, 0, 0, 0, 0, 6, 2, 1, 0, 0, 0, 0, 7, 3, 1, 0, 0, 0, 0, 0, 8, 3, 1, 0, 0, 0, 0, 0, 0, 9, 4, 1, 0, 0, 0, 0, 0, 0, 0, 10, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 11, 5, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 12, 5, 2, 1, 0, 0, 0, 0
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
COMMENTS
|
Generalization of P. Barry's (2003) formula in A004526.
|
|
LINKS
|
|
|
FORMULA
|
a(k,n) = (n/2^k) + Sum_{j=1..k} ((-1)^a(j-1,n) - 1)/2^(k-j+2).
|
|
EXAMPLE
|
Sequence gives the antidiagonals of the infinite square array with rows indexed by k and columns indexed by n:
0 1 2 3 4 5 6 7 8 9 10 11 12 13...
0 0 1 1 2 2 3 3 4 4 5 5 6...
0 0 0 0 1 1 1 1 2 2 2 2 3...
0 0 0 0 0 0 0 0 1 1 1 1 1...
0 0 0 0 0 0 0 0 0 0 0 0 0...
...........................................
|
|
MATHEMATICA
|
Table[Floor[#/2^k] &[n - k], {n, 0, 12}, {k, 0, n}] // Flatten (* Michael De Vlieger, Sep 30 2019 *)
|
|
PROG
|
(MATLAB) function v=A180969(k, n, q)
% n=vector of natural numbers 0, 1, ..., n
% v=vector in which each n is repeated k times
% q=q-th term of v from where to start
if k==0; v=n+q; return; end
% calculate repetition only if v terms are not all zeros
if any(v); v=v/2+((-1).^v-1)/4; end
(PARI) matrix(10, 20, k, n, k--; n--; floor(n/2^k)) \\ Michel Marcus, Sep 09 2019
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|