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

A019989 Indices n such that A307672(2*n) = 0.

Original entry on oeis.org

2, 5, 6, 8, 14, 15, 16, 18, 20, 23, 24, 26, 35, 41, 42, 43, 45, 47, 48, 49, 52, 54, 56, 59, 60, 62, 68, 69, 70, 72, 74, 77, 78, 80, 91, 98, 104, 105, 107, 116, 122, 123, 124, 126, 128, 129, 130, 133, 135, 137, 140, 141, 142, 144, 146, 147, 148, 154, 156
Offset: 0

Views

Author

Keywords

Comments

The original definition was: "A threequence, a 3-way partitioning of the integers: define a,b,c,A,B,C by a(0)=true, b(0)=c(0)=A(0)=B(0)=C(0)=false, a(n)=a(m) OR C(m) OR B(m), b(n)= b(m) OR A(m) OR C(m), c(n)= c(m) OR B(m) OR A(m), A(n)= A(m) OR b(m) OR c(m), B(n)= B(m) OR c(m) OR a(m), C(n)= C(m) OR a(m) OR b(m), where m = [ (n+1)/3 ]; sequence gives n such that a(2n) is true." - Bradley Klee, Apr 16 2019

Crossrefs

Programs

  • Mathematica
    iterate[sets_] := With[{ind = {{1, 5, 6}, {2, 6, 4}, {3, 4, 5}, {4, 3, 2}, {5, 1, 3}, {6, 2, 1}} }, Union @@ (3*sets[[#]] + {0, -1, 1}) & /@ ind];
    Part[Union @@ # & /@ Transpose[NestList[iterate, Append[Table[{}, 5], {1}], 10]], 1, 1 ;; 59]/2 (* Bradley Klee, Apr 15 2019 *) FractusRadius = {0 -> {4, 0, 5}, 1 -> {5, 1, 3}, 2 -> {3, 2, 4}, 3 -> {2, 3, 1}, 4 -> {0, 4, 2}, 5 -> {1, 5, 0}};
    aR0[n_] := Flatten[Position[ Nest[Part[Flatten[# /. FractusRadius], 2 ;; -1] &, {0}, n], 0] - 1][[2 ;; -1]]/2; aR0[5](* Bradley Klee, Apr 16 2019 *)

Extensions

New name from Sean A. Irvine, Apr 30 2019

A019990 Indices n such that A307672(2*n) = 2.

Original entry on oeis.org

1, 3, 4, 7, 9, 11, 12, 13, 19, 21, 22, 25, 27, 29, 32, 33, 34, 36, 38, 39, 40, 46, 55, 57, 58, 61, 63, 65, 66, 67, 73, 75, 76, 79, 81, 83, 86, 87, 89, 95, 96, 97, 99, 101, 102, 103, 106, 108, 110, 113, 114, 115, 117, 119, 120, 121, 127, 136, 138, 139, 145
Offset: 0

Views

Author

Keywords

Comments

The original definition was: "A threequence, a 3-way partitioning of the integers: define a,b,c,A,B,C by a(0)=true, b(0)=c(0)=A(0)=B(0)=C(0)=false, a(n)=a(m) OR C(m) OR B(m), b(n)= b(m) OR A(m) OR C(m), c(n)= c(m) OR B(m) OR A(m), A(n)= A(m) OR b(m) OR c(m), B(n)= B(m) OR c(m) OR a(m), C(n)= C(m) OR a(m) OR b(m), where m = [ (n+1)/3 ]; sequence gives n such that b(2n) is true." - Sean A. Irvine, Apr 30 2019

Crossrefs

Extensions

New name from Sean A. Irvine, Apr 30 2019

A019991 Indices n such that A307672(2*n) = 4.

Original entry on oeis.org

10, 17, 28, 30, 31, 37, 44, 50, 51, 53, 64, 71, 82, 84, 85, 88, 90, 92, 93, 94, 100, 109, 111, 112, 118, 125, 131, 132, 134, 143, 149, 150, 151, 153, 155, 158, 159, 161, 172, 179, 190, 192, 193, 199, 206, 212, 213, 215, 226, 233, 244, 246, 247, 250
Offset: 0

Views

Author

Keywords

Comments

The original definition was: "A threequence, a 3-way partitioning of the integers: define a,b,c,A,B,C by a(0)=true, b(0)=c(0)=A(0)=B(0)=C(0)=false, a(n)=a(m) OR C(m) OR B(m), b(n)= b(m) OR A(m) OR C(m), c(n)= c(m) OR B(m) OR A(m), A(n)= A(m) OR b(m) OR c(m), B(n)= B(m) OR c(m) OR a(m), C(n)= C(m) OR a(m) OR b(m), where m = [ (n+1)/3 ]; sequence gives n such that c(2n) is true." - Sean A. Irvine, Apr 30 2019

Crossrefs

Extensions

More terms from Sean A. Irvine, Apr 15 2019
New name from Sean A. Irvine, Apr 30 2019

A156595 Fixed point of the morphism 0->011, 1->010.

Original entry on oeis.org

0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0
Offset: 0

Views

Author

Keywords

Comments

Start with 0 and apply the morphism 0->011 and 1->010 repeatedly.
This sequence draws the Sierpinski gasket, when iterating the following odd-even drawing rule: If "1" then draw a segment forward, if "0" then draw a segment forward and turn 120 degrees right if in odd position or left if in even position.
From Dimitri Hendriks, Jun 29 2010: (Start)
This sequence is the first difference of the Mephisto Waltz A064990, i.e., a(n) = A064990(n) + A064990(n+1), where '+' is addition modulo 2.
This sequence can also be generated as a Toeplitz word: First consider the periodic word 0,1,$,0,1,$,0,1,$,... and then fill the gaps $ by the bitwise negation of the sequence itself: 0,1,1,0,1,0,0,1,0,.... See the Allouche/Bacher reference for a precise definition of Toeplitz sequences. (End)
From Joerg Arndt, Jan 21 2013: (Start)
Identical to the morphism 0-> 011010010, 1->011010011 given on p. 100 of the Fxtbook (see link), because 0 -> 011 -> 011010010 and 1 -> 010 -> 011010011.
This sequence gives the turns (by 120 degrees) of the R9-dragon curve (displayed on p. 101) which can be rendered as follows:
[Init] Set n=0 and direction=0.
[Draw] Draw a unit line (in the current direction). Turn left/right if a(n) is zero/nonzero respectively.
[Next] Set n=n+1 and goto (draw).
(End)

Examples

			0 -> 0,1,1 -> 0,1,1,0,1,0,0,1,0 -> ...
		

References

  • M. Lothaire, Combinatorics on words.

Crossrefs

Cf. A278996 (indices of 0's), A278997 (indices of 1's), A189717 (partial sums).
Cf. A189628 (morphisms guide).
Cf. A307672 (draws curves that align with the Sierpinski gasket).

Programs

  • Mathematica
    Nest[ Flatten[ # /. {0 -> {0, 1, 1}, 1 -> {0, 1, 0}}] &, {0}, 10]
    SubstitutionSystem[{0->{0,1,1},1->{0,1,0}},0,{5}][[1]] (* Harvey P. Dale, Jan 15 2022 *)
  • Python
    from sympy import integer_log
    def A156595(n): return sum(((m:=(n+1)//9**i)-2)//9+(m-3)//9+(m-5)//9+(m-8)//9+4 for i in range(integer_log(n+1,9)[0]+1))-sum(((m:=n//9**i)-2)//9+(m-3)//9+(m-5)//9+(m-8)//9+4 for i in range(integer_log(n,9)[0]+1)) if n else 0 # Chai Wah Wu, Feb 16 2025

Formula

a(3k-2)=0, a(3k-1)=1, a(3k)=1-a(k) for k>=1, a(0)=0. - Clark Kimberling, Apr 28 2011

A307744 A fractal function, related to ruler functions and the Cantor set. a(1) = 0; for m >= 0, a(3m) = 1; for m >= 1, a(3m-1) = a(m-1) + sign(a(m-1)), a(3m+1) = a(m+1) + sign(a(m+1)).

Original entry on oeis.org

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

Views

Author

Peter Munn, Apr 26 2019

Keywords

Comments

The sequence extends to negative n by defining a(n) = a(-n).
For k >= 1 numbers 1..k occur with the same periodic and mirror symmetries as in ruler function A051064, in which k occurs 3 times more frequently than k+1. Here k occurs 3/2 times more frequently than k+1, precisely 2^(k-1) times in every 3^k terms. 0 has asymptotic density 0. Taking a trisection shows some scale symmetry, again comparable to ruler functions, as illustrated in the example section.
The links include a pin plot of a(0..162) aligned above an inverted plot of A051064 (the emphatic marking of 0's is significant). Between each n_k where A051064(n_k) = k >= 2 and the nearest n_k' where A051064(n_k') > k (or n_k' = 0 if nearer), there are 2^(k-2) indices where k occurs in this sequence, forming a 2^(k-2)-tuple. The 2^(k-2)-tuples have identical patterns and each has symmetry about an n_(k-1) where A051064(n_(k-1)) = k-1.
For a given k, the tuples described above are periodic with two per fundamental period, and the closest pairs of these tuples jointly form the pattern of one of the equivalent tuples for k+1. These patterns relate to the nonperiodic pattern for 0's and to the Cantor set as follows.
Let S_k be the sequence of positive indices at which k occurs, with 3^(k-2) subtracted when k >= 2. Given its ruler-type symmetries, S_k k >= 2 is determined by its first 2^(k-2) terms, which are the same as the first 2^(k-2) terms of S_i for i > k. The limiting sequence as k goes to infinity is S_0, which is A191108. {A191108(i)/(2*3^k) | 1 <= i <= 2^k} is the set of center points of the intervals deleted at step k+1 when generating the Cantor ternary set. This leads to the following scaling property.
Define c: Z -> P(R) so that c(n) is the scaled and translated Cantor ternary set spanning [n-1, n+1], and let C_k be the union of c(n) for all integer n with a(n) = k. Clearly C_1 consists of a scaled Cantor set repeated with period 3. (The set's two nonempty thirds occur at alternating intervals of 4/3 and 5/3.) For k >= 1, C_k is C_1 scaled by 3^(k-1), consisting therefore of a scaled Cantor set repeated with period 3^k. C_0 is special: C_0 = (C_0)*3 = (C_0)/3 = -C_0. Specifically, (C_0)/2 is the closure of the Cantor ternary set under multiplication by 3 and by -1.
Take a Sierpinski arrowhead curve formed of unit edges numbered consecutively from 0 at its axis of symmetry and aligned with an infinite Sierpinski gasket so that each edge is contained in the boundary of either the plane sector occupied by the gasket or a triangular region of the gasket's complement. If a(n) = 0, the n-th edge is contained in the sector boundary, otherwise the relevant triangular region seems to have side 2^(a(n)-1). See A307672 for a fuller description. The conjectured formulas below (that use A094373) derive from summing areas of regions within the gasket. - Corrected by Peter Munn, Aug 09 2019
From Charlie Neder, Jul 05 2019: (Start)
For each n, define the "2-balanced ternary expansion" E(n) as follows:
- E(n) begins with 0 or 1, according to the parity of n.
- The following digits are +, 0, or - as in standard balanced ternary, except + and - correspond to +2 and -2, respectively.
For example, we have E(4) = 0+-, E(7) = 10-, and E(13) = 1+-.
Then a(n) is the distance from the end of the rightmost 0, counting the last digit as 1, or 0 if 0 never appears. (End)

Examples

			As 4 is congruent to 1 modulo 3, a(4) = a(3*1 + 1) = a(1+1) + sign (a(1+1)) = a(2) + sign(a(2)).
As 2 is congruent to -1 modulo 3, a(2) = a(3*1 - 1) = a(1-1) + sign (a(1-1)) = a(0) + sign(a(0)).
As 0 is congruent to 0 modulo 3, a(0) = 1.  So a(2) = a(0) + sign(a(0)) = 1 + 1 = 2.  So a(4) = a(2) + sign(a(2)) = 2 + 1 = 3.
For any m, the sequence from 9m - 9 to 9m + 9 can be represented by the table below. x, y and z represent distinct integers unless m = 0, in which case x = z = 0. Distinct values are shown in their own column to highlight patterns.
  n     a(n)
9m-9   1
9m-8          y     - starts pattern (9m-8, 9m-4, 9m+4, 9m+8)
9m-7    2
9m-6   1
9m-5       x
9m-4          y
9m-3   1
9m-2    2
9m-1       x        - ends pattern (9m-17, 9m-13, 9m-5, 9m-1)
9m     1
9m+1             z  - starts pattern (9m+1, 9m+5, 9m+13, 9m+17)
9m+2    2
9m+3   1
9m+4          y
9m+5             z
9m+6   1
9m+7    2
9m+8          y     - ends pattern (9m-8, 9m-4, 9m+4, 9m+8)
9m+9   1
For all m, one of x, y, z represents 3 in this table. Note the identical patterns indicated for "x", "y", "z" quadruples, and how the "x" quadruple ends 2 before the "z" quadruple starts, with the "y" quadruple overlapping both. For k >= 1, there are equivalent 2^k-tuples that overlap similarly, notably (3m-2, 3m+2) for all m.
Larger 2^k-tuples look more fractal, more obviously related to the Cantor set. See the pin plot of a(0..162) aligned above an inverted plot of ruler function A051064 in the links. 0's are emphasized with a fainter line running off the top of the plot, partly because 0 is used here as a conventional value and occurs with some properties (such as zero asymptotic density) that could be considered appropriate to the largest rather than smallest value in the sequence.
The table below illustrates the symmetries of scale of this sequence and ruler function A051064. Note the column for this sequence is indexed by k+1, 3k+1, 9k+1, whereas that for A051064 is indexed by k, 3k, 9k.
                         a(n+1)                   A051064(n)
n=k, k=16..27    0,1,3,2,1,4,3,1,2,4,1,5    1,1,3,1,1,2,1,1,2,1,1,4
n=3k,k=16..27    0,2,4,3,2,5,4,2,3,5,2,6    2,2,4,2,2,3,2,2,3,2,2,5
n=9k,k=16..27    0,3,5,4,3,6,5,3,4,6,3,7    3,3,5,3,3,4,3,3,4,3,3,6
		

Crossrefs

Sequences with similar definitions: A309054, A335933.
A055246, A191108, A306556 relate to the Cantor set.

Programs

  • PARI
    a(n) = if (n==1, 0, my(m=n%3); if (m==0, 1, my(kk = (if (m==1, a(n\3+1), a((n-2)\3)))); kk + sign(kk)));
    for (n=0, 100, print1(a(n), ", ")) \\ Michel Marcus, Jul 06 2019

Formula

Alternative definition: (Start)
a(m*3^k - 3^(k-1) + A191108(i)) = k for k >= 1, 1 <= i <= 2^(k-1), all integer m.
a(A191108(i)) = a(-A191108(i)) = 0 for i >= 1.
(End)
if a(n) = k >= 1, a(3^k+n) = a(3^k-n) = k.
a(n) = a(12*3^k + n) for k >= 0, 0 <= n <= 3^k.
if a(n) = a(n') and a(n+1) = a(n'+1) then a(n*3^k + i) = a(n'*3^k + i) for k >= 0, 0 <= i <= 3^k.
a((m-1)*3^k + 1) = a((m+1)*3^k - 1) for k >= 1, all integer m.
Upper bound relations: (Start)
for k >= 2, let m_k = A034472(k-2) = 3^(k-2)+1.
a(n) < k, for -m_k < n < m_k.
a(-m_k) = a(m_k) = k.
(End)
for k>=0, a( 3^k-1) = k+1, a( 3^k+1) = k+2.
for k>=0, a(2*3^k-1) = 0, a(2*3^k+1) = k+1.
for k>=0, a(4*3^k-1) = k+1, a(4*3^k+1) = 0.
for k>=0, a(5*3^k-1) = k+3, a(5*3^k+1) = k+1.
for k>=0, a(7*3^k-1) = k+1, a(7*3^k+1) = k+3.
for k>=0, a(8*3^k-1) = k+2, a(8*3^k+1) = k+1.
A051064(i) = min{a(n) : |n-i| = 1, a(n) > 0}.
A055246(i+1) = min{n : n > A055246(i) + 1, a(n) = a(A055246(i) + 1)}.
Sum_{n=-3^k..3^k-1} A094373(a(n)) = 3 * 4^k (conjectured).
Sum_{n=-3m..3m-1} A094373(a(n)) = 4 * Sum_{n=-m..m-1} A094373(a(n)) (conjectured).
From Charlie Neder, Jul 05 2019: (Start)
Let P(n) be the power of 3 (greater than 1) closest to n and T(n) be the distance from the end - counting the last digit as 1 - of the rightmost 0 in the balanced ternary expansion of n.
If n is even, a(n) = T(n/2).
If n is odd, a(n) = T((P(n)-n)/2), or 0 if this number exceeds log_3(P(n)). (End)

A309054 a(1) = 0; for m >= 0, a(3m) = 1; for m >= 1, a(3m-1) = 2*a(m-1), a(3m+1) = 2*a(m+1).

Original entry on oeis.org

1, 0, 2, 1, 4, 0, 1, 2, 4, 1, 8, 2, 1, 0, 8, 1, 2, 0, 1, 4, 2, 1, 8, 4, 1, 2, 8, 1, 16, 2, 1, 4, 16, 1, 2, 4, 1, 0, 2, 1, 16, 0, 1, 2, 16, 1, 4, 2, 1, 0, 4, 1, 2, 0, 1, 8, 2, 1, 4, 8, 1, 2, 4, 1, 16, 2, 1, 8, 16, 1, 2, 8, 1, 4, 2, 1, 16, 4, 1, 2, 16, 1, 32, 2, 1
Offset: 0

Views

Author

Peter Munn, Jul 09 2019

Keywords

Comments

The sequence extends to negative n by defining a(n) = a(-n).
Consider a Sierpinski arrowhead curve formed of unit edges numbered consecutively from 0 at its axis of symmetry and aligned with an infinite Sierpinski gasket so that each edge is contained in the boundary of either the plane sector occupied by the gasket or a triangular region of the gasket's complement. If a(n) = 0, the n-th edge is contained in the sector boundary, otherwise the relevant triangular region has side a(n). Every length 3 segment of these boundaries contains exactly one edge of the arrowhead curve. A191108 lists positive n such that edge n is contained in the plane sector boundary. See A307672 for further properties.
See the graphic (in the links) of the arrowhead curve aligned with the gasket. Note the even-indexed edges (colored red) are the edges contained in a triangular region boundary on the left side of the vector. - Peter Munn, Jul 29 2019
a(n) = 0 if A307744(n) = 0, otherwise a(n) = 2^(A307744(n) - 1). Thus, this sequence has the symmetries of A307744, which are similar to ruler functions (especially A051064) and described further in A307744.
When listening to this, set pitch modulus to 35 or 36.

Examples

			As 4 is congruent to 1 modulo 3, a(4) = a(3*1 + 1) = 2*a(1+1) = 2*a(2).
As 2 is congruent to -1 modulo 3, a(2) = a(3*1 - 1) = 2*a(1-1) = 2*a(0).
As 0 is congruent to 0 modulo 3, a(0) = 1.  So a(2) = 2*a(0) = 2*1 = 2.  So a(4) = 2*a(2) = 2*2 = 4.
		

Crossrefs

Formula

a(n) = 0 if A307744(n) = 0, otherwise a(n) = 2^(A307744(n) - 1).
a(A191108(i)) = 0 for i >= 1.
if a(n) = 2^k, a(3^(k+1)+n) = a(3^(k+1)-n) = 2^k.
a((m-1)*3^k + 1) = a((m+1)*3^k - 1) for k >= 1, all integer m.
Upper bound relations: (Start)
for k >= 1, let m_k = A034472(k-1) = 3^(k-1)+1.
a(n) < 2^k, for -m_k < n < m_k.
a(-m_k) = a(m_k) = 2^k.
(End)
Sum_{n=-3^k..3^k-1} (a(n) + 1) = 3 * 4^k.
Sum_{n=-3m..3m-1} (a(n) + 1) = 4 * Sum_{n=-m..m-1} (a(n) + 1) (conjectured).

A308364 a(0) = 0, a(3n) = a(n), a(3n+1) = a(n)*3 + 1, a(3n-1) = a(n)*3 - 1.

Original entry on oeis.org

0, 1, 2, 1, 4, 5, 2, 7, 2, 1, 4, 11, 4, 13, 14, 5, 16, 5, 2, 7, 20, 7, 22, 5, 2, 7, 2, 1, 4, 11, 4, 13, 32, 11, 34, 11, 4, 13, 38, 13, 40, 41, 14, 43, 14, 5, 16, 47, 16, 49, 14, 5, 16, 5, 2, 7, 20, 7, 22, 59, 20, 61, 20, 7, 22, 65, 22, 67, 14, 5, 16, 5, 2, 7, 20, 7, 22, 5, 2, 7, 2, 1
Offset: 0

Views

Author

Peter Munn, May 22 2019

Keywords

Comments

Defines a function on all the integers, but only nonnegative terms are in the data. A147991 gives the nonnegative fixed points of the function and the nonnegative part of its image.
Consider a Sierpinski arrowhead curve to be formed of vectors placed head to tail and numbered consecutively from 0 at its axis of symmetry. Vector a(n) equals vector n.
Removing all 0's from the balanced ternary expansion of n yields a(n). - Charlie Neder, Jun 03 2019

Examples

			As 6 is congruent to 0 modulo 3, a(6) = a(3*2) = a(2).
As 2 is congruent to -1 modulo 3, a(2) = a(3*1 - 1) = a(1)*3 - 1.
As 1 is congruent to 1 modulo 3, a(1) = a(0*1 + 1) = a(0)*3 + 1 = 0*3 + 1 = 1.
So a(2) = a(1)*3 - 1 = 1*3 - 1 = 2. So a(6) = a(2) = 2.
		

Crossrefs

Programs

  • Magma
    a:=[1]; for n in [2..80] do  if n mod 3 eq 2 then a[n]:= 3*a[(n+1) div 3]-1; end if; if n mod 3 eq 1 then a[n]:=3*a[(n-1) div 3]+1; end if; if n mod 3 eq 0 then a[n]:=a[n div 3]; end if; end for; [0] cat a; // Marius A. Burtea, Nov 14 2019
  • PARI
    a(n) = if (n == 0, 0, r = n%3; if (r==0, a(n/3), if (r==1, 3*a((n-1)/3)+1, 3*a((n+1)/3)-1))); \\ Michel Marcus, May 29 2019
    

Formula

a(-n) = - a(n).
A307672(a(n)) = A307672(n).
a(A147991(n)) = A147991(n).
a(9n-1) = a(9n-3). a(9n+1) = a(9n+3).

A334483 a(n) is the X-coordinate of the n-th point of the Sierpinski arrowhead curve; sequence A334484 gives Y-coordinates.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, May 03 2020

Keywords

Comments

Coordinates are given on a hexagonal lattice with X-axis and Y-axis as follows:
Y
/
/
0 ---- X
The Sierpinski arrowhead curve can be represented using an L-system.

Examples

			The Sierpinski arrowhead curve starts (on a hexagonal lattice) as follows:
                         +
                        27\
                           \
                            +
                           /26
                          /
                    +----+
                   /24   25
                  /
                 +          +----+
                23\        /20  19\
                   \      /        \
                    +----+          +
                    22   21        /18
                                  /
            +----+               +
           /4    5\             17\
          /        \               \
         +          +               +----+
         3\        /6               16  15\
           \      /                        \
            +    +          +----+          +
           /2    7\        /10  11\        /14
          /        \      /        \      /
    +----+          +----+          +----+
    0    1          8    9          12   13
- hence a(6) = a(7) = a(20) = a(21) = 2.
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

A262174(1 + a(n) + A334484(n), 1 + A334484(n)) = 1 + n for any n >= 0.

A108964 Write n in balanced ternary notation, omit any zeros and form the left-to-right alternating sum mod 3.

Original entry on oeis.org

0, 1, 2, 1, 0, 1, 2, 0, 2, 1, 0, 2, 0, 1, 2, 1, 0, 1, 2, 0, 1, 0, 2, 1, 2, 0, 2, 1, 0, 2, 0, 1, 0, 2, 1, 2, 0, 1, 2, 1, 0, 1, 2, 0, 2, 1, 0, 2, 0, 1, 2, 1, 0, 1, 2, 0, 1, 0, 2, 0, 1, 2, 1, 0, 2, 1, 2, 0, 2, 1, 0, 1, 2, 0, 1, 0, 2, 1, 2, 0, 2, 1, 0, 2, 0, 1, 0, 2, 1, 2, 0, 1, 2, 1, 0, 2, 0, 1, 0, 2, 1, 0, 1, 2, 0, 2
Offset: 0

Views

Author

Bill Gosper, Jul 22 2005

Keywords

Comments

This sequence and A036581 are squarefree (they do not contain any substring XX).
Appears to be A307672(n) mod 3. - Peter Munn, Aug 22 2021

Examples

			1="1", so a(1)=1; 2=3-1="1,-1", so a(2)=2; 3=3="1,0", so a(3)=1; 4=3+1="1,1", so a(4)=0; ...
		

Crossrefs

Programs

  • Maple
    a:= proc(n) local d, i, m, l; m:=n; l:=[];
          for i from 0 while m>0 do
             d:= irem(m, 3, 'm');
             if d=2 then m:=m+1; d:=-1 fi;
             if d<>0 then l:=[d, l[]] fi
          od;
          add(l[i]*(-1)^(i-1), i=1..nops(l)) mod 3
        end:
    seq(a(n), n=0..105);  # Alois P. Heinz, May 11 2015
  • Mathematica
    a[n_] := Module[{d, i, m = n, l = {}}, For[i = 0, m>0, i++, d = Mod[m, 3]; m = Quotient[m, 3]; If[d==2, m++; d = -1]; If[d != 0, l = Prepend[l, d]]]; Mod[Sum[l[[i]] (-1)^(i-1), {i, 1, Length[l]}], 3]];
    a /@ Range[0, 105] (* Jean-François Alcover, Nov 18 2020, after Alois P. Heinz *)

Extensions

More terms from Alois P. Heinz, May 11 2015
Showing 1-9 of 9 results.