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.

User: Samuel B. Reid

Samuel B. Reid's wiki page.

Samuel B. Reid has authored 14 sequences. Here are the ten most recent ones:

A337719 The number of maximally large absolute-difference triangles consisting of positive integers <= n.

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 44, 72, 128, 220, 380, 620, 1232, 2400, 3988, 7008, 14260, 25512, 50944, 105560, 197880, 381432, 785984, 1443992, 2981200, 6623144, 13044340, 26020924, 55781760, 108592260, 231819360, 526660160, 1071224176, 2231977656, 4950184948, 10009562624
Offset: 1

Author

Samuel B. Reid, Sep 16 2020

Keywords

Comments

a(17) is the first term that is more than twice its predecessor.
All terms after a(2) are divisible by four. This is because valid starting layers (of length greater than two) produce distinct valid starting layers when subjected to either or both of two transformations.
.
1 1
2 1 1 2
1 3 2 2 3 1
* | *
* | *
* | *
------|------
* | *
* | *
* | *
3 1 2 2 1 3
2 1 1 2
1 1
.
There is the obvious reflection about the y-axis (reversal), and there is the somewhat less obvious reflection about the x-axis. Reflection about the x-axis is valid because absolute differences are maintained. Note that it is not possible for a solution to be equivalent to any of its own transformations. If it were, the base layer or the layer that succeeds it would need to be palindromic. This is invalid because any absolute-difference triangle with a palindromic base and a height greater than one is topped with a zero.

Examples

			a(5) = 16
.
  1 2 5 1 2   3 2 5 1 2   3 4 1 5 4   5 4 1 5 4
   1 3 4 1     1 3 4 1     1 3 4 1     1 3 4 1
    2 1 3       2 1 3       2 1 3       2 1 3
     1 2         1 2         1 2         1 2
      1           1           1           1
.
  3 1 5 4 2   3 5 1 2 4   1 4 5 1 4   5 2 1 5 2
   2 4 1 2     2 4 1 2     3 1 4 3     3 1 4 3
    2 3 1       2 3 1       2 3 1       2 3 1
     1 2         1 2         1 2         1 2
      1           1           1           1
.
  2 4 5 1 3   4 2 1 5 3   2 5 1 2 5   4 1 5 4 1
   2 1 4 2     2 1 4 2     3 4 1 3     3 4 1 3
    1 3 2       1 3 2       1 3 2       1 3 2
     2 1         2 1         2 1         2 1
      1           1           1           1
.
  2 1 5 2 1   2 1 5 2 3   4 5 1 4 3   4 5 1 4 5
   1 4 3 1     1 4 3 1     1 4 3 1     1 4 3 1
    3 1 2       3 1 2       3 1 2       3 1 2
     2 1         2 1         2 1         2 1
      1           1           1           1
.
		

Crossrefs

A337226 Lexicographically earliest sequence of positive integers with the property that, for all k > 0, there is at most one j such that a(j) = a(j+k).

Original entry on oeis.org

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

Author

Samuel B. Reid, Aug 19 2020

Keywords

Comments

The sequence initially appears to be trivially fractal in that the removal of the first occurrence of each value seems to yield the original sequence. This pattern continues until a(121) where, if the sequence were fractal in this way, the value would be 72 or 1. The actual value is 13, so the pattern is broken.
Conjecture: For all k > 0, there is exactly one j such that a(j) = a(j+k). For 0 < k < 11911, this conjecture holds.

Examples

			  1 1 2 1 3 4 2
   (1)1 2 1 3 4   k = 1
      1(1)2 1 3   k = 2
       (1)1 2 1   k = 3
          1 1(2)  k = 4
            1 1   k = 5
              1   k = 6
Coincidences are circled. There can only be one coincidence per row.
a(3) cannot be 1 because that would result in two coincidences for k = 1.
a(5) cannot be 1 or 2 because those values would result in two coincidences for k = 1 and k = 2, respectively.
a(7) cannot be 1, 3, or 4 because those values would result in two coincidences for k = 3, k = 2, and k = 1, respectively. It can, however, be 2 because this results in no double coincidences.
		

Crossrefs

Programs

  • Python
    # See Links section.

A334749 A fractal sequence produced by interleaving the sequence with its own ordinal transform.

Original entry on oeis.org

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

Author

Samuel B. Reid, Jun 13 2020

Keywords

Comments

The odd bisection is the sequence itself.
The even bisection is the ordinal transform of the sequence.
If a(1) is 1, the other terms follow from the above constraints.

Examples

			The first 5 terms of the sequence: 1, 1, 1, 2, 1, ...
The first 5 terms of its ordinal transform: 1, 2, 3, 1, 4, ...
If these terms are interleaved, we get: 1, 1, 1, 2, 1, 3, 2, 1, 1, 4, ...
		

Crossrefs

Programs

  • Python
    # See Links section.

A335060 a(n) is the number of values of k < n for which 4*(a(k) + a(n-k)) < n.

Original entry on oeis.org

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

Author

Samuel B. Reid, May 21 2020

Keywords

Examples

			a(6) is 1 because, if (a(k) + a(6-k)) * 4 is less than 6, k can only be 3.
a(9) is 4 because k must be 1, 3, 6, or 8 in order for (a(k) + a(9-k)) * 4 to be less than 9.
		

Crossrefs

Programs

  • C
    See Links section.
    
  • PARI
    lista(nn) = {my(va=vector(nn)); for (n=2, nn, va[n] = sum(k=1, n-1, 4*(va[k] + va[n-k]) < n);); va;} \\ Michel Marcus, May 22 2020

A334081 If the terms of this sequence are divided into groups, the lengths of which are the terms of this sequence, the k-th term in a group is one greater than the k-th term in the previous group with at least k terms or 1 if no such group exists.

Original entry on oeis.org

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

Author

Samuel B. Reid, Apr 14 2020

Keywords

Examples

			--------------------
n  a(n)  n-th Group
--------------------
1  1     [1]
2  2     [2,1]
3  1     [3]
4  3     [4,2,1]
5  4     [5,3,2,1]
6  2     [6,4]
7  1     [7]
8  5     [8,5,3,2,1]
9  3     [9,6,4]
		

Crossrefs

Programs

  • Python
    # See Links section.

A333590 a(n) = a(n-1) if half of the previous term pairs are inverted. a(n) = a(n-1) + 1 if more than half of the previous term pairs are inverted. a(n) = a(n-1) - 1 if fewer than half of the previous term pairs are inverted. a(1) = 0.

Original entry on oeis.org

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

Author

Samuel B. Reid, Mar 27 2020

Keywords

Comments

An inversion occurs when some term is greater than some later term.
A sequence of length n can have at most n * (n - 1) / 2 inversions.

Examples

			There are zero inversions in the first two terms of this sequence. The maximum possible number of inversions in a sequence of length 2 is 1. 0 is less than half of 1, so the third term is 0 - 1 or -1.
There are two inversions in the first 3 terms of this sequence. The maximum possible number of inversions in a sequence of length 3 is 3. 2 is more than half of 3, so the fourth term is -1 + 1 or 0.
		

Crossrefs

Cf. A323186.

Programs

  • C
    // See Links section.
    
  • PARI
    { my(v=0, f=vector(2*M=100), s=0, inv=0); for (n=1, 72, f[M+v]++; inv+=s; print1 (v", "); if (2*invt, v++; s-=f[M+v])) } \\ Rémy Sigrist, Mar 28 2020

A332864 Lexicographically earliest sequence of positive integers with the property that the distance between the first appearance of n and the first appearance of n+1 is a(n).

Original entry on oeis.org

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

Author

Samuel B. Reid, Feb 27 2020

Keywords

Crossrefs

Programs

  • C
    See Links section.
    
  • Python
    a = [1]
    for n in range(1, 30):
        a += [1] * (a[n-1]-1)
        a.append(n+1)
    print(a)
    # Andrey Zabolotskiy, Feb 28 2020

A331910 Lexicographically earliest sequence of positive terms such that a(n) is the length of the n-th run of consecutive, equal terms and such that no two runs are identical.

Original entry on oeis.org

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

Author

Samuel B. Reid, Jan 31 2020

Keywords

Examples

			a(8) and a(9) are 4 because runs of length 2 containing values 1 and 2 appear earlier in the sequence and because a(7) is 3.
		

Crossrefs

Cf. A000002.

Programs

  • PARI
    See Links section.

A331624 Distinct values in A309681, in order of appearance.

Original entry on oeis.org

2, 4, 5, 6, 13, 9, 18, 19, 17, 20, 26, 30, 35, 23, 47, 50, 60, 41, 7, 42, 21, 37, 49, 38, 31, 44, 67, 55, 80, 79, 100, 106, 74, 29, 72, 65, 78, 101, 86, 99, 52, 77, 45, 75, 96, 141, 128, 105, 157, 180, 61, 182, 190, 135, 154, 121, 120, 146, 111, 27, 112, 158, 132, 28, 174
Offset: 1

Author

Samuel B. Reid, Jan 22 2020

Keywords

Crossrefs

Cf. A309681.

A330256 a(0) = 0; for n > 0, a(n) = n - a((Sum_{k=0..n-1} a(k)) mod n).

Original entry on oeis.org

0, 1, 1, 2, 4, 3, 3, 7, 5, 4, 10, 4, 7, 6, 13, 5, 12, 16, 12, 18, 14, 21, 9, 11, 10, 14, 22, 15, 14, 28, 9, 10, 23, 31, 24, 33, 22, 15, 37, 24, 16, 40, 14, 34, 37, 36, 43, 23, 34, 42, 13, 18, 37, 50, 17, 18, 32, 40, 40, 19, 46, 57, 39, 59, 30, 15, 32, 21, 11, 32, 40, 65, 32, 62, 41, 58, 63, 60
Offset: 0

Author

Samuel B. Reid, Dec 07 2019

Keywords

Examples

			a(1) = 1 - a(0 mod 1) = 1.
a(2) = 2 - a((0+1) mod 2) = 1.
a(3) = 3 - a((0+1+1) mod 3) = 2.
a(4) = 4 - a((0+1+1+2) mod 4) = 4.
		

Crossrefs

Programs

  • Mathematica
    a[0] = 0; a[n_] := a[n] = n - a[Mod[Sum[a[k], {k, 0, n - 1}], n]]; Array[a, 100, 0] (* Amiram Eldar, Dec 07 2019 *)
  • PARI
    s=0; for (n=1, #(a=vector(78)), print1 (a[n]=if (n==1, 0, (n-1)-a[1+(s%(n-1))])", "); s+=a[n]) \\ Rémy Sigrist, Dec 08 2019