|
|
A107680
|
|
Repeating k-th ternary repunit (A003462) 2^k times, k >= 0.
|
|
4
|
|
|
0, 1, 1, 4, 4, 4, 4, 13, 13, 13, 13, 13, 13, 13, 13, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
COMMENTS
|
a(n) is the greatest ternary repunit that is not greater than the n-th number with no 2 in ternary representation.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
k=1: A003462(1) = (3^1-1)/2 = 1, therefore a(1) = a(2^1) = 1;
k=2: A003462(2) = (3^2-1)/2 = 4, therefore a(2+1) = a(2+2) =
a(2+3) = a(2+2^2) = 4.
|
|
MATHEMATICA
|
With[{nn=5}, Flatten[Table[#[[1]], {#[[2]]}]&/@Thread[{Table[FromDigits[ PadRight[{}, n, 1], 3], {n, nn}], 2^Range[nn]}]]] (* Harvey P. Dale, Jan 04 2013 *)
|
|
PROG
|
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|