cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A084544 Alternate number system in base 4.

Original entry on oeis.org

1, 2, 3, 4, 11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34, 41, 42, 43, 44, 111, 112, 113, 114, 121, 122, 123, 124, 131, 132, 133, 134, 141, 142, 143, 144, 211, 212, 213, 214, 221, 222, 223, 224, 231, 232, 233, 234, 241, 242, 243, 244, 311, 312, 313, 314, 321
Offset: 1

Views

Author

Robert R. Forslund (forslund(AT)tbaytel.net), Jun 27 2003

Keywords

Examples

			From _Hieronymus Fischer_, Jun 06 2012: (Start)
a(100)  = 1144.
a(10^3) = 33214.
a(10^4) = 2123434.
a(10^5) = 114122134.
a(10^6) = 3243414334.
a(10^7) = 211421121334.
a(10^8) = 11331131343334.
a(10^9) = 323212224213334. (End)
		

Crossrefs

Programs

  • Python
    def A084544(n):
        m = (3*n+1).bit_length()-1>>1
        return int(''.join((str(((3*n+1-(1<<(m<<1)))//(3<<((m-1-j)<<1))&3)+1) for j in range(m)))) # Chai Wah Wu, Feb 08 2023

Formula

From Hieronymus Fischer, Jun 06 and Jun 08 2012: (Start)
The formulas are designed to calculate base-10 numbers only using the digits 1..4.
a(n) = Sum_{j=0..m-1} (1 + b(j) mod 4)*10^j,
where m = floor(log_4(3*n+1)), b(j) = floor((3*n+1-4^m)/(3*4^j)).
Special values:
a(k*(4^n-1)/3) = k*(10^n-1)/9, k = 1,2,3,4.
a((7*4^n-4)/3) = (13*10^n-4)/9 = 10^n + 4*(10^n-1)/9.
a((4^n-1)/3 - 1) = 4*(10^(n-1)-1)/9, n > 1.
Inequalities:
a(n) <= (10^log_4(3*n+1)-1)/9, equality holds for n=(4^k-1)/3, k>0.
a(n) > (4/10)*(10^log_4(3*n+1)-1)/9, n > 0.
Lower and upper limits:
lim inf a(n)/10^log_4(3*n) = 2/45, for n --> infinity.
lim sup a(n)/10^log_4(3*n) = 1/9, for n --> infinity.
G.f.: g(x) = (x^(1/3)*(1-x))^(-1) Sum_{j>=0} 10^j*z(j)^(4/3)*(1 - 5z(j)^4 + 4z(j)^5)/((1-z(j))(1-z(j)^4)), where z(j) = x^4^j.
Also: g(x) = (1/(1-x)) Sum_{j>=0} (1-5(x^4^j)^4 + 4(x^4^j)^5)*x^4^j*f_j(x)/(1-x^4^j), where f_j(x) = 10^j*x^((4^j-1)/3)/(1-(x^4^j)^4). The f_j obey the recurrence f_0(x) = 1/(1-x^4), f_(j+1)(x) = 10x*f_j(x^4).
Also: g(x) = (1/(1-x))* (h_(4,0)(x) + h_(4,1)(x) + h_(4,2)(x) + h_(4,3)(x) - 4*h_(4,4)(x)), where h_(4,k)(x) = Sum_{j>=0} 10^j*x^((4^(j+1)-1)/3) * (x^4^j)^k/(1-(x^4^j)^4).
(End)
a(n) = A045926(n) / 2. - Reinhard Zumkeller, Jan 01 2013

Extensions

Offset set to 1 according to A007931, A007932 by Hieronymus Fischer, Jun 06 2012