OFFSET
1,2
COMMENTS
An irregular table in which the n-th row lists the base-4 digits of n. - Jason Kimberley, Nov 26 2012
The base-4 Champernowne constant: it is normal in base 4. - Jason Kimberley, Nov 26 2012
LINKS
R. J. Mathar, Table of n, a(n) for n = 1..4664
F. J. Aragon Artacho, D. H. Bailey, J. M. Borwein, and P. B. Borwein, Walking on real numbers, preprint September 2012.
EXAMPLE
1;
2;
3;
1,0;
1,1;
1,2;
1,3;
2,0;
2,1;
2,2;
...
3,3;
1,0,0;
1,0,1;
1,0,2;
1,0,3;
1,1,0; ....
MATHEMATICA
Flatten[IntegerDigits[Range[40], 4]] (* Harvey P. Dale, Aug 23 2011 *)
PROG
(Magma) &cat[Reverse(IntegerToSequence(n, 4)):n in[1..31]]; // Jason Kimberley, Dec 07 2012
(Python)
from itertools import count, chain, islice
from sympy.ntheory.factor_ import digits
def A030373_gen(): return chain.from_iterable(digits(m, 4)[1:] for m in count(1))
(Python)
from sympy import digits
from oeis_sequences.OEISsequences import bisection, bsearch
def A030373(n):
if n == 1: return 1
def g(x): return x+(m:=x.bit_length()+1>>1)*(x+1)-((1<<(m-1<<1))-1<<2)//3
def f(x): return n+1+bsearch(g, x)
return int((s:=digits(a:=bisection(f, n+1, n+1)-n, 4))[n-1-a*(k:=len(s))+((1<<(k<<1))-1)//3]) # Chai Wah Wu, Mar 02 2026
CROSSREFS
KEYWORD
AUTHOR
STATUS
approved
