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: Gavin Lupo

Gavin Lupo's wiki page.

Gavin Lupo has authored 19 sequences. Here are the ten most recent ones:

A384632 a(0)=0. For each digit d in the sequence, let a(n) equal the smallest unused integer which has at least d divisors.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 12, 5, 7, 16, 24, 8, 18, 9, 10, 30, 11, 36, 48, 13, 14, 15, 17, 19, 20, 21, 28, 22, 40, 23, 25, 26, 27, 29, 32, 31, 42, 33, 60, 34, 35, 37, 38, 39, 54, 41, 43, 44, 45, 46, 49, 47, 50, 51, 52, 53, 56, 55, 72, 57, 58, 62, 59, 63, 61, 64, 65
Offset: 0

Author

Gavin Lupo, Jun 05 2025

Keywords

Examples

			a(0) = 0.
a(1) = Smallest unused integer with at least 0 divisors = 1.
a(2) = Smallest unused integer with at least 1 divisor = 2.
a(3) = Smallest unused integer with at least 2 divisors = 3.
a(4) = Smallest unused integer with at least 3 divisors = 4.
a(5) = Smallest unused integer with at least 4 divisors = 6.
a(6) = Smallest unused integer with at least 6 divisors = 12.
a(7) = Smallest unused integer with at least 1 divisor = 5.
a(8) = Smallest unused integer with at least 2 divisors = 7.
		

Crossrefs

Programs

  • Python
    from sympy import divisor_count
    a = [0]
    for n in range(100):
        if a[n] >= 10:
            split = [int(d) for d in str(a[n])]
        else:
            split = [a[n]]
        for s in split:
            num = 1
            while True:
                if divisor_count(num) >= s and num not in a:
                    a.append(num)
                    break
                num += 1
    print(a)

A371620 Fractal sequence based on a heptagon: a(n) = number of unobscured heptagons remaining after completing step n.

Original entry on oeis.org

1, 1, 8, 48, 266
Offset: 1

Author

Gavin Lupo, Mar 29 2024

Keywords

Comments

Start with a single regular heptagon. The heptagon fractal is constructed by taking with the previous completed step, and overlapping it in its entirety to each vertex (excluding the top vertex as they overlap completely). Once constructed, any unobscured heptagons within are counted. "Unobscured" means no lines cross through it, and its shape is regular. See links for images.

Examples

			Start with a(1) = 1 unobscured heptagon. For the next step, take step 1's entire shape and place it at each vertex. Although the total number of heptagons is 7, only 1 unobscured heptagon remains, so a(2) = 1.
		

Crossrefs

Cf. A371536.

A371536 a(n) is the number of unobscured pentagons remaining after completing step n.

Original entry on oeis.org

1, 1, 6, 41, 186
Offset: 1

Author

Gavin Lupo, Mar 26 2024

Keywords

Comments

Start with a single regular pentagon. The pentagon fractal is constructed by taking with the previous completed step, and overlapping it in its entirety to each vertex (excluding the top vertex as they overlap completely). Once constructed, any unobscured pentagons within are counted. "Unobscured" means no lines cross through it, and its shape is regular. See links for images.

Examples

			Start with a(1) = 1 unobscured pentagon. For the next step, take step 1's entire shape and place it at each vertex. Although the total number of pentagons is 5, only 1 unobscured pentagon remains, so a(2) = 1.
		

A363654 Lexicographically earliest sequence of positive integers such that the n-th pair of identical terms encloses exactly a(n) terms.

Original entry on oeis.org

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

Author

Eric Angelini and Gavin Lupo, Jun 13 2023

Keywords

Comments

Pairs are numbered according to the position of the second term.

Examples

			a(1) = 1. The 1st constructed pair encloses 1 term:  [1, 2, 1].
a(2) = 2. The 2nd constructed pair encloses 2 terms: [2, 1, 3, 2].
a(3) = 1. The 3rd constructed pair encloses 1 term:  [3, 2, 3].
a(4) = 3. The 4th constructed pair encloses 3 terms: [1, 3, 2, 3, 1].
a(5) = 2. The 5th constructed pair encloses 2 terms: [2, 3, 1, 2].
a(6) = 3. The 6th constructed pair encloses 3 terms: [3, 1, 2, 4, 3].
a(7) = 1. The 7th constructed pair encloses 1 term:  [4, 3, 4].
...
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        a, indexes = [1], {1: 0}
        yield a[-1]
        for i in count(0):
            num = 1
            while True:
                if num in indexes:
                    if (len(a) - indexes[num]) == (a[i]+1):
                        an = num; indexes[an] = len(a); a.append(an); yield an
                        break
                    else:
                        num += 1
                else:
                    an = max(a)+1; indexes[an] = len(a); a.append(an); yield an
                    num = 1
    print(list(islice(agen(), 100))) # Gavin Lupo and Michael S. Branicky, Jun 13 2023

A363247 a(0) = 0. a(n) = the smallest nonnegative integer, excluding a(n-1), not occurring in all occurrences of a(n-1)'s eight neighbors thus far in a square spiral.

Original entry on oeis.org

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

Author

Gavin Lupo, May 24 2023

Keywords

Examples

			The spiral begins:
  0---8---1---7---0
  |               |
  9   4---3---2   6
  |   |       |   |
  2   1   0---1   3   .
  |   |           |   .
  8   5---2---4---5   .
  |                   |
  6---4---7---8---10--0
a(0) = 0
a(1) = 1. Smallest integer that's not a neighbor to every 0 = 1.
a(2) = 2. Smallest integer that's not a neighbor to every 1 = 2.
a(3) = 3. Smallest integer that's not a neighbor to every 2 = 3.
a(4) = 4. Smallest integer that's not a neighbor to every 3 = 4.
a(5) = 1. Smallest integer that's not a neighbor to every 4 = 1.
		

Crossrefs

A363083 a(0)=a(1)=1. For n>1, if the number of occurrences of a(n-1) is less than abs(a(n-1)), then a(n)=a(n-1)-a(n-2). Otherwise, a(n)=a(n-1)+a(n-2).

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 5, 3, -2, -5, -3, 2, -1, 1, 0, 1, 1, 2, 3, 5, 2, 7, 5, -2, 3, 1, 4, 3, 7, 4, -3, -7, -4, 3, -1, 2, 1, 3, 4, 1, 5, 4, 9, 5, 14, 9, -5, -14, -9, 5, -4, -9, -5, 4, -1, 3, 2, 5, 7, 2, 9, 7, -2, 5, 3, 8, 5, 13, 8, -5, -13, -8, 5, -3, 2, -1, 1, 0
Offset: 0

Author

Gavin Lupo, May 18 2023

Keywords

Examples

			a(0) = 1
a(1) = 1
a(2) = 2. Two 1's in the list so far.    2 > abs(1).   1 + 1 = 2.
a(3) = 1. One 2 in the list so far.      1 < abs(2).   2 - 1 = 1.
a(4) = 3. Three 1's in the list so far.  3 > abs(1).   1 + 2 = 3.
		

Crossrefs

Programs

  • Python
    from itertools import islice
    from collections import Counter
    def agen(): # generator of terms
        anprev, an, c = 1, 1, Counter([1])
        yield 1
        while True:
            yield an
            c[an] += 1
            anprev, an = an, an-anprev if c[an] < abs(an) else an+anprev
    print(list(islice(agen(), 80))) # Michael S. Branicky, May 18 2023

A363086 a(0)=a(1)=1. For n>1, let c=count of all occurrences of a(n-1) in the list so far. If c < abs(a(n-1)), then a(n)=c-a(n-1). Otherwise, a(n)=c.

Original entry on oeis.org

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

Author

Gavin Lupo, May 18 2023

Keywords

Comments

This is a variant of A363083.

Examples

			a(0) =  1
a(1) =  1
a(2) =  2. Two 1's in the list so far.  2 > abs(1).      c =  2.
a(3) = -1. One 2 in the list so far.    1 < abs(2).  1 - 2 = -1.
a(4) =  1. One -1 in the list so far.   1 = abs(-1).     c =  1.
		

Crossrefs

Cf. A363083.

Programs

  • Python
    from itertools import islice
    from collections import Counter
    def agen(): # generator of terms
        an, c = 1, Counter([1, 1])
        yield from [1, 1]
        while True:
            an = c[an]-an if c[an] < abs(an) else c[an]
            c[an] += 1
            yield an
    print(list(islice(agen(), 80))) # Michael S. Branicky, May 19 2023

A362896 a(0)=2. For n>0, let d = n-th digit in the sequence thus far. a(n) = a(n-1) + d if d is even. Otherwise, a(n) = a(n-1) - d.

Original entry on oeis.org

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

Author

Gavin Lupo, May 09 2023

Keywords

Comments

"-" signs on negative values are ignored when determining the n-th digit.

Examples

			a(0) =  2.
a(1) =  4. 1st digit is 2, which is even. 2 + 2 = 4.
a(2) =  8. 2nd digit is 4, which is even. 4 + 4 = 8.
a(3) = 16. 3rd digit is 8, which is even. 8 + 8 = 16.
a(4) = 15. 4th digit is 1, which is odd.  16 - 1 = 15.
a(5) = 21. 5th digit is 6, which is even. 15 + 6 = 21.
		

Crossrefs

Programs

  • Python
    a = [2]
    split = []
    for i in range(100):
        split += [int(j) for j in str(abs(a[i]))]
        if split[i] % 2 == 0:
            a.append((a[i] + split[i]))
        else:
            a.append((a[i] - split[i]))
    print(a)

A362746 a(1)=a(2)=1; a(n)=The count of all occurrences in the list so far where integer a(n-1) appears adjacent to integer a(n-2).

Original entry on oeis.org

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

Author

Gavin Lupo, May 01 2023

Keywords

Examples

			a(1) = 1.
a(2) = 1.
a(3) = 2. How many 1's so far are adjacent to a 1? = 2.
a(4) = 1. How many 2's so far are adjacent to a 1? = 1.
a(5) = 2. How many 1's so far are adjacent to a 2? = 2.
a(6) = 2. How many 2's so far are adjacent to a 1? = 2.
		

Crossrefs

Programs

  • Mathematica
    K = {1, 1}; While[Length@K < 87, A = Position[K, Last@K]; c = 0; For[a = 1, a <= Length@A, a++, If[K[[A[[a]] - 1]] == {K[[Length@K - 1]]} || K[[A[[a]] + 1]] == {K[[Length@K - 1]]}, c++]]; AppendTo[K, c]]; Print[K] (* Samuel Harkness, May 08 2023 *)
  • Python
    from itertools import islice
    from collections import Counter
    def agen(): # generator of terms
        aprev, an, anext, c = 0, 1, 1, Counter({(1, 1)})
        while True:
            aprev, an, anext = an, anext, c[an, anext]
            c[an, anext] += 1
            if aprev != anext: c[anext, an] +=  1
            yield an
    print(list(islice(agen(), 100))) # Michael S. Branicky, May 02 2023

A362190 Triangle read by rows: T(n,k) is the smallest integer not already in the same row or column and also not diagonally adjacent to an equal integer.

Original entry on oeis.org

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

Author

Gavin Lupo, Apr 10 2023

Keywords

Comments

This sequence is A025581 without diagonal adjacent restriction.

Examples

			Triangle begins:
  n\k|  1  2  3  4  5  6  7  8 ...
  ---+----------------------------
   1 |  0
   2 |  1  2
   3 |  3  0  1
   4 |  2  4  3  0
   5 |  5  1  2  4  3
   6 |  4  3  0  1  2  5
   7 |  6  5  4  3  0  1  2
   8 |  7  8  6  2  4  3  0  1
		

Crossrefs

Cf. A025581.

Programs

  • PARI
    \\ here f(S) gives smallest not in set S.
    f(S)={for(k=0, oo, if(!setsearch(S,k), return(k)))}
    T(n)={my(M=matrix(n,n)); for(i=2, n, for(j=1, i, my(S=Set(concat([M[j..i-1,j]~, M[i,1..j-1], M[i-1,max(1,j-1)], M[i-1,min(j+1,i-1)]]))); M[i,j]=f(S))); M}
    { my(A=T(10)); for(i=1, #A, print(A[i, 1..i])) } \\ Andrew Howroyd, Apr 10 2023