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-6 of 6 results.

A360744 a(n) is the maximum number of locations 1..n-1 which can be reached starting from some location s, where jumps from location i to i +- a(i) are permitted (within 1..n-1); a(1)=1. See example.

Original entry on oeis.org

1, 1, 2, 3, 4, 5, 5, 6, 6, 7, 7, 9, 10, 10, 10, 11, 11, 13, 14, 14, 14, 15, 15, 15, 15, 21, 21, 21, 22, 22, 22, 23, 23, 23, 23, 24, 24, 26, 27, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 32, 32, 32, 32, 33, 33, 35, 35, 41, 42, 42, 42, 43, 43, 43, 44, 44, 45, 45, 46, 46, 46, 46, 46, 46, 47, 47, 49, 49, 51, 51, 51
Offset: 1

Views

Author

Neal Gersh Tolunsky, Feb 18 2023

Keywords

Comments

a(10)=7 is the earliest term whose solution cannot be represented by a single path in which each index is visited once.

Examples

			For a(9), we reach the greatest number of terms by starting at location s=4, which is a(4)=3. We visit 6 terms as follows (each line shows the next unvisited term(s) we can reach from the term(s) last visited):
1, 1, 2, 3, 4, 5, 5, 6
1<-------3------->5
1, 1, 2, 3, 4, 5, 5, 6
1->1<-------------5
1, 1, 2, 3, 4, 5, 5, 6
   1->2
1, 1, 2, 3, 4, 5, 5, 6
      2---->4
From the last iteration we can visit no new terms. We reached 6 terms, so a(9)=6:
1, 1, 2, 3, 4, 5, 5, 6
1  1  2  3  4     5
		

Crossrefs

Programs

  • Python
    def A(lastn,mode=0):
      a,n,t=[1],0,1
      while n0:
            if not d[-1][-1] in rr:rr.append(d[-1][-1])
            if d[-1][-1]-a[d[-1][-1]]>=0:
              if d[-1].count(d[-1][-1]-a[d[-1][-1]])0: d.append(d[-1][:])
                d[-1].append(d[-1][-1]+a[d[-1][-1]])
                r=1
            if g>0:
              if r>0: d[-2].append(d[-2][-1]-a[d[-2][-1]])
              else: d[-1].append(d[-1][-1]-a[d[-1][-1]])
              r=1
            if r==0:d.pop()
            r,g=0,0
          if v0: print(a)
      return a ## S. Brunner, Feb 19 2023

A367849 Lexicographically earliest infinite sequence of positive integers such that for each n, the values in a path of locations starting from any i=n are all distinct, where jumps are allowed from location i to i+a(i).

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Dec 08 2023

Keywords

Comments

Consider each index i as a location from which one can jump a(i) terms forward. No starting index can reach the same value more than once by forward jumps.
The value a(i) at the starting index is not part of the path (and thus allows a(2)=1).
The indices of first occurrences are given by A133263 (essentially triangular numbers + 2).
Changing the definition so that jumps are allowed only from location i to i-a(i) gives A002260.

Examples

			We can see, for example, that the terms reachable by jumping forward continuously from i=1 are all distinct (and in this case are just the positive integers):
  1, 1, 2, 1, 3, 1, 1, 4, 1, 1, 2, 5
  *->1->2---->3------->4---------->5
Beginning at i=9 and jumping forward continuously, we get the sequence 1,2,3,4,5,6,7,9 (in which all terms are likewise distinct).
		

Crossrefs

Cf. A367467, A367832, A133263 (index of first occurrences), A362248.

Programs

  • MATLAB
    function a = A367849( max_n )
        a = zeros(1,max_n); j = find(a == 0,1);
        while ~isempty(j)
            a(j) = 1; k = 1;
            if j+k < max_n
                while a(j+k) == 0
                    a(j+k) = k;
                    if j+2*k-1 < max_n
                        j = j+(k-1); k = k+1;
                    else
                        break;
                    end
                end
            end
            j = find(a == 0,1);
        end
    end % Thomas Scheuerle, Dec 09 2023

Formula

a(A133263(n)) = n + 1.

A365576 a(1)=2; thereafter a(n) is the number of strongly connected components in the digraph of the sequence thus far, where jumps from location i to i+-a(i) are permitted (within 1..n-1).

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Sep 09 2023

Keywords

Comments

If two locations j and k can reach other, then they belong to the same strongly connected component and can reach the same set of locations.
a(n) <= a(n-1) + 1.

Examples

			a(5)=3 because there are 3 distinct sets of locations which represent the indices reachable from a given location s.
Starting at s=1, we can visit the set of locations i = {1, 3}
  1  2  3  4
  2, 1, 2, 2
  2---->2
This is the same set of locations that can be visited from s=3. Since it is the same set, we only count it once:
  1  2  3  4
  2, 1, 2, 2
  2<----2
From s=2, we can visit the set of locations i = {1, 2, 3}:
  1  2  3  4
  2, 1, 2, 2
  2<-1->2
From s=4, we can visit another distinct set of locations i = {1, 2, 3, 4}
  1  2  3  4
  2, 1, 2, 2
     1<----2
  2<-1->2
This gives a total of 3 distinct sets of locations reachable from any starting index (equivalent to 3 strongly connected components):
  i = {1, 3}; i = {1, 2, 3}; and i = {1, 2, 3, 4}.
		

Crossrefs

A367026 a(1) = 0, a(2) = 1; thereafter a(n) is the smallest index < n not equal to i +- a(i) for any i = 1..n-1.

Original entry on oeis.org

0, 1, 2, 2, 4, 4, 4, 4, 7, 7, 7, 7, 7, 7, 8, 8, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 15, 15, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 25, 25, 25, 25, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40
Offset: 1

Views

Author

Neal Gersh Tolunsky, Nov 01 2023

Keywords

Comments

The sequence is nondecreasing.

Examples

			a(3)=2 because a(2)=1 has i - a(i) = 2-1 = 1, which means that 1 cannot be a term (since it can be expressed as i - a(i) for some index i in the sequence thus far). 2 cannot be reached in this way, so a(3)=2.
a(5)=4 because 1 = 2 - a(2) (as seen above); 2 = 4 - a(4); and 3 = 2 + a(2). 4 cannot be the answer to any such expression, so a(5)=4.
Another way to see this is to consider each index i as a location from which one can jump forward or back a(i) terms. To find a(5), we see that there is no way to reach i=4, which is the smallest-indexed location with this property.
0, 1, 2, 2
0<-1
0, 1, 2, 2
   1<----2
0, 1, 2, 2
   1->2
0, 1, 2, 2
         ?
		

Crossrefs

A367128 a(1)=a(2)=1; thereafter a(n) is the radius of the sequence's digraph, where jumps from location i to i+-a(i) are permitted (within 1..n-1).

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Nov 05 2023

Keywords

Comments

The radius of the sequence's digraph is the smallest eccentricity of any vertex (location) in the graph. The eccentricity of a location i means the largest number of jumps in the shortest path from location i to any other location.

Examples

			To find a(5), we can look at the eccentricity of each location:
  i            = 1     2     3     4
  a(i)         = 1,    1,    1,    1
                 1 <-> 1 <-> 1 <-> 1
  eccentricity = 3     2     2     3
i=1 has eccentricity 3 because it requires up to 3 jumps to reach any other location (3 to i=4), and similarly i=4 has eccentricity 3 too.
i=2 and i=3 have eccentricity 2 as they require at most 2 jumps to reach anywhere.
The smallest eccentricity of any location is 2, which makes 2 the radius of the sequence's digraph, so a(5)=2.
		

Crossrefs

Programs

  • C
    /* See links */

A367129 a(1)=a(2)=1; thereafter a(n) is the diameter of the sequence's digraph, where jumps from location i to i+-a(i) are permitted (within 1..n-1).

Original entry on oeis.org

1, 1, 1, 2, 3, 3, 4, 4, 4, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 24, 24, 24, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22
Offset: 1

Views

Author

Neal Gersh Tolunsky, Nov 05 2023

Keywords

Comments

The diameter of the sequence's digraph is the largest eccentricity of any vertex (location) in the graph. The eccentricity of a location i means the largest number of jumps in the shortest path from location i to any other location.

Examples

			a(5)=3 because i=1 has the largest eccentricity of any location. i=1 takes 3 jumps to reach i=4 in the shortest path:
  i    = 1  2  3  4
  a(i) = 1, 1, 1, 2
         1->1->1->2
Every other location has eccentricity 2, which makes 3 the largest eccentricity and thus the diameter of the sequence's digraph, so a(5)=3.
		

Crossrefs

Programs

  • C
    /* See links */
Showing 1-6 of 6 results.