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.

Showing 1-3 of 3 results.

A066321 Binary representation of base-(i-1) expansion of n: replace i-1 with 2 in base-(i-1) expansion of n.

Original entry on oeis.org

0, 1, 12, 13, 464, 465, 476, 477, 448, 449, 460, 461, 272, 273, 284, 285, 256, 257, 268, 269, 3280, 3281, 3292, 3293, 3264, 3265, 3276, 3277, 3088, 3089, 3100, 3101, 3072, 3073, 3084, 3085, 3536, 3537, 3548, 3549, 3520, 3521, 3532, 3533, 3344, 3345, 3356
Offset: 0

Views

Author

Marc LeBrun, Dec 14 2001

Keywords

Comments

Here i = sqrt(-1).
First differences follow a strange period-16 pattern: 1 11 1 XXX 1 11 1 -29 1 11 1 -189 1 11 1 -29 where XXX is given by A066322. Number of one-bits is A066323.
From Andrey Zabolotskiy, Feb 06 2017: (Start)
(Observations.)
Actually, the sequence of the first differences can be split into blocks of size of any power of 2, and there will be only one position in the block that does not repeat. In this sense, one may say that the first differences follow (almost-)period-2^s pattern for any s > 0.
Specifically, the first differences are given by the formula: a(n+1)-a(n) = A282137(A007814((n xor ...110011001100) + 1)). Here binary representation of n is bitwise-xored with the period-4 bit sequence (A021913 written right-to-left) which is infinite or simply long enough; A007814(m) does not depend on the bits of m other than the least significant 1.
A282137 gives all first differences in the order of decreasing occurrence frequency.
(End)
Penney shows that since (i-1)^4 = -4, the representation a(n) of a real integer n is found by writing n in base -4 using digits 0 to 3 (A007608), changing those digits to bit strings 0000, 0001, 1100, 1101 respectively, and interpreting as binary. - Kevin Ryde, Sep 07 2019

Examples

			a(4) = 464 = 2^8 + 2^7 + 2^6 + 2^4 since (i-1)^8 + (i-1)^7 + (i-1)^6 + (i-1)^4 = 4.
		

References

  • D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, 1969, Vol. 2, p. 172. (See also exercise 16, p. 177; answer, p. 494.)

Crossrefs

See A271472 for the conversion of these decimal numbers to binary.
See A009116 and A009545 for real and imaginary parts of (i-1)^n (except for signs).
See A256441 for expansions of -n.

Programs

  • Maple
    f:= proc(n) option remember; local t,m;
       t:= n mod 4;
       procname(t) + 16*procname((t-n)/4)
    end proc:
    f(0):= 0: f(1):= 1: f(2):= 12: f(3):= 13:
    seq(f(i),i=0..100); # Robert Israel, Oct 21 2016
  • PARI
    a(n) = my(ret=0,p=0); while(n, ret+=[0,1,12,13][n%4+1]<Kevin Ryde, Sep 07 2019
  • Perl
    See Links section.
    
  • Python
    from gmpy2 import c_divmod
    u = ('0000','1000','0011','1011')
    def A066321(n):
        if n == 0:
            return 0
        else:
            s, q = '', n
            while q:
                q, r = c_divmod(q, -4)
                s += u[r]
            return int(s[::-1],2) # Chai Wah Wu, Apr 09 2016
    

Formula

In "rebase notation" a(n) = (i-1)[n]2.
G.f. g(z) satisfies g(z) = z*(1+12*z+13*z^2)/(1-z^4) + 16*z^4*(13+12*z^4+z^8)/((1-z)*(1+z^4)*(1+z^8)) + 256*(1-z^16)*g(z^16)/(z^12-z^13). - Robert Israel, Oct 21 2016

A320283 Lexicographical ordering of pure imaginary integers in the base (-1+i) numeral system.

Original entry on oeis.org

0, 1, -2, -1, -4, -3, -6, -5, 8, 9, 6, 7, 4, 5, 2, 3, 16, 17, 14, 15, 12, 13, 10, 11, 24, 25, 22, 23, 20, 21, 18, 19, -32, -31, -34, -33, -36, -35, -38, -37, -24, -23, -26, -25, -28, -27, -30, -29, -16, -15, -18, -17, -20, -19, -22, -21, -8, -7, -10, -9, -12, -11, -14, -13, -64, -63, -66, -65, -68, -67, -70, -69
Offset: 0

Views

Author

Andreas K. Badea, Oct 09 2018

Keywords

Comments

For ordering of pure real integers in same system see A073791.
All integers appear in this sequence.

Crossrefs

Formula

From Andrey Zabolotskiy, Jan 31 2019: (Start)
a(n) = A073791(2*n)/2.
a(n) = -a(4*n)/4.
a(n) = -4*a(floor(n/4)) + a(n mod 4). (End)

A360034 Binary representation of -n in base i-1.

Original entry on oeis.org

0, 11101, 11100, 10001, 10000, 11001101, 11001100, 11000001, 11000000, 11011101, 11011100, 11010001, 11010000, 1110100001101, 1110100001100, 1110100000001, 1110100000000, 1110100011101, 1110100011100, 1110100010001, 1110100010000, 1110111001101, 1110111001100, 1110111000001
Offset: 0

Views

Author

Jianing Song, Jan 22 2023

Keywords

Comments

Note that each Gaussian integer has one and only one base-(i-1) representation.
Also binary representation of -n in base -1-i.
Write out -n in base -4 (A212526), then change each digit 0, 1, 2, 3 to 0000, 0001, 1100, 1101 respectively.

Examples

			a(1) = 11101 since -1 = (i-1)^4 + (i-1)^3 + (i-1)^2 + (i-1)^0. Also, the base-(-4) representation of -1 is 13_(-4), so changing 1 to 0001 and 3 to 1101 yields 11101.
a(5) = 11001101 since -5 = (i-1)^7 + (i-1)^6 + (i-1)^3 + (i-1)^2 + (i-1)^0. Also, the base-(-4) representation of -5 is 23_(-4), so changing 2 to 1100 and 3 to 1101 yields 11001101.
		

Crossrefs

This is A256441 converted from base 10 to base 2. Cf. also A271472.

Programs

  • PARI
    a(n) = my(v = [-n,0], x=0, digit=0, a, b); while(v!=[0,0], a=v[1]; b=v[2]; v[1]=-2*(a\2)+b; v[2]=-(a\2); x+=(a%2)*10^digit; digit++); x \\ Jianing Song, Jan 22 2023; [a,b] represents the number a + b*(-1+i)

Formula

For n >= 1, a(4*n-0..3) = 10000 * A271472(n) + 0, 1, 1100, 1101 respectively.
Showing 1-3 of 3 results.