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-10 of 18 results. Next

A352107 Lazy-tribonacci-Niven numbers: numbers that are divisible by the number of terms in their maximal (or lazy) representation in terms of the tribonacci numbers (A352103).

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 18, 20, 21, 24, 28, 30, 33, 36, 39, 40, 48, 50, 56, 60, 68, 70, 72, 75, 76, 80, 90, 96, 100, 108, 115, 116, 120, 135, 136, 140, 150, 155, 156, 160, 162, 168, 175, 176, 177, 180, 184, 185, 188, 195, 198, 204, 205, 208, 215, 216, 225, 231, 260
Offset: 1

Views

Author

Amiram Eldar, Mar 05 2022

Keywords

Comments

Numbers k such that A352104(k) | k.

Examples

			6 is a term since its maximal tribonacci representation, A352103(6) = 110, has A352104(6) = 2 1's and 6 is divisible by 2.
		

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]; 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]]; q[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 == {}, False, Divisible[n, Total[v[[i[[1, 1]] ;; -1]]]]]]; Select[Range[300], q]

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

Original entry on oeis.org

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

Views

Author

Amiram Eldar, Mar 05 2022

Keywords

Crossrefs

Similar sequences: A000120, A007895, A112310, A278043.

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]]; 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, Total[v[[i[[1, 1]] ;; -1]]]]]; Array[a, 100, 0]

Formula

a(n) = A007953(A352103(n)).
a(n) >= A278043(n).

A352105 Numbers whose maximal tribonacci representation (A352103) is palindromic.

Original entry on oeis.org

0, 1, 3, 5, 7, 8, 14, 18, 23, 27, 36, 40, 51, 52, 62, 69, 78, 88, 95, 102, 110, 130, 148, 156, 176, 181, 194, 211, 229, 242, 246, 264, 277, 294, 312, 325, 326, 363, 397, 411, 448, 463, 477, 514, 548, 562, 599, 617, 650, 674, 682, 715, 739, 770, 803, 827, 838, 862
Offset: 1

Views

Author

Amiram Eldar, Mar 05 2022

Keywords

Comments

A027084(n) is a term since its maximal tribonacci representation is n-1 1's and no 0's.
The pairs {A008937(3*k+1)-1, A008937(3*k+1)} = {0, 1}, {7, 8}, {51, 52}, ... are consecutive terms in this sequence: the maximal tribonacci representation of A008937(3*k+1)-1 is 3*k 1's and no 0's (except for k=0 where the representation is 0), and the maximal tribonacci representation of A008937(3*k+1) is of the form 100100...1001 with k blocks of 100 followed by a 1 at the end.

Examples

			The first 10 terms are:
   n  a(n)  A352103(a(n))
  --  ----  -------------
   1    0               0
   2    1               1
   3    3              11
   4    5             101
   5    7             111
   6    8            1001
   7   14            1111
   8   18           10101
   9   23           11011
  10   27           11111
		

Crossrefs

A027084 is a subsequence.

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]]; q[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 == {}, True, PalindromeQ[FromDigits[v[[i[[1, 1]] ;; -1]]]]]]; Select[Range[0, 1000], q]

A356895 a(n) is the length of the maximal tribonacci representation of n (A352103).

Original entry on oeis.org

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

Views

Author

Amiram Eldar, Sep 03 2022

Keywords

Examples

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

Crossrefs

Similar sequences: A070939, A072649, A095791, A278044.

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]]; 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 == {}, 1, Length[v[[i[[1, 1]] ;; -1]]]]]; Array[a, 100, 0]

Formula

a(n) = A352104(n) + A356894(n).
a(n) ~ log(n)/log(c), where c is the tribonacci constant (A058265).

A356896 Nonnegative numbers whose maximal tribonacci representation (A352103) ends in an even number of 1's.

Original entry on oeis.org

0, 2, 3, 4, 6, 9, 10, 11, 13, 14, 15, 16, 17, 19, 22, 23, 24, 26, 28, 30, 33, 34, 35, 37, 38, 39, 40, 41, 43, 46, 47, 48, 50, 51, 53, 54, 55, 57, 58, 59, 60, 61, 63, 66, 67, 68, 70, 72, 74, 77, 78, 79, 81, 82, 83, 84, 85, 87, 90, 91, 92, 94, 96, 97, 98, 100, 103
Offset: 1

Views

Author

Amiram Eldar, Sep 03 2022

Keywords

Comments

Numbers k such that A356898(k) is even.
The asymptotic density of this sequence is c/(c+1) = 0.647798..., where c = 1.839286... (A058265) is the tribonacci constant.

Examples

			   n  a(n)  A352103(n)  A356898(n)
   -  ----  ----------  ----------
   1     0           0          0
   2     2          10          0
   3     3          11          2
   4     4         100          0
   5     6         110          0
   6     9        1010          0
   7    10        1011          2
   8    11        1100          0
   9    13        1110          0
  10    14        1111          4
		

Crossrefs

Complement of A356897.
Similar sequences: A308197, A342051.

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]; c[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]]; Select[Range[0, 100], EvenQ[c[#]] &]

A356897 Nonnegative numbers whose maximal tribonacci representation (A352103) ends in an odd number of 1's.

Original entry on oeis.org

1, 5, 7, 8, 12, 18, 20, 21, 25, 27, 29, 31, 32, 36, 42, 44, 45, 49, 52, 56, 62, 64, 65, 69, 71, 73, 75, 76, 80, 86, 88, 89, 93, 95, 99, 101, 102, 106, 108, 110, 112, 113, 117, 123, 125, 126, 130, 133, 137, 143, 145, 146, 150, 152, 154, 156, 157, 161, 167, 169
Offset: 1

Views

Author

Amiram Eldar, Sep 03 2022

Keywords

Comments

Numbers k such that A356898(k) is odd.
The asymptotic density of this sequence is 1/(c+1) = 0.352201..., where c = 1.839286... (A058265) is the tribonacci constant.

Examples

			   n  a(n)  A352103(n)  A356898(n)
   -  ----  ----------  ----------
   1     1           1          1
   2     5         101          1
   3     7         111          3
   4     8        1001          1
   5    12        1101          1
   6    18       10101          1
   7    20       10111          3
   8    21       11001          1
   9    25       11101          1
  10    27       11111          5
		

Crossrefs

Complement of A356896.
Similar sequences: A001950, A308198, A342050.

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]; c[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]]; Select[Range[0, 200], OddQ[c[#]] &]

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]

A356894 a(n) is the number of 0's in the maximal tribonacci representation of n (A352103).

Original entry on oeis.org

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

Views

Author

Amiram Eldar, Sep 03 2022

Keywords

Examples

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

Crossrefs

Similar sequences: A023416, A102364, A117479, A278042.

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]]; 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 == {}, 1, Count[v[[i[[1, 1]] ;; -1]], 0]]]; Array[a, 100, 0]

Formula

a(n) = A356895(n) - A352104(n).

A092782 The ternary tribonacci word; also a Rauzy fractal sequence: fixed point of the morphism 1 -> 12, 2 -> 13, 3 -> 1, starting from a(1) = 1.

Original entry on oeis.org

1, 2, 1, 3, 1, 2, 1, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 1, 2, 1, 3, 1, 2, 1, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 1, 2, 1, 3, 1, 2, 1, 2, 1, 3, 1, 2, 1, 1, 2, 1, 3
Offset: 1

Views

Author

Philippe Deléham, Apr 23 2004

Keywords

Comments

See A080843 for the {0,1,2} version, which in a sense is the most basic version.
See also A103269 for another version with further references and comments.
Also called a tribonacci word. In the limit the ratios #1's : #2's : #3's are t^2 : t : 1 where t is the tribonacci constant 1.839286755... (A058265). - Frank M Jackson, Mar 29 2018
a(n)-1 is the number of trailing 0's in the maximal tribonacci representation of n (A352103). - Amiram Eldar, Feb 29 2024

Examples

			From _Joerg Arndt_, Sep 14 2013: (Start)
The first few steps of the substitution are
Start: 1
Maps:
  1 --> 12
  2 --> 13
  3 --> 1
-------------
0:   (#=1)
  1
1:   (#=2)
  12
2:   (#=4)
  1213
3:   (#=7)
  1213121
4:   (#=13)
  1213121121312
5:   (#=24)
  121312112131212131211213
6:   (#=44)
  12131211213121213121121312131211213121213121
7:   (#=81)
  121312112131212131211213121312112131212131211213121121312121312112131213121121312
(End)
		

References

  • This entry has a fairly complete list of references and links concerning the ternary tribonacci word. - N. J. A. Sloane, Aug 17 2018
  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 246.
  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.

Crossrefs

See A080843 for a {0,1,2} version.
First differences: A317950.

Programs

  • Maple
    f(1):= (1, 2): f(2):= (1, 3): f(3):= (1): A:= [1]:
    for i from 1 to 16 do A:= map(f, A) od:
    A; # 19513 terms of A092782; A103269; from N. J. A. Sloane, Aug 06 2018
  • Mathematica
    Nest[ Flatten[# /. {1 -> {1, 2}, 2 -> {1, 3}, 3 -> 1}] &, {1}, 8] (* Robert G. Wilson v, Mar 04 2005 and updated Apr 29 2018 *)
  • PARI
    w=vector(9,x,[]); w[1]=[1];
    for(n=2,9,for(k=1,#w[n-1],m=w[n-1][k];v=[];if(m-1,if(m-2,v=[1],v=[1,3]),v=[1,2]);w[n]=concat(w[n],v)));
    w[9] \\ Gerald McGarvey, Dec 18 2009
    
  • 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=[1];  for (k=1, 10, t=strsub( t, [[1,2], [1,3], [1]], 1 ) );  t
    \\ Joerg Arndt, Sep 14 2013
    
  • PARI
    A092782_vec(N,s=[[1,2],[1,3],1],A=[1])={while(#AM. F. Hasler, Dec 14 2018

Formula

a(n) = 1 for n in A003144; a(n) = 2 for n in A003145; a(n) = 3 for n in A003146.
a(n) = A080843(n-1) + 1. - Joerg Arndt, Sep 14 2013

Extensions

Additional references and links added by N. J. A. Sloane, Aug 17 2018

A352108 Numbers k such that k and k+1 are both lazy-tribonacci-Niven numbers (A352107).

Original entry on oeis.org

1, 20, 39, 75, 115, 135, 155, 175, 176, 184, 204, 215, 264, 567, 684, 704, 725, 791, 846, 872, 1089, 1104, 1115, 1134, 1183, 1184, 1211, 1224, 1407, 1575, 1840, 1880, 2064, 2075, 2151, 2191, 2232, 2259, 2260, 2415, 2529, 2583, 2624, 2780, 2820, 2848, 2888, 2988
Offset: 1

Views

Author

Amiram Eldar, Mar 05 2022

Keywords

Examples

			20 is a term since 20 and 21 are both lazy-tribonacci-Niven numbers: the maximal tribonacci representation of 20, A352103(20) = 10111, has 4 1's and 20 is divisible by 4, and the maximal tribonacci representation of 21, A352103(20) = 11001, has 3 1's and 21 is divisible by 3.
		

Crossrefs

Subsequence of A352107.
Subsequences: A352109, A352110.

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]]; q[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 == {}, False, Divisible[n, Total[v[[i[[1, 1]] ;; -1]]]]]]; Select[Range[3000], q[#] && q[# + 1] &]
Showing 1-10 of 18 results. Next