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.

A332204 a(n) is the real part of f(n) defined by f(0) = 0, and f(n+1) = f(n) + g((1+i)^(A065359(n) mod 8)) (where g(z) = z/gcd(Re(z), Im(z)) and i denotes the imaginary unit).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 9, 10, 11, 12, 13, 14, 15, 15, 16, 17, 17, 16, 17, 17, 18, 19, 20, 21, 22, 22, 23, 24, 25, 26, 26, 27, 28, 29, 30, 31, 31, 32, 31, 31, 32, 33, 33, 34, 35, 36, 37, 38, 39, 39, 40, 41, 42, 43, 43, 44, 45, 46, 47, 48, 49, 49, 50
Offset: 0

Views

Author

Rémy Sigrist, Feb 07 2020

Keywords

Comments

The representation of {f(n)} resembles a Koch curve (see illustrations in Links section).
The sequence A065359 mod 8 gives the direction at each step as follows:
3 2 1
\ | /
\ | /
\|/
4 ------.------ 0
5 6 7
We can also build {f(n)} with A096268 as follows:
- start at the origin looking to the right,
- for k=0, 1, ...:
- move forward to the next lattice point
(this point is at distance 1 or sqrt(2)),
- if A096268(k)=0
then turn 45 degrees to the left
otherwise turn 90 degrees to the right,
- this connects the first differences of A065359 and A096268.

Examples

			The first terms, alongside f(n) and A065359(n), are:
  n   a(n)  f(n)   A065359(n)
  --  ----  -----  ----------
   0     0      0           0
   1     1      1           1
   2     2    2+i          -1
   3     3      3           0
   4     4      4           1
   5     5    5+i           2
   6     5  5+2*i           0
   7     6  6+2*i           1
   8     7  7+3*i          -1
   9     8  8+2*i           0
  10     9  9+2*i          -2
  11     9    9+i          -1
  12    10     10           0
  13    11     11           1
  14    12   12+i          -1
  15    13     13           0
  16    14     14           1
		

Crossrefs

Cf. A065359, A096268, A217730, A332205 (imaginary part), A332206 (where f is real).

Programs

  • Mathematica
    A065359[0] = 0;
    A065359[n_] := -Total[(-1)^PositionIndex[Reverse[IntegerDigits[n, 2]]][1]];
    g[z_] := z/GCD[Re[z], Im[z]];
    Module[{n = 0}, Re[NestList[# + g[(1+I)^A065359[n++]] &, 0, 100]]] (* Paolo Xausa, Aug 28 2024 *)
  • PARI
    \\ See Links section.

Formula

a(2^k) = A217730(k) for any k >= 0.
a(4^k+m) + a(m) = A217730(2*k) for any k >= 0 and m = 0..4^k.

A332205 a(n) is the imaginary part of f(n) defined by f(0) = 0, and f(n+1) = f(n) + g((1+i)^(A065359(n) mod 8)) (where g(z) = z/gcd(Re(z), Im(z)) and i denotes the imaginary unit).

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 2, 2, 3, 2, 2, 1, 0, 0, 1, 0, 0, 1, 2, 2, 3, 4, 5, 6, 7, 7, 8, 7, 7, 8, 9, 9, 10, 9, 9, 8, 7, 7, 8, 7, 7, 6, 5, 4, 3, 2, 2, 1, 0, 0, 1, 0, 0, 1, 2, 2, 3, 2, 2, 1, 0, 0, 1, 0, 0, 1, 2, 2, 3, 4, 5, 6, 7, 7, 8, 7, 7, 8, 9, 9, 10, 11, 12, 13, 14
Offset: 0

Views

Author

Rémy Sigrist, Feb 07 2020

Keywords

Comments

Looks much like A005536, in particular in respect of its symmetries of scale (compare the scatterplots). - Peter Munn, Jun 21 2021

Crossrefs

Cf. A005536, A007052, A065359, A332204 (real part and additional comments), A332206 (positions of 0's, cf. A001196).

Programs

  • Mathematica
    A065359[0] = 0;
    A065359[n_] := -Total[(-1)^PositionIndex[Reverse[IntegerDigits[n, 2]]][1]];
    g[z_] := z/GCD[Re[z], Im[z]];
    Module[{n = 0}, Im[NestList[# + g[(1+I)^A065359[n++]] &, 0, 100]]] (* Paolo Xausa, Aug 28 2024 *)
  • PARI
    \\ See Links section.

Formula

a(2^(2*k-1)) = A007052(k) for any k >= 0.
a(4^k-m) = a(m) for any k >= 0 and m = 0..4^k.

A335359 a(n) is the Y-coordinate of the n-th point of the Koch curve; sequence A335358 gives X-coordinates.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 2, 2, 3, 2, 2, 1, 0, 0, 1, 0, 0, 1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 6, 6, 7, 8, 8, 9, 8, 8, 7, 6, 6, 7, 6, 6, 5, 4, 4, 3, 2, 2, 1, 0, 0, 1, 0, 0, 1, 2, 2, 3, 2, 2, 1, 0, 0, 1, 0, 0, 1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 6, 6, 7, 8, 8, 9, 10, 10, 11, 12
Offset: 0

Views

Author

Rémy Sigrist, Jun 03 2020

Keywords

Comments

Coordinates are given on a hexagonal lattice with X-axis and Y-axis as follows:
Y
/
/
0 ---- X

Examples

			The Koch curve starts (on a hexagonal lattice) as follows:
   .   .   .   .   .   .   +   .   .   .   .   .   .
                          /8\
     .   .   .   .   +---+   +---+   .   .   .   .
                     6\  7   9  /10
   .   .   .   +   .   +   .   +   .   +   .   .   .
              /2\     /5        \     / \
     .   +---+   +---+   .   .   +---+   +---+   .
         0   1   3   4           12  13  15  16
Hence, a(6) = a(7) = a(9) = a(10) = 2.
		

Crossrefs

Programs

  • PARI
    { hex = [1,I,I-1,-1,-I,1-I]; z=0; for (n=0, 84, print1 (imag(z)", "); q=digits(n, 4); d=sum(k=1, #q, if (q[k]==1, +1, q[k]==2, -1, 0)); z+=hex[1+d%#hex]) }

Formula

a(n) = 0 iff n belongs to A332206.
Showing 1-3 of 3 results.