|
|
A054635
|
|
Champernowne sequence: write n in base 3 and juxtapose.
|
|
22
|
|
|
0, 1, 2, 1, 0, 1, 1, 1, 2, 2, 0, 2, 1, 2, 2, 1, 0, 0, 1, 0, 1, 1, 0, 2, 1, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 0, 1, 2, 1, 1, 2, 2, 2, 0, 0, 2, 0, 1, 2, 0, 2, 2, 1, 0, 2, 1, 1, 2, 1, 2, 2, 2, 0, 2, 2, 1, 2, 2, 2, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 2, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 2, 1, 0, 2, 0, 1, 0, 2, 1
(list;
constant;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
An irregular table in which the n-th row lists the base-3 digits of n. - Jason Kimberley, Dec 07 2012
|
|
LINKS
|
|
|
MATHEMATICA
|
almostNatural[n_, b_] := Block[{m = 0, d = n, i = 1, l, p}, While[m <= d, l = m; m = (b - 1) i*b^(i - 1) + l; i++]; i--; p = Mod[d - l, i]; q = Floor[(d - l)/i] + b^(i - 1); If[p != 0, IntegerDigits[q, b][[p]], Mod[q - 1, b]]]; Array[ almostNatural[#, 3] &, 105, 0] (* Robert G. Wilson v, Jun 29 2014 *)
|
|
PROG
|
(Magma) [0]cat &cat[Reverse(IntegerToSequence(n, 3)):n in[1..31]]; // Jason Kimberley, Dec 07 2012
(Haskell)
a054635 n k = a054635_tabf !! n !! k
a054635_row n = a054635_tabf !! n
a054635_tabf = map reverse a030341_tabf
a054635_list = concat a054635_tabf
(Python)
from sympy.ntheory.digits import digits
def agen(limit):
for n in range(limit):
yield from digits(n, 3)[1:]
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|