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.

Previous Showing 11-20 of 238 results. Next

A262057 Array based on the Stanley sequence S(0), A005836, by antidiagonals.

Original entry on oeis.org

0, 2, 1, 7, 5, 3, 21, 8, 6, 4, 23, 22, 16, 11, 9, 64, 26, 24, 17, 14, 10, 69, 65, 50, 25, 19, 15, 12, 71, 70, 67, 53, 48, 20, 18, 13, 193, 80, 78, 68, 59, 49, 34, 29, 27, 207, 194, 152, 79, 73, 62, 51, 35, 32, 28, 209, 208, 196, 161, 150, 74, 63, 52, 43, 33, 30
Offset: 1

Views

Author

Max Barrentine, Nov 29 2015

Keywords

Comments

This array is similar to a dispersion in that the first column is the minimal nonnegative sequence that contains no 3-term arithmetic progression, and each next column is the minimal sequence consisting of the numbers rejected from the previous column that contains no 3-term arithmetic progression.
A100480(n) describes which column n is sorted into.
The columns of the array form the greedy partition of the nonnegative integers into sequences that contain no 3-term arithmetic progression. - Robert Israel, Feb 03 2016

Examples

			From the top-left corner, this array starts:
   0   2   7  21  23  64
   1   5   8  22  26  65
   3   6  16  24  50  67
   4  11  17  25  53  68
   9  14  19  48  59  73
  10  15  20  49  62  74
		

Crossrefs

First column is A005836.
First row is A265316.

Programs

  • MATLAB
    function  A = A262057( M, N )
    % to get first M antidiagonals using x up to N
    B = cell(1,M);
    F = zeros(M,N+1);
    countdowns = [M:-1:1];
    for x=0:N
        if max(countdowns) == 0
            break
        end
        for i=1:M
            if F(i,x+1) == 0
                newforb = 2*x - B{i};
                newforb = newforb(newforb <= N & newforb >= 1);
                F(i,newforb+1) = 1;
                B{i}(end+1) = x;
                countdowns(i) = countdowns(i)-1;
                break
            end
        end
    end
    if max(countdowns) > 0
        [~,jmax] = max(countdowns);
        jmax = jmax(1);
        error ('Need larger N: B{%d} has only %d elements',jmax,numel(B{jmax}));
    end
    A = zeros(1,M*(M+1)/2);
    k = 0;
    for n=1:M
        for i=1:n
            k=k+1;
            A(k) = B{n+1-i}(i);
        end
    end
    end % Robert Israel, Feb 03 2016
  • Maple
    M:= 20: # to get the first M antidiagonals
    for i from 1 to M do B[i]:= {}: F[i]:= {}: od:
    countdowns:= Vector(M,j->M+1-j):
    for x from 0 while max(countdowns) > 0 do
      for i from 1 do
         if not member(x, F[i]) then
           F[i]:= F[i] union map(y -> 2*x-y, B[i]);
           B[i]:= B[i] union {x};
           countdowns[i]:= countdowns[i] - 1;
         break
        fi
      od;
    od:
    seq(seq(B[n+1-i][i], i=1..n),n=1..M); # Robert Israel, Feb 03 2016

Formula

A006997(A(n, k)) = k - 1. - Rémy Sigrist, Jan 06 2024

A262096 Triangle read by rows: numbers c from the set of arithmetic triples a < b < c (three numbers in arithmetic progression) where a and b are terms of A005836.

Original entry on oeis.org

2, 6, 5, 8, 7, 5, 18, 17, 15, 14, 20, 19, 17, 16, 11, 24, 23, 21, 20, 15, 14, 26, 25, 23, 22, 17, 16, 14, 54, 53, 51, 50, 45, 44, 42, 41, 56, 55, 53, 52, 47, 46, 44, 43, 29, 60, 59, 57, 56, 51, 50, 48, 47, 33, 32, 62, 61, 59, 58, 53, 52, 50, 49, 35, 34, 32
Offset: 1

Views

Author

Max Barrentine, Sep 10 2015

Keywords

Comments

The first term in each row of the triangle is a term of A005823; these are also the local maxima. From this term until the next row, the first differences are A236313.

Examples

			Each term is generated from arithmetic sequences started from pairs of terms from A005836. The order is according to the arithmetic triples 0, 1, a(1)=2; 0, 3, a(2)=6; 1, 3, a(3)=5; 0, 4, a(4)=8; 1, 4, a(5)=7; 3, 4, a(6)=5; ...
As a triangle, sequence starts:
   2;
   6,  5;
   8,  7,  5;
  18, 17, 15, 14;
  20, 19, 17, 16, 11;
  24, 23, 21, 20, 15, 14;
  26, 25, 23, 22, 17, 16, 14;
  54, 53, 51, 50, 45, 44, 42, 41;
  ...
		

Crossrefs

Programs

  • PARI
    isok(n) = (n==0) || (vecmax(digits(n, 3)) != 2);
    lista(nn) = {oks = select(x->isok(x), vector(nn, n, n-1)); for (n=2, #oks, for (k=1, n-1, print1(2*oks[n]-oks[k], ", ");););} \\ Michel Marcus, Sep 12 2015

Extensions

Name corrected by Max Barrentine, May 24 2016

A262256 List of arithmetic triples aA005836.

Original entry on oeis.org

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

Views

Author

Max Barrentine, Sep 15 2015

Keywords

Comments

The values a(3n) are A262096.

Examples

			0, 1, 2;
0, 3, 6;
1, 3, 5;
0, 4, 8;
...
		

Crossrefs

Extensions

Name edited by Max Barrentine, May 24 2016

A374362 a(n) is the least term t of A005836 such that n - t also belongs to A005836.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 3, 3, 4, 0, 0, 1, 0, 0, 1, 3, 3, 4, 9, 9, 10, 9, 9, 10, 12, 12, 13, 0, 0, 1, 0, 0, 1, 3, 3, 4, 0, 0, 1, 0, 0, 1, 3, 3, 4, 9, 9, 10, 9, 9, 10, 12, 12, 13, 27, 27, 28, 27, 27, 28, 30, 30, 31, 27, 27, 28, 27, 27, 28, 30, 30, 31, 36, 36, 37, 36
Offset: 0

Views

Author

Rémy Sigrist, Jul 06 2024

Keywords

Comments

To compute a(n): in the ternary expansion of n, replace 1's by 0's and 2's by 1's.

Examples

			The first terms, in decimal and in ternary, are:
  n   a(n)  ter(n)  ter(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     0       1          0
   2     1       2          1
   3     0      10          0
   4     0      11          0
   5     1      12          1
   6     3      20         10
   7     3      21         10
   8     4      22         11
   9     0     100          0
  10     0     101          0
  11     1     102          1
  12     0     110          0
  13     0     111          0
  14     1     112          1
  15     3     120         10
		

Crossrefs

Programs

  • PARI
    a(n) = fromdigits(apply(d -> [0, 0, 1][1+d], digits(n, 3)), 3)
    
  • Python
    from gmpy2 import digits
    def A374362(n): return int(digits(n,3).replace('1','0').replace('2','1'),3) # Chai Wah Wu, Jul 09 2024

Formula

a(n) = A374361(n, 0).
a(n) = n - A374363(n).
a(n) >= 0 with equality iff n belongs to A374361.
a(n) = A005836(1 + A289814(n)).

A374363 a(n) is the greatest term t <= n of A005836 such that n - t also belongs to A005836.

Original entry on oeis.org

0, 1, 1, 3, 4, 4, 3, 4, 4, 9, 10, 10, 12, 13, 13, 12, 13, 13, 9, 10, 10, 12, 13, 13, 12, 13, 13, 27, 28, 28, 30, 31, 31, 30, 31, 31, 36, 37, 37, 39, 40, 40, 39, 40, 40, 36, 37, 37, 39, 40, 40, 39, 40, 40, 27, 28, 28, 30, 31, 31, 30, 31, 31, 36, 37, 37, 39, 40
Offset: 0

Views

Author

Rémy Sigrist, Jul 06 2024

Keywords

Comments

To compute a(n): in the ternary expansion of n, 2's by 1's.

Examples

			The first terms, in decimal and in ternary, are:
  n   a(n)  ter(n)  ter(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     1       1          1
   2     1       2          1
   3     3      10         10
   4     4      11         11
   5     4      12         11
   6     3      20         10
   7     4      21         11
   8     4      22         11
   9     9     100        100
  10    10     101        101
  11    10     102        101
  12    12     110        110
  13    13     111        111
  14    13     112        111
  15    12     120        110
		

Crossrefs

Programs

  • PARI
    a(n) = fromdigits(apply(d -> [0, 1, 1][1+d], digits(n, 3)), 3)

Formula

a(n) = T(n, A120880(k)-1).
a(n) = n - A374362(n).
a(n) <= n with equality iff n belongs to A005836.
a(n) = A005836(1+A289831(n)).

A374560 Square array A(n, k), n, k >= 0, read by antidiagonals; A(n, k) = A005836(n+1) + A005836(k+1).

Original entry on oeis.org

0, 1, 1, 3, 2, 3, 4, 4, 4, 4, 9, 5, 6, 5, 9, 10, 10, 7, 7, 10, 10, 12, 11, 12, 8, 12, 11, 12, 13, 13, 13, 13, 13, 13, 13, 13, 27, 14, 15, 14, 18, 14, 15, 14, 27, 28, 28, 16, 16, 19, 19, 16, 16, 28, 28, 30, 29, 30, 17, 21, 20, 21, 17, 30, 29, 30, 31, 31, 31, 31, 22, 22, 22, 22, 31, 31, 31, 31
Offset: 0

Views

Author

Rémy Sigrist, Jul 20 2024

Keywords

Comments

For any v >= 0, the value v appears A120880(v) times.

Examples

			Array A(n, k) begins:
  n\k |  0   1   2   3   4   5   6   7   8   9  10  11  12
  ----+---------------------------------------------------
    0 |  0   1   3   4   9  10  12  13  27  28  30  31  36
    1 |  1   2   4   5  10  11  13  14  28  29  31  32  37
    2 |  3   4   6   7  12  13  15  16  30  31  33  34  39
    3 |  4   5   7   8  13  14  16  17  31  32  34  35  40
    4 |  9  10  12  13  18  19  21  22  36  37  39  40  45
    5 | 10  11  13  14  19  20  22  23  37  38  40  41  46
    6 | 12  13  15  16  21  22  24  25  39  40  42  43  48
    7 | 13  14  16  17  22  23  25  26  40  41  43  44  49
    8 | 27  28  30  31  36  37  39  40  54  55  57  58  63
    9 | 28  29  31  32  37  38  40  41  55  56  58  59  64
   10 | 30  31  33  34  39  40  42  43  57  58  60  61  66
   11 | 31  32  34  35  40  41  43  44  58  59  61  62  67
   12 | 36  37  39  40  45  46  48  49  63  64  66  67  72
		

Crossrefs

Programs

  • PARI
    A(n, k) = fromdigits(binary(n), 3) + fromdigits(binary(k), 3)

Formula

A(n, k) = A(k, n).
A(2*n, 2*k) = 3*A(n, k).

A082575 Nonnegative numbers in (3*A005836) union (3*A005836 - 2) [A005836 lists the numbers with base-3 representation containing no 2].

Original entry on oeis.org

0, 1, 3, 7, 9, 10, 12, 25, 27, 28, 30, 34, 36, 37, 39, 79, 81, 82, 84, 88, 90, 91, 93, 106, 108, 109, 111, 115, 117, 118, 120, 241, 243, 244, 246, 250, 252, 253, 255, 268, 270, 271, 273, 277, 279, 280, 282, 322, 324, 325, 327, 331, 333, 334, 336, 349, 351, 352
Offset: 1

Views

Author

Emeric Deutsch and Bruce E. Sagan, Dec 05 2003

Keywords

Comments

Numbers k such that the Motzkin number A001006(k) == 1 (mod 3).

Crossrefs

Programs

  • Mathematica
    (* m = MotzkinNumber *) m[0] = 1; m[n_] := m[n] = m[n - 1] + Sum[m[k]*m[n - 2 - k], {k, 0, n - 2}]; Select[Range[0, 400], Mod[m[#], 3] == 1 &] (* Jean-François Alcover, Jul 10 2013 *)
    max = 150; Sort @ Join[Select[3*Range[0, max], DigitCount[#, 3, 2] == 0 &], Select[3*Range[max] - 2, DigitCount[# + 2, 3, 2] == 0 &]] (* Amiram Eldar, Jun 04 2022 *)

Extensions

Offset changed to 1 (sequence is a list) by L. Edson Jeffery, Nov 27 2015

A177880 Numbers k such that not all exponents in the prime power factorization of k are in A005836.

Original entry on oeis.org

4, 9, 12, 18, 20, 25, 28, 32, 36, 44, 45, 49, 50, 52, 60, 63, 64, 68, 72, 75, 76, 84, 90, 92, 96, 98, 99, 100, 108, 116, 117, 121, 124, 126, 128, 132, 140, 144, 147, 148, 150, 153, 156, 160, 164, 169, 171, 172, 175, 180, 188, 192, 196, 198, 200, 204, 207
Offset: 1

Views

Author

Vladimir Shevelev, Dec 15 2010

Keywords

Comments

1 and products of distinct numbers of the form P^(3^k), k>=0, are not in the sequence.

Crossrefs

Cf. A005836.

Programs

  • Mathematica
    Select[Range[200], AnyTrue[FactorInteger[#][[;; , 2]], DigitCount[#1, 3, 2] > 0 &] &] (* Amiram Eldar, Aug 31 2020 *)
  • Sage
    is_A005836 = lambda n: 2 not in n.digits(base=3)
    is_A177880 = lambda n: not all(is_A005836(Integer(m)) for p,m in factor(n)) # D. S. McNeil, Dec 16 2010

Formula

Let A(x) be counting function of terms not exceeding x. Then for x tends to infinity, A(x)=C*x+o(x^(0.5+eps), where C=1-Prod{i=p^(3^k)with prime p and k>=0}(1-1/(i^2+i+1)).

Extensions

Extended by D. S. McNeil, Dec 16 2010

A263488 Positive integers n that can be expressed as the quotient of two elements of A005836.

Original entry on oeis.org

1, 3, 4, 7, 9, 10, 12, 13, 19, 21, 22, 25, 27, 28, 30, 31, 34, 36, 37, 39, 40, 55, 57, 58, 61, 63, 64, 66, 67, 70, 73, 75, 76, 79, 81, 82, 84, 85, 88, 90, 91, 93, 94, 97, 100, 102, 103, 106, 108, 109, 111, 112, 115, 117, 118, 120, 121, 163, 165, 166, 169, 171, 172, 174, 175, 178, 181, 183, 184, 187, 189, 190, 192, 193, 196
Offset: 1

Views

Author

Jeffrey Shallit, Dec 02 2015

Keywords

Comments

For each n, a proof of the existence or nonexistence of such a representation can be constructed effectively, by building a finite-state transducer that multiplies by n, and then searching for a path in the corresponding directed graph whose inputs and outputs are labeled only with 0's and 1's. This was used to show, for example, that 529, 592, 601, 616, 5368, and 50281 have no such representation.
It is not hard to show that every element of this sequence lies in an interval bounded by (2/3)*3^n and (3/2)*3^n for some n >= 0. However, not all elements of these intervals have a representation.
It is also not hard to see that if the last nonzero digit of n in base 3 is a 2, then n is not an element of the sequence.
n is in the sequence if and only if 3*n is in the sequence. - Robert Israel, Dec 03 2015

Examples

			7 is in the sequence because it can be expressed as 28/4, and in base 3 28 is 1001 and 4 is 11.
		

Crossrefs

Cf. A005836.

Programs

  • Maple
    F:= proc(N)
      option remember;
      uses GraphTheory;
      local L,G,a,k;
      if N mod 3 = 0 then procname(N/3)
      elif N mod 3 = 2 then return false
      fi;
      k:=  ceil(log[3](2*N/3));
      if N < (2/3)*3^k then return false fi;
      for a from 1 to N-1 do
         L[a]:= {3*a,3*a+1}
      od:
      for a from N to 2*N-1 do
         L[a]:= subs(0=3*N,{3*(a-N),3*(a-N)+1});
      od:
      for a from 2*N to 3*N do
         L[a]:= {};
      od:
      L[3*N+1]:= remove(t -> has(convert(t,base,3),2), {$1..3*N-1}):
      G:= Digraph(3*N+1,[seq(L[a],a=1..3*N+1)]);
      try
        ShortestPath(G,3*N+1,3*N);
      catch "no path from": return false;
      end try;
      true
    end proc:
    select(F, [$1..1000]); # Robert Israel, Dec 03 2015

A265159 Rectangular array A read by upward antidiagonals in which the entry in row n and column k is defined by A(n,k) = 5 + 9*A005836(2^(k - 1)*(2 n - 1)), n,k >= 1.

Original entry on oeis.org

5, 32, 14, 86, 95, 41, 113, 257, 284, 122, 248, 338, 770, 851, 365, 275, 743, 1013, 2309, 2552, 1094, 329, 824, 2228, 3038, 6926, 7655, 3281, 356, 986, 2471, 6683, 9113, 20777, 22964, 9842, 734, 1067, 2957, 7412, 20048, 27338, 62330, 68891, 29525
Offset: 1

Views

Author

L. Edson Jeffery, Dec 03 2015

Keywords

Comments

Conjecture 1: The array contains without duplication all possible "block numbers" defined in A265100.

Examples

			Array A begins:
.      5    14    41    122    365    1094    3281     9842    29525
.     32    95   284    851   2552    7655   22964    68891   206672
.     86   257   770   2309   6926   20777   62330   186989   560966
.    113   338  1013   3038   9113   27338   82013   246038   738113
.    248   743  2228   6683  20048   60143  180428   541283  1623848
.    275   824  2471   7412  22235   66704  200111   600332  1800995
.    329   986  2957   8870  26609   79826  239477   718430  2155289
.    356  1067  3200   9599  28796   86387  259160   777479  2332436
.    734  2201  6602  19805  59414  178241  534722  1604165  4812494
		

Crossrefs

Programs

  • Mathematica
    (* Array: *)
    a005836[1] := 0; a005836[n_] := If[OddQ[n], 3*a005836[Floor[(n + 1)/2]], a005836[n - 1] + 1]; a265159[n_, k_] := 5 + 9*a005836[2^(k - 1)*(2 n - 1)]; Grid[Table[a265159[n, k], {n, 9}, {k, 9}]]
    (* Array antidiagonals flattened: *)
    a005836[1] := 0; a005836[n_] := If[OddQ[n], 3*a005836[Floor[(n + 1)/2]], a005836[n - 1] + 1]; a265159[n_, k_] := 5 + 9*a005836[2^(k - 1)*(2 n - 1)]; Flatten[Table[a265159[n - k + 1, k], {n, 9}, {k, n}]]

Formula

Conjecture 2: A(n,k) = (A055246(n)*3^k + 1)/2, so the array and A265100 are related to Cantor's ternary set.
G.f. for row n (conjectured): f(n,x) = x*(A265100(n)-(A265100(n)+1)*x)/((1-x)*(1-3*x)).
Previous Showing 11-20 of 238 results. Next