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

A324473 k appears A278045(k)+1 times.

Original entry on oeis.org

1, 2, 2, 3, 4, 4, 4, 5, 6, 6, 7, 7, 7, 7, 8, 9, 9, 10, 11, 11, 11, 1, 13, 13, 13, 13, 14, 15, 15, 16, 17, 17, 17, 18, 189, 19, 20, 20, 20, 20, 21, 22, 22, 23, 24, 24, 24, 24, 24, 24, 25, 26, 26, 27, 28, 28, 28, 29, 30, 30
Offset: 1

Views

Author

N. J. A. Sloane, Mar 07 2019

Keywords

Comments

Each k appears one more times than the number of trailing zeros in the tribonacci representation of n (see A278038).
This is related to the tribonacci representation of n in the same way as A046699 (without its initial term) is related to the binary representation of n and as A316628 is to the Zeckendorf representation of n.

Crossrefs

A080843 Tribonacci word: limit S(infinity), where S(0) = 0, S(1) = 0,1, S(2) = 0,1,0,2 and for n >= 0, S(n+3) = S(n+2) S(n+1) S(n).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Mar 29 2003

Keywords

Comments

An Arnoux-Rauzy or episturmian word.
From N. J. A. Sloane, Jul 10 2018: (Start)
The initial terms in a form suitable for copying:
0,1,0,2,0,1,0,0,1,0,2,0,1,0,1,0,2,0,1,0,0,1,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,a,a,b,a,c,a,b,a,c,a,
b,a,a,b,a,c,a,b,a,b,a,c,a,b,a,a,b,a,c,a,b,a,b,a,c,a,b,a,a,b,a,c,a,b,a,c,a,
b,a,a,b,a,c,a,b,a,b,a,c,a,b,a,a,b,a,c,a,b,a,a,b,a,c,a,b,a,b,a,c,a,b,a,a,b,
... (End)
From Wolfdieter Lang, Aug 14 2018: (Start)
The substitution sequence 0 -> 0, 1; 1-> 0, 2; 2 -> 0 read as an irregular triangle with rows l >= 1 and length T(l+2), with the tribonacci numbers T = A000073, leads to the tribonacci tree TriT with level TriT(l) for l >= 1 given by a(0), a(1), ..., a(T(l+2)-1).
E.g., l = 4: 0 1 0 2 0 1 0 with T(6) = 7 leaves (nodes). See the example below.
This tree can be used to find the tribonacci representation of nonnegative n given in A278038, call it ZTri(n) (Z for generalized Zeckendorf), by replacing every 2 by 1, and reading from bottom to top, omitting the final 0, except for n = 0 which is represented by 0. See the example below. (End)

Examples

			From _Joerg Arndt_, Mar 12 2013: (Start)
The first few steps of the substitution are
Start: 0
Rules:
  0 --> 01
  1 --> 02
  2 --> 0
-------------
0:   (#=1)
  0
1:   (#=2)
  01
2:   (#=4)
  0102
3:   (#=7)
  0102010
4:   (#=13)
  0102010010201
5:   (#=24)
  010201001020101020100102
6:   (#=44)
  01020100102010102010010201020100102010102010
7:   (#=81)
  010201001020101020100102010201001020101020100102010010201010201001020102010010201
(End)
From _Wolfdieter Lang_, Aug 14 2018: (Start)
The levels l of the tree TriT begin (the branches (edges) have been omitted):
Substitution rule: 0 -> 0 1; 1 -> 0 2; 2 -> 0.
l=1:                                 0
l=2:                  0                                 1
l=3:             0             1                  0             2
l=4:         0      1       0     2          0       1          0
l=5:      0    1  0   2   0   1   0        0   1   0   2      0    1
...
----------------------------------------------------------------------------------
n =       0    1  2   3   4   5   6        7   8   9  10     11   12
The tribonacci representation of n >= 0 (A278038; here at level 5 for n = 0.. 12) is obtained by reading from bottom to top (along the branches not shown) replacing 2 with 1, omitting the last 0 except for n = 0.
          0    1  0   1   0   1   0        0   1   0  1      0    1
                  1   1   0   0   1        0   0   1  1      0    0
                          1   1   1        0   0   0  0      1    1
                                           1   1   1  1      1    1
E.g., ZTri(9) = A278038(9) = 1010. (End)
		

References

  • The entry A092782 has a more complete list of references and links. - N. J. A. Sloane, Aug 17 2018
  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 246.

Crossrefs

Cf. A003849 (the Fibonacci word), A092782.
See A092782 for a version over the alphabet {1,2,3}.
See A278045 for another construction.
First differences: A317950. Partial sums: A319198.

Programs

  • Maple
    M:=17; S[1]:=`0`; S[2]:=`01`; S[3]:=`0102`;
    for n from 4 to M do S[n]:=cat(S[n-1], S[n-2], S[n-3]); od:
    t0:=S[M]: l:=length(t0); for i from 1 to l do lprint(i,substring(t0,i..i)); od:
    # N. J. A. Sloane, Nov 01 2006
    # A version that uses the letters a,b,c:
    M:=10; B[1]:=`a`; B[2]:=`ab`; B[3]:=`abac`;
    for n from 4 to M do B[n]:=cat(B[n-1], B[n-2], B[n-3]); od:
    B[10]; # N. J. A. Sloane, Oct 30 2018
  • Mathematica
    Nest[Flatten[ # /. {0 -> {0, 1}, 1 -> {0, 2}, 2 -> {0}}] &, {0}, 8] (* updated by Robert G. Wilson v, Nov 07 2010 *)
    SubstitutionSystem[{0->{0,1},1->{0,2},2->{0}},{0},{8}]//Flatten (* Harvey P. Dale, Nov 21 2021 *)
  • PARI
    strsub(s, vv, off=0)=
    {
        my( nl=#vv, r=[], ct=1 );
        while ( ct <= #s,
            r = concat(r, vv[ s[ct] + (1-off) ] );
            ct += 1;
        );
        return( r );
    }
    t=[0];  for (k=1, 10, t=strsub( t, [[0,1], [0,2], [0]], 0 ) );  t
    \\ Joerg Arndt, Sep 14 2013

Formula

Fixed point of morphism 0 -> 0, 1; 1 -> 0, 2; 2 -> 0.
a(n) = A092782(n+1) - 1. - Joerg Arndt, Sep 14 2013

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 06 2003

A356749 a(n) is the number of trailing 1's in the dual Zeckendorf representation of n (A104326).

Original entry on oeis.org

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

Views

Author

Amiram Eldar, Aug 25 2022

Keywords

Comments

The asymptotic density of the occurrences of k = 0, 1, 2, ... is 1/phi^(k+2), where phi = 1.618033... (A001622) is the golden ratio.
The asymptotic mean of this sequence is phi.

Examples

			  n  a(n)  A104326(n)
  -  ----  ----------
  0     0           0
  1     1           1
  2     0          10
  3     2          11
  4     1         101
  5     0         110
  6     3         111
  7     0        1010
  8     2        1011
  9     1        1101
		

Crossrefs

Similar sequences: A003849, A035614, A276084, A278045.

Programs

  • Mathematica
    fb[n_] := Module[{k = Ceiling[Log[GoldenRatio, n*Sqrt[5]]], t = n, fr = {}}, While[k > 1, If[t >= Fibonacci[k], AppendTo[fr, 1]; t = t - Fibonacci[k], AppendTo[fr, 0]]; k--]; fr]; f[v_] := Module[{m = Length[v], k}, k = m; While[v[[k]] == 1, k--]; m - k]; a[n_] := Module[{v = fb[n]}, nv = Length[v]; i = 1; While[i <= nv - 2, If[v[[i ;; i + 2]] == {1, 0, 0}, v[[i ;; i + 2]] = {0, 1, 1}; If[i > 2, i -= 3]]; i++]; i = Position[v, _?(# > 0 &)]; If[i == {}, 0, f[v[[i[[1, 1]] ;; -1]]]]]; Array[a, 100, 0]

A308197 Numbers m such that the tribonacci representation of m (A278038) ends in an even number of 0's.

Original entry on oeis.org

1, 3, 4, 5, 8, 10, 11, 12, 13, 14, 16, 17, 18, 21, 23, 25, 27, 28, 29, 32, 34, 35, 36, 37, 38, 40, 41, 42, 44, 45, 47, 48, 49, 52, 54, 55, 56, 57, 58, 60, 61, 62, 65, 67, 69, 71, 72, 73, 76, 78, 79, 80, 82, 84, 85, 86, 89, 91, 92, 93, 94, 95, 97, 98, 99, 102, 104, 106, 108, 109, 110, 113, 115, 116, 117, 118, 119, 121
Offset: 1

Views

Author

N. J. A. Sloane, Jun 22 2019

Keywords

Comments

The asymptotic density of this sequence is c/(c+1) = 0.647798..., where c = 1.839286... (A058265) is the tribonacci constant. - Amiram Eldar, Mar 04 2022

Crossrefs

Programs

  • Mathematica
    t[1] = 1; t[2] = 2; t[3] = 4; t[n_] := t[n] = t[n - 1] + t[n - 2] + t[n - 3]; q[n_] := Module[{s = {}, m = n, k}, While[m > 0, k = 1; While[t[k] <= m, k++]; k--; AppendTo[s, k]; m -= t[k]; k = 1]; EvenQ[Min[s] - 1]]; Select[Range[0, 121], q] (* Amiram Eldar, Mar 04 2022 *)

A308198 Numbers m such that the tribonacci representation of m (A278038) ends in an odd number of 0's.

Original entry on oeis.org

0, 2, 6, 7, 9, 15, 19, 20, 22, 24, 26, 30, 31, 33, 39, 43, 46, 50, 51, 53, 59, 63, 64, 66, 68, 70, 74, 75, 77, 81, 83, 87, 88, 90, 96, 100, 101, 103, 105, 107, 111, 112, 114, 120, 124, 127, 131, 132, 134, 140, 144, 145, 147, 151, 155, 156, 158, 164, 168, 169, 171, 173, 175, 179, 180, 182, 188, 192, 195, 199, 200, 202
Offset: 1

Views

Author

N. J. A. Sloane, Jun 22 2019

Keywords

Comments

The asymptotic density of this sequence is 1/(c+1) = 0.352201..., where c = 1.839286... (A058265) is the tribonacci constant. - Amiram Eldar, Mar 04 2022

Crossrefs

Programs

  • Mathematica
    t[1] = 1; t[2] = 2; t[3] = 4; t[n_] := t[n] = t[n - 1] + t[n - 2] + t[n - 3]; q[0] = True; q[n_] := Module[{s = {}, m = n, k}, While[m > 0, k = 1; While[t[k] <= m, k++]; k--; AppendTo[s, k]; m -= t[k]; k = 1]; OddQ[Min[s] - 1]]; Select[Range[0, 202], q] (* Amiram Eldar, Mar 04 2022 *)

A356898 a(n) is the number of trailing 1's in the maximal tribonacci representation of n (A352103).

Original entry on oeis.org

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

Views

Author

Amiram Eldar, Sep 03 2022

Keywords

Comments

The asymptotic density of the occurrences of k = 0, 1, 2, ... is (c-1)/c^(k+1), where c = 1.839286... (A058265) is the tribonacci constant.
The asymptotic mean of this sequence is 1/(c-1) = 1.191487...

Examples

			  n  a(n)  A352103(n)
  -  ----  ----------
  0     0           0
  1     1           1
  2     0          10
  3     2          11
  4     0         100
  5     1         101
  6     0         110
  7     3         111
  8     1        1001
  9     0        1010
		

Crossrefs

Similar sequences: A278045, A356749.

Programs

  • Mathematica
    t[1] = 1; t[2] = 2; t[3] = 4; t[n_] := t[n] = t[n - 1] + t[n - 2] + t[n - 3]; trib[n_] := Module[{s = {}, m = n, k}, While[m > 0, k = 1; While[t[k] <= m, k++]; k--; AppendTo[s, k]; m -= t[k]; k = 1]; IntegerDigits[Total[2^(s - 1)], 2]]; f[v_] := Module[{m = Length[v], k}, k = m; While[v[[k]] == 1, k--]; m - k]; a[n_] := Module[{v = trib[n]}, nv = Length[v]; i = 1; While[i <= nv - 3, If[v[[i ;; i + 3]] == {1, 0, 0, 0}, v[[i ;; i + 3]] = {0, 1, 1, 1}; If[i > 3, i -= 4]]; i++]; i = Position[v, _?(# > 0 &)]; If[i == {}, 0, f[v[[i[[1, 1]] ;; -1]]], 10]]; Array[a, 100, 0]

A352427 a(n) is the number of trailing 0's in the minimal representation of n in terms of the positive Pell numbers (A317204).

Original entry on oeis.org

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

Views

Author

Amiram Eldar, Mar 16 2022

Keywords

Comments

The asymptotic density of the occurrences of 0 is sqrt(2)-1 and of the occurrences of k = 1, 2, ... is 2*(sqrt(2)-1)^(k+1).
The asymptotic mean of this sequence is 1 and its asymptotic variance is sqrt(2).

Crossrefs

Similar sequences: A003849 (dual Zeckendorf), A035614 (Zeckendorf), A230403 (factorial), A276084 (primorial), A278045 (tribonacci).

Programs

  • Mathematica
    pell[1] = 1; pell[2] = 2; pell[n_] := pell[n] = 2*pell[n - 1] + pell[n - 2]; a[n_] := Module[{s = {}, m = n, k}, While[m > 0, k = 1; While[pell[k] <= m, k++]; k--; AppendTo[s, k]; m -= pell[k]; k = 1]; IntegerExponent[Total[3^(s - 1)], 3]]; Array[a, 100]

Formula

a(A000129(n)) = n-1 for n>=1.
a(n) = 0 if and only if n is in A286666.
a(n) > 0 if and only if n is in A286667.
a(n) == 0 (mod 2) if and only if n is in A003152.
a(n) == 1 (mod 2) if and only if n is in A003151.
Showing 1-7 of 7 results.