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: Bryle Morga

Bryle Morga's wiki page.

Bryle Morga has authored 27 sequences. Here are the ten most recent ones:

A382590 a(n) = a(n-1)*b(n-2) + a(n-2)*b(n-1) and b(n) = a(n-1)*b(n-2) - a(n-2)*b(n-1) starting with a(0) = b(0) = b(1) = 1 and a(1) = 2.

Original entry on oeis.org

1, 2, 3, 5, 8, 18, 20, 896, 27072, 32814080, -149545811968, 160091119521808515072, 738655358988798463192241725767680, 12485440430502138868848264866306550045930296006672384, -147240441301035233185124372803468937068922727279777614523229030890174062704096331169792
Offset: 0

Author

Bryle Morga, Mar 31 2025

Keywords

Comments

This sequence appears to have a very peculiar (conjectured) property. For any k > 1, if you take the k-th prime factor of each term, you get an eventually periodic sequence. This seems to hold even when we change a(1) as long as it is an integer > 1. For discussion about this conjecture, there's a link to a MathOverflow question here.

Programs

  • Python
    from itertools import islice
    def agen(): # generator of terms
        a, b = [1, 2], [1, 1]
        while True:
            yield a[-2]
            a, b = [a[-1], a[-1]*b[-2]+a[-2]*b[-1]], [b[-1], a[-1]*b[-2]-a[-2]*b[-1]]
    print(list(islice(agen(), 15))) # Michael S. Branicky, Jun 02 2025

A382951 Sequence of positive integers with no repetitions and, when put in a spiral, all lines (straight or diagonal) are pairwise coprime.

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 11, 9, 13, 17, 19, 23, 8, 29, 31, 27, 25, 37, 39, 16, 41, 43, 14, 47, 33, 53, 35, 59, 61, 67, 71, 73, 49, 79, 83, 89, 97, 101, 103, 55, 107, 109, 91, 113, 85, 127, 131, 137, 139, 121, 149, 151, 157, 133, 163, 65, 167, 51, 125, 173, 143, 179, 181, 191, 161, 22, 193, 169, 197, 199, 211
Offset: 1

Author

Bryle Morga, Apr 09 2025

Keywords

Comments

We take the lexicographically earliest sequence that fits the name.
It seems likely (but unproven) that every positive integers appear and that this sequence is a permutation of the positive integers. Some number just takes very long to appear. For instance, here are the number of steps it took to reach some numbers:
6: 160 steps
10: 468 steps
12: 571 steps
15: 4048 steps!!
18: 582 steps
20: 1492 steps
21: 820 steps
It takes at least floor(N/2)^2 steps before the first N integers appear. Any tighter bound?

Examples

			    4 -- 5 -- 3
    |         |
    7    1 -- 2
    |
   11 --
.
Look at the 7th term. It couldn't be 1, 2, 3, 4, 5, and 7 as they already occurred in the sequence. It also can't be 6, 8, or 10 because they all share factors with 4 which is in the vertical line (...4, 7, 11...). It cannot be a 9 because of the diagonal (...11, 1, 3...).
		

Crossrefs

Cf. A336349.

Programs

  • Mathematica
    S[n_]:=Block[{v,sq={1}, p=Most[{Re@#, Im@#}&/@ Fold[Join[#1, Last[#1]+I^#2 Range[#2/2]]&, {0}, Range[4n+2]]], A=<||>, T=<||>, s, d=Rest@ Tuples[{0,1,-1}, 2]}, T[1]=1; A[{0,0}]=1; s[z_]:=Block[{L={},o}, Do[o=z; While[ Max[Abs[o+e]]<=n, AppendTo[L,o+=e]],{e,d}];L]; Do[v=LCM@@ A/@ Intersection[Keys[A], s[u]]; k=2; While[ KeyExistsQ[T,k] || GCD[v,k]>1,k++]; AppendTo[sq,k]; T[k]=1; A[u]=k, {u, Rest@p}]; (* Print@ Graphics@ Table[ Text[sq[[i]], p[[i]]], {i,Length[p]}]; *) sq]; S[4] (* S[n] returns the values for a grid of semidiameter n. Uncomment the Print to show the spiral. Giovanni Resta, Apr 10 2025 *)

A382928 Start with {1, x}, then at each step replace it with the set of all pairwise products and sums of its elements (an element can be paired with itself). a(n) gives the number of elements after n-th step.

Original entry on oeis.org

2, 6, 28, 436, 90385, 4017112742
Offset: 0

Author

Bryle Morga, Apr 09 2025

Keywords

Comments

a(n) is the cardinality of s(n) where s(0) = {1, x} and s(n) contains a+b, a*b and a for every a and b in s(n-1).
Related to A352969 which has {1} as the starting set as opposed to {1, x}.

Examples

			a(0) = 2 corresponding to 1 and x.
a(1) = 6 since from 1 and x, we can reach 4 other polynomials namely: x^2, 2x, x+1 and 2.
		

Crossrefs

Cf. A352969.

Programs

  • Mathematica
    s[0]={1,x}; s[n_]:=s[n]= Union[Expand/@ Flatten@ ({Plus@@#, Times@@#}& /@ Tuples[s[n-1],2])]; a[n_]:=Length@ s@ n; a/@ Range[0,4] (* Giovanni Resta, Apr 10 2025 *)
  • PARI
    lista(nn) = {my(v = [1, x]); print1(#v, ", "); for (n=1, nn, v = setunion(setbinop((x, y)->(x+y), v), setbinop((x, y)->(x*y), v)); print1(#v, ", "); ); } \\ Yifan Xie, Apr 09 2025

Extensions

a(5) from Bert Dobbelaere, Apr 11 2025

A376181 Array read by antidiagonals: Start from 1 and thereafter add gnomons of terms for each t >= 2 with width a(t-1).

Original entry on oeis.org

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

Author

Bryle Morga, Sep 14 2024

Keywords

Comments

A gnomon is an L-shaped group of terms that are equal to each other and surrounds the top-left corner.
The sequence seems to oscillate a lot and it seems that log(a(n))/log(n) doesn't converge. However, log(max{a(i); i < n})/log(n) appears to converge to around ~0.387.
The formula a(d(d+1)/2) = n, where d = 1 + (a(1) + ... + a(n-1)), suggests that the sequence might be growing like k*n^c on average, where c = (sqrt(3)-1)/2.
The construction is similar to the Golomb sequence (A001462) in that sequence terms themselves determine repetitions, but here those repetitions are gnomon widths.

Examples

			Array begins:
      k=1 2 3 4 5 6
  n=1:  1 2 3 3 4 4
  n=2:  2 2 3 3 4 4
  n=3:  3 3 3 3 4 4
  n=4:  3 3 3 3 4 4
  n=5:  4 4 4 4 4 4
  n=6:  4 4 4 4 4 4
The first three terms by antidiagonals are 1,2,2 and they are the widths of the gnomons comprising terms 2,3,4 respectively.
		

Crossrefs

Formula

a(d(d+1)/2) = n, where d = 1 + (a(1) + ... + a(n-1)), for n > 1.
a(n) ~ k*n^c, on average, where c = (sqrt(3)-1)/2 = 0.366... (heuristic).
max{a(i); i < n} ~ K*n^e with e ~ 0.387... (empirical).

A376635 a(n+1) = size of the largest subset S of 1...n such that i+j <= n implies a(i+j) = a(i)+a(j) for i and j in S. Start with a(1) = 1.

Original entry on oeis.org

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

Author

Bryle Morga, Sep 30 2024

Keywords

Programs

  • Maple
    f:= proc(n) local V,E,G,i,j; uses GraphTheory;
          V:= select(t -> 2*t > n or 2*A[t] = A[2*t], [$1..n]);
          E:= select(t -> t[1]+t[2] <= n and A[t[1]]+A[t[2]] <> A[t[1]+t[2]],{seq(seq({V[i],V[j]},i=1..j-1),j=1..nops(V))});
          G:= Graph(V,E);
          IndependenceNumber(G)
    end proc:
    A[1]:= 1:
    for n from 1 to 99 do A[n+1]:= f(n) od:
    seq(A[i],i=1..100); # Robert Israel, Oct 31 2024
  • Python
    from itertools import combinations, count, islice
    def c(n, s, a): # test the condition for subset s
        for ii, i in enumerate(s):
            for j in s[ii:]:
                if i+j <= n:
                    if a[i] + a[j] != a[i+j]:
                        return False
                else:
                    break
        return True
    def agen(): # generator of terms
        a, valid = [None, 1], [tuple()]
        yield 1
        for n in count(1):
            new_valid, r = [], 0
            for s in valid:
                if c(n, s, a):
                    new_valid.extend([s, s+(n,)])
                    r = max(r, len(s)+1)
            valid = new_valid
            yield r
            a.append(r)
    print(list(islice(agen(), 30))) # Michael S. Branicky, Oct 01 2024

Extensions

a(23)-a(58) from Michael S. Branicky, Oct 01 2024
More terms from Robert Israel, Oct 31 2024

A376004 Limiting matrix {m_n}, where m_0 = 1 and m_{i+1} = [[m_i, A(m_i)], [B(m_i), C(m_i)]], read by antidiagonals, and A adds the corresponding x-coords to every element, B subtracts it, and C adds the corresponding y-coords.

Original entry on oeis.org

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

Author

Bryle Morga, Sep 05 2024

Keywords

Comments

Start with M_0 = [[1]]. M_n is a 2^n X 2^n matrix. M_{n+1} is constructed from M_n as follows:
| M_n A(M_n) |
M_{n+1} = | |
| B(M_n) C(M_n) |
A - adds the corresponding x-coords to the elements of the matrix
B - subtracts the corresponding x-coords to the elements of the matrix
C - adds the corresponding y-coords to the elements of the matrix
The coordinate system sets the top-left corner to be (0, 0).
Then we take the limiting matrix {M_n}, and turn it into an integer sequence by reading it by antidiagonals.

Examples

			M_0 = [1] by definition. Constructing M_1 goes as follows:
A(M_0) = M_0 + [0] = [1]
B(M_0) = M_0 - [0] = [1]
C(M_0) = M_0 + [0] = [1]
So we have:
            |  1    1 |
M_1 =       |  1    1 |
From this M_2 can be constructed:
A(M_2) = M_1+[[0, 1],[0, 1]] = [[1, 2], [1, 2]]
B(M_2) = M_1-[[0, 1],[0, 1]] = [[1, 0], [1, 0]]
C(M_2) = M_1+[[0, 0],[1, 1]] = [[1, 1], [2, 2]]
      | 1 1 1 2 |
      | 1 1 1 2 |
M_2 = | 1 0 1 1 |
      | 1 0 2 2 |
		

Programs

  • Python
    def expand(m):
      i = len(m)
      res = [[0 for  in range(2*i)] for  in range(2*i)]
      for x in range(i):
        for y in range(i):
          res[y][x] = m[y][x]
          res[y][x+i] = m[y][x] + x
          res[y+i][x] = m[y][x] - x
          res[y+i][x+i] = m[y][x] + y
      return res
    a = []
    m = [[1]]
    for _ in range(11):
      m = expand(m)
    for i in range(len(m)):
      for j in range(i+1):
        a.append(m[j][i-j])

A375907 Lexicographically earliest sequence where a(n) is the length of the n-th block of distinct integers sharing a prime factor.

Original entry on oeis.org

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

Author

Bryle Morga, Sep 02 2024

Keywords

Comments

Does every positive integer > 1 appear eventually?

Examples

			The sequence and blocks begin
  n    = 1 2  3 4 5 6  7 8 9 ...
  a(n) = 2,4, 3,6,2,4, 3,6,2, 3,6,2,4,8,10, 3,6, ...
  block  \-/  \-----/  \---/  \----------/  \-/
  length  2      4       3         6         2   ...
a(7) = 3 is the start of a new block since it has no common factor with the preceding a(6) = 4.
The block lengths are the sequence itself.
		

Programs

  • Python
    from math import gcd
    from itertools import count, islice
    def agen(): # generator of terms
        n, an, alst = 1, 2, [-3]
        while True:
            b = [next(i for i in count(2) if gcd(i, alst[-1])==1)]
            for i in range(an-1):
                b += [next(j for j in count(2) if j not in b and gcd(j, b[-1])!=1)]
            yield from b
            alst.extend(b)
            n, an = n+1, alst[n+1]
    print(list(islice(agen(), 95))) # Michael S. Branicky, Sep 02 2024

A375065 Starting index of the first length-n (exactly) run of zeros in A374966.

Original entry on oeis.org

0, 21, 1798, 429, 10727, 431795, 8394951, 171051143
Offset: 1

Author

Bryle Morga, Jul 29 2024

Keywords

Crossrefs

Programs

Formula

a(2) = 21; A374966(21) = A374966(22) = 0.
a(3) = 1798; A374966(1798) = A374966(1799) = A374966(1800) = 0.

A375060 Values of k for which A374966(k) = 0.

Original entry on oeis.org

0, 3, 9, 15, 21, 22, 30, 33, 46, 47, 51, 60, 63, 69, 70, 72, 90, 97, 98, 105, 123, 125, 129, 142, 147, 153, 159, 180, 182, 183, 195, 199, 213, 214, 219, 222, 253, 259, 261, 262, 270, 276, 287, 297, 298, 300, 309, 321, 327, 330, 342, 369, 370, 375, 381, 385, 393, 401, 402, 429, 430, 431, 432, 441
Offset: 1

Author

Bryle Morga, Jul 29 2024

Keywords

Comments

It seems that this sequence grows linearly but this is unproven.

Examples

			21 is a term; A374966(11) = 21 and by the definition of A374966, A374966(21) = 0.
		

Crossrefs

Cf. A374966.

Programs

Formula

A374966(a(n)) = 0.
a(n) ~ c*n, empirically, with c = 7.42...

A375088 Mountain Sequence: Sequence that when expressed as non-overlapping mountains, the n-th term is the height and base of the n-th mountain.

Original entry on oeis.org

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

Author

Bryle Morga, Jul 29 2024

Keywords

Comments

A mountain with base b and height h is a segment starting with b, then climbs to b+h, and goes back to b. So as an example, (1, 2, 3, 2, 1) is a mountain with base of 1 and height of 2.
All positive integers appear in the sequence infinitely many times.

Examples

			a(1) = 1, so the first non-overlapping mountain is 1, 2, 1 with h = b = 1.
Now, a(2) = 2, so the mountain 2, 3, 4, 3, 2 with b = h = 2 is appended to the sequence, and so on.
		

Programs

  • Python
    from itertools import islice
    def mountain(h):
        return list(range(h, 2*h + 1)) + list(range(2*h-1, h-1, -1))
    def agen():
        a = [1, 2, 1]
        yield 1
        i = 1
        while 1:
           a += mountain(a[i])
           yield a[i]
           i += 1
    print(islice(agen(), 104))

Formula

|a(n+1) - a(n)| = 1.