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-6 of 6 results.

A318438 For any n >= 0 with binary expansion Sum_{k=0..w} b_k * 2^k, let h(n) = Sum_{k=0..w} b_k * (i-1)^k (where i denotes the imaginary unit); a(n) is the real part of h(n).

Original entry on oeis.org

0, 1, -1, 0, 0, 1, -1, 0, 2, 3, 1, 2, 2, 3, 1, 2, -4, -3, -5, -4, -4, -3, -5, -4, -2, -1, -3, -2, -2, -1, -3, -2, 4, 5, 3, 4, 4, 5, 3, 4, 6, 7, 5, 6, 6, 7, 5, 6, 0, 1, -1, 0, 0, 1, -1, 0, 2, 3, 1, 2, 2, 3, 1, 2, 0, 1, -1, 0, 0, 1, -1, 0, 2, 3, 1, 2, 2, 3, 1, 2
Offset: 0

Views

Author

Rémy Sigrist, Aug 26 2018

Keywords

Comments

See A318439 for the imaginary part of h.
See A318479 for the square of the modulus of h.
The function h corresponds to the interpretation of the binary representation of a number in base -1+i and defines a bijection from the nonnegative integers to the Gaussian integers.
The function h has nice fractal features (see scatterplot in Links section).
This sequence has similarities with A316657.

Crossrefs

Cf. A009116, A318439 (imaginary part), A318479 (norm), A340669 (negation).
Cf. A316657 (base 2+i).

Programs

  • PARI
    a(n) = my (d=Vecrev(digits(n,2))); real(sum(i=1, #d, d[i]*(I-1)^(i-1)))

Formula

a(2^k) = A009116(k) for any k >= 0.

A318479 For any n >= 0 with binary expansion Sum_{k=0..w} b_k * 2^k, let h(n) = Sum_{k=0..w} b_k * (i-1)^k (where i denotes the imaginary unit); a(n) is the square of the modulus of h(n).

Original entry on oeis.org

0, 1, 2, 1, 4, 5, 2, 1, 8, 13, 10, 13, 4, 9, 2, 5, 16, 9, 26, 17, 20, 13, 26, 17, 8, 5, 18, 13, 4, 1, 10, 5, 32, 41, 18, 25, 52, 61, 34, 41, 40, 53, 26, 37, 52, 65, 34, 45, 16, 17, 10, 9, 36, 37, 26, 25, 8, 13, 2, 5, 20, 25, 10, 13, 64, 65, 82, 81, 36, 37, 50
Offset: 0

Views

Author

Rémy Sigrist, Aug 27 2018

Keywords

Comments

See A318438 for the real part of h and additional comments.

Crossrefs

Programs

  • PARI
    a(n) = my (d=Vecrev(digits(n, 2))); norm(sum(i=1, #d, d[i]*(I-1)^(i-1)))

Formula

a(n) = A318438(n)^2 + A318439(n)^2.
a(2^k) = 2^k for any k >= 0.
a(3 * 2^k) = 2^k for any l >= 0.

A340669 Permutation of the nonnegative integers formed by negation in complex base i-1.

Original entry on oeis.org

0, 29, 58, 7, 116, 25, 14, 3, 232, 21, 50, 239, 28, 17, 6, 235, 464, 13, 42, 471, 100, 9, 478, 467, 56, 5, 34, 63, 12, 1, 470, 59, 928, 957, 26, 935, 84, 953, 942, 931, 200, 949, 18, 207, 956, 945, 934, 203, 112, 941, 10, 119, 68, 937, 126, 115, 24, 933, 2, 31
Offset: 0

Views

Author

Kevin Ryde, Jan 15 2021

Keywords

Comments

Complex base i-1 of Khmelnik and Penney uses an integer n>=0 to represent a complex integer z(n) = A318438(n) + A318439(n)*i. a(n) is the negation of z in this representation, so that z(a(n)) = -z(n). Every z is uniquely represented, so this is a self-inverse permutation.
Khmelnik's table 4 is carries applied to z which become states and transitions by bits of n and certain 0<->1 bit flips in n. The result is the transformation in the formulas below. Bit flips may extend into 0-bits above the most significant bit of n causing the bit length of a(n) to be greater than the bit length of n.

Examples

			For n=1506, location z(1506) = 11-35*i.  Its negation is -(11-35*i) = z(29914) so a(1506) = 29914.  And being self-inverse conversely a(29914) = 1506.
In terms of bit flips, in the following "^^" is each 01 or 11 and F marks the bits flipped above them.
  n    =  1506 = binary  00001 0 1 11 100 01 0
                         FFF^^   F ^^ FFF ^^
  a(n) = 29914 = binary  11101 0 0 11 011 01 0
		

Crossrefs

Programs

  • PARI
    { a(n) = for(i=0,if(n,logint(n,2)),
      if(bittest(n,i),
        if(bittest(n,i+1), n=bitxor(n,4<
    				

Formula

a(n) is formed by transforming n as follows. Write n in binary with four high 0-bits and consider bits from least to most significant. At a 01 pair (high 0, low 1), apply an 0<->1 flip to three bits immediately above this pair. At a 11 pair, flip one bit immediately above this pair. Repeat, each time seeking the next higher 01 or 11 pair above the bits just flipped.

A340670 Number of complex base i-1 points which can be represented within n bits and negated within those n bits.

Original entry on oeis.org

1, 1, 1, 3, 5, 15, 29, 47, 101, 199, 413, 847, 1621, 3255, 6541, 13087, 26373, 52423, 104637, 209711, 419253, 839511, 1678317, 3353919, 6710629, 13421287, 26845213, 53693007, 107366933, 214742391, 429498701, 858994271, 1718023109, 3435955975, 6871883645
Offset: 0

Views

Author

Kevin Ryde, Jan 15 2021

Keywords

Comments

Complex base i-1 of Khmelnik and Penney uses an integer m to represent a complex integer point z(m) = A318438(m) + A318439(m)*i. A340669(m) is the negation of z in this representation. a(n) is how many n-bit m are negatable within those n bits, i.e., how many m in the range 0 <= m < 2^n have also 0 <= A340669(m) < 2^n.
A geometric interpretation of a(n) is to draw a unit square around each point z(0) to z(2^n-1), rotate a copy by 180 degrees about the origin, and measure its area of intersection with the original.
The bit-flip rule in A340669 gives the recurrence formula below. A low 0-bit of m has a(n-1) negatables above it, or low 11 is one arbitrary bit then negatables above so 2*a(n-3), or low 01 is three arbitrary so 8*a(n-5). This can be thought of the number of compositions of n (partitions with order) into parts 1,3,5 with 2 types of part 3 and 8 types of part 5.

Examples

			For n=3, the a(3)=3 points of n bits are m = 0,3,7 < 2^n, which negate to A340669(0,3,7) = 0,7,3 < 2^n.  These m are located at z = 0,i,-i,
               negate        intersection
  z(0..7)    (rotate 180)   a(3) = 3 points
                * *
   * *            * *             *
     o *        * o               o
   * *            * *             *
     * *
		

Crossrefs

Programs

  • PARI
    { my(table=[4,-2,-2,6, -4,2,2,-6], p=Mod('x,2-'x+'x^2));
    a(n) = (6<
    				

Formula

a(n) = a(n-1) + 2*a(n-3) + 8*a(n-5).
a(n) = (2/5)*2^n + (h/15)*2^floor(n/2) + (2/3)*Im((1/2 + i*sqrt(7)/2)^(n+1)) where h = 4,-2,-2,6, -4,2,2,-6 according as n == 0 to 7 (mod 8) respectively.
a(n) = (2/5)*2^n + (1/3)*A107920(n+1) + (1/15)*A078069(n+2).
G.f.: 1/(1 - x - 2*x^3 - 8*x^5).
G.f.: (2/5)/(1-2*x) + (1/3)/(1-x+2*x^2) + (2/15)*(2+3*x)/(1+2*x+2*x^2).

A340566 Square array, read by descending antidiagonals; T(n,k) is A001057(n) + A001057(k)*i, converted to complex binary (base -1 + i), where i=sqrt(-1).

Original entry on oeis.org

0, 11, 1, 111, 1110, 11101, 1110100, 111010, 10, 1100, 100, 1110101, 110, 1111, 11100, 1110111, 101, 11001, 111011, 11111, 1101, 110011, 1010, 11101001, 1000, 11101011, 111010010, 10001, 1110000, 111110, 1110110, 111000, 11000, 111010110, 11110, 111010000
Offset: 0

Views

Author

Davis Smith, Jan 11 2021

Keywords

Comments

Complex binary (base -1 + i) has the ability to express all positive or negative, real or complex, integers with only 2 numerical symbols ('0' and '1') as integers, without the need for a sign marking the integers as such.
Converting a real number, n, to complex binary requires one to convert it to base -4 ((n + N) xor N, N = floor(4/5*16^(ceiling(log_4(abs(n))) + 1))), then adding 10 to every digit greater than 1, then treating it as a number in base 16 and converting that to binary. (E.g., -5 => [2,3] => [12,13] => 205 => 11001101.)
Converting a complex number, n + k*i, requires one to convert X = n + k into complex binary and then convert k into the same but shift it one digit to the left. After this, one must add them together. This functions much the same way as binary addition, but the carry is '110' rather than '1' and 11 + 111 = 0.

Examples

			Square array T(n,k) begins:
  \k      0         1         2          3        4       5        6 ...
  n\
   0|     0        11       111    1110100      100 1110111   110011 ...
   1|     1      1110    111010    1110101      101    1010   111110 ...
   2| 11101        10       110      11001 11101001 1110110   110010 ...
   3|  1100      1111    111011       1000   111000    1011   111111 ...
   4| 11100     11111  11101011      11000 11101000   11011 11101111 ...
   5|  1101 111010010 111010110       1001   111001 1100110   100010 ...
   6| 10001     11110  11101010 1110100101    10101   11010 11101110 ...
		

References

  • T. Jamil, Complex Binary Number System, Springer, 2013.

Crossrefs

Programs

  • PARI
    A340566(n,k)={my(A001057(x)=if(x%2,x\2+1,-x/2),V=vecsum(Vec(matconcat(apply(w->my(Y=if(w,A001057(k), A001057(n)+A001057(k)));if(Y, my(X=floor(4^(2*logint(abs(Y), 4)+5)/5));Vecrev(binary(shift(fromdigits(apply(z->z+(10*(z>1)), digits(bitxor(Y+X,X),4)),16),w)))),[0,1])~)~))~);
    while(vecmax(V)>1,my(Z=Vec(select(x->x>1,V,1)));for(x=1,#Z,my(z=Z[x]);if(V[z]<=1,,(z+2<=#V)&&(V[z+1]>1)&&V[z+2],for(j=z,z+2,V[j]-=2^(j!=(z+2))),(z+4<=#V)&&vecmin(V[z+2..z+4]),V[z]-=2;for(j=z+2,z+4,V[j]-=1),z+1>#V,V[z]-=2;V=concat(V,[0,1,1]),V[z]-=2;for(j=z+2,z+3,if(j<=#V,V[j]+=1,V=concat(V,1))))));fromdigits(Vecrev(V))}
    
  • PARI
    { T(n,k) = my(z=n\/2*-(-1)^n + k\/2*-(-1)^k*I, ret=List([]));
      while(z, my(bit=(real(z)+imag(z))%2);
        listput(ret,bit); z=(z-bit)/(I-1));
      fromdigits(Vecrev(ret)); } \\ Kevin Ryde, Jan 12 2021

A355431 Numbers k whose binary expansion, when interpreted in base -1+i, gives a Gaussian prime.

Original entry on oeis.org

2, 5, 6, 9, 11, 13, 14, 15, 17, 19, 21, 23, 25, 27, 31, 33, 37, 39, 41, 43, 49, 51, 53, 57, 58, 59, 63, 69, 71, 73, 77, 81, 83, 89, 97, 99, 101, 111, 113, 117, 119, 123, 127, 129, 131, 133, 137, 139, 141, 147, 159, 163, 169, 177, 183, 191, 193, 197, 201, 207
Offset: 1

Views

Author

John-Vincent Saddic, Jul 17 2022

Keywords

Comments

Complex base -1+i is a bijection between integers k and Gaussian integers z(k) = A318438(k) + A318439(k)*i.
The present sequence is those k where z(k) is a Gaussian prime.
The Gaussian primes have an 8-way symmetry in the complex plane so that this sequence is also the Gaussian primes in the conjugate complex base -1-i.
The graphs on the complex plane (see links) show the Gaussian primes mapped and connected by lines in the order in which their indices appear in {a(n)}. The numbers in base -1+i tile the complex plane in the twin dragon fractal pattern, and the Gaussian primes are numerous such that the fractal is still discernible.
The only even terms are 2, 6, 14, and 58, since even terms correspond to Gaussian integers divisible by -1+i, and the base-(-1+i) expansions of -1+i, -1-i, 1+i, and 1-i are 10, 110, 1110, and 111010 respectively. - Jianing Song, Oct 02 2022

Examples

			123 is a term since z(123) = 2+7i is a Gaussian prime.
124 is not a term because z(124) = 2+4i is not a Gaussian prime.
		

Crossrefs

Cf. A066321 (real integers in base -1+i).

Programs

  • Julia
    # See links.
    
  • Python
    # See links.
Showing 1-6 of 6 results.