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

A338091 a(n) is the only positive integer k such that A337226(k) = A337226(k + n).

Original entry on oeis.org

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

Views

Author

Peter Kagey, Oct 09 2020

Keywords

Examples

			For n = 6, a(6) = 5 because A337226(5) = 3 = A337226(5 + 6).
		

Crossrefs

A338092 a(n) = A337226(A338091(n)); the unique A337226(k) such that A337226(k) = A337226(k + n).

Original entry on oeis.org

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

Views

Author

Peter Kagey, Oct 09 2020

Keywords

Examples

			For n = 6, a(6) = 3 because A337226(5) = A337226(5 + 6) = 3.
		

Crossrefs

Formula

a(n) = A337226(A338091(n)).

A366691 Lexicographically earliest sequence such that each set of terms enclosed by two equal values, excluding the endpoints, contains a distinct number of elements.

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Oct 17 2023

Keywords

Comments

The word 'set' means that every element is unique. For example, the set {1,1,2} contains 2 elements (not 3).
Note that we are considering sets between every pair of equal values, not just those that appear consecutively.
Two consecutive values enclose 0 terms, and thus after [a(1), a(2)] = [1, 1], no consecutive equal values occur again.

Examples

			a(1)=1; no pair of terms exists yet.
a(2)=1 creates the pair [1, 1], which encloses 0 elements. This means that no consecutive equal values can occur again, since this would create another set of 0 elements.
a(3)=2 because if a(3)=1, this would create a second pair enclosing 0 elements.
a(4)=1 creates two new sets: [1, 2, 1], enclosing 1 element {2}, and [1, 1, 2, 1], enclosing 2 elements {1, 2}.
a(5) cannot be 1 as this would again create a pair enclosing 0 elements [1,1]. 2 would create the pair [2, 1, 2] which encloses 1 element {1}, which has been impossible since a(4). So a(5)=3, which has not occurred before.
		

Crossrefs

Cf. A337226 (with nondistinct terms counted), A330896, A363757, A366631.

Programs

  • PARI
    See Links section.
    
  • Python
    from itertools import islice
    def agen(): # generator of terms
        e, a = set(), []
        while True:
            an, allnew = 0, False
            while not allnew:
                allnew, an, ndset = True, an+1, set()
                for i in range(len(a)):
                    if an == a[i]:
                        nd = len(set(a[i+1:]))
                        if nd in e or nd in ndset: allnew = False; break
                        ndset.add(nd)
            yield an; a.append(an); e |= ndset
    print(list(islice(agen(), 72))) # Michael S. Branicky, Oct 25 2023

Extensions

More terms from Rémy Sigrist, Oct 25 2023

A367467 Lexicographically earliest infinite sequence of positive integers such that a(n + a(n)) is distinct for all n.

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Nov 18 2023

Keywords

Comments

Consider each index i as a location from which one can jump a(i) terms forward. To find a(n) we have to check 2 conditions:
1. The value a(n) can be reached in one jump by at most one previous location.
2. Location n reaches a location in one jump that is not reached in one jump from a location before n.
Described in the above way, the sequence seems to be structured as follows:
A083051 appears to give the indices which cannot be reached from any earlier term; the terms at these indices are 1s and 2s.
A087057 appears to give the indices which can be reached from an earlier term; except for a(2), these terms are first occurrences.
From Thomas Scheuerle, Nov 26 2023: (Start)
Empirical observations:
It appears that this sequence consists of the natural numbers in ascending order interspersed by 1 and 2.
If we consider the distance between successive ones, we will observe a nonperiodic pattern: 9,7,17,17,7,10,7,17,7,10,... . It appears that there are only 7, 10 and 17 with the exception of 9 once.
If we consider the distance between successive twos, we will also observe an interesting nonperiodic pattern: 3,7,7,3,4,3,7,3,4,3,7,7,3,... . It appears that this pattern consists only of 3, 4 and 7. (End)

Examples

			Initial locations and the (by definition) distinct terms that they reach:
     n|  1  2  3  4  5  6  7  8  9
  a(n)|  1  1  2  2  3  4  2  5  6
          =>1=>2====>3
                   ====>4
                      =======>5
                            ====>6
When we evaluate a(i+a(i)) with each index i, we get a distinct value. When i=1, for example, a(1+a(1))=a(1+1)=a(2)=1;  no other i gives 1 as the solution to a(i+a(i)). When i=4, a(4+a(4))=a(4+2)=a(6)=4, and 4 is likewise a solution unique to i=4.
		

Crossrefs

Programs

  • MATLAB
    function a = A367467( max_n )
        a = [1 1:2*max_n];
        for n = 3:max_n
            a(n) = 1;
            while consistency(a, n) == false
                a(n) = a(n)+1;
            end
        end
        a = a(1:max_n);
    end
    function ok = consistency(a, n)
        v = a([1:n] + a(1:n));
        ok = (n == length(unique(v)));
    end % Thomas Scheuerle, Nov 21 2023

Formula

From Thomas Scheuerle, Nov 26 2023: (Start)
Conjectures:
a(n) = A049472(n) = floor(n*(1 + 1/sqrt(2))) - n, if n is not in A083051.
a(A083051(n)) = A184119(n+1) - A083051(n).
a(a(A083051(n)) + A083051(n)) + a(A083051(n)) + A083051(n) = A328987(n) = floor((a(A083051(n)) + A083051(n))*(1 + 1/sqrt(2))) = floor(A184119(n+1)*(1 + 1/sqrt(2))). (End)

A337804 Lexicographically earliest triangle of nonnegative integers read by rows such that for each pair (x,y) != (0,0), there is at most one pair (n,k) such that T(n,k) = T(n+x,k+y).

Original entry on oeis.org

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

Views

Author

Aidan Clarke, Sep 22 2020

Keywords

Comments

Each value is determined by placing the least possible nonnegative integer that will abide by the rules of the sequence.

Examples

			Triangle begins:
0;
0, 0;
1, 2, 1;
0, 3, 4, 0;
3, 5, 2, 6, 3;
2, 7, 8, 5, 1, 9;
...
		

Crossrefs

Cf. A337226 (linear version).

Programs

  • PARI
    T(n)={my(v=vector(n), S=Set(), L=List());
      for(n=1, #v, v[n]=vector(n); for(k=1, n, my(i=1);
        while(i<=#L, my(P=Set([[n-p[1], k-p[2]] | p<-L[i]])); if(!#setintersect(P,S), S = setunion(S,P); break); i++);
        if(i>#L, listput(L, []));
        L[i] = concat(L[i], [[n,k]]);
        v[n][k] = i-1 )); v
    }
    concat(T(12)) \\ Andrew Howroyd, Sep 24 2020
    
  • PARI
    See Links section.

Extensions

Terms a(46) and beyond from Andrew Howroyd, Sep 24 2020

A381856 Lexicographically earliest sequence of positive integers such that for any value k, no two sets of two or more indices at which k occurs have the same standard deviation.

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Mar 08 2025

Keywords

Comments

A382381 gives the indices of 1s in this sequence.
If the definition is modified to compare all sets of indices whose terms are equal (not just those sets with the same value k), we get A337226.

Examples

			a(13) = 3: a(13) cannot be 1 as i = 4,13 would have the same standard deviation as i = 1,4,8,13 (namely 4.5). We cannot have a(13) = 2 because i = 3,6 would have the same standard deviation as i = 10,13 (namely 1.5). With a(13) = 3, we find that no two subsets of i = 7,9,12,13 have the same standard deviation, so a(13) = 3.
		

Crossrefs

A338367 Square spiral of nonnegative integers built by greedy algorithm such that for any (i, j) <> (0, 0) there is at most one position, say (n, k), such that the values at (n, k) and at (n+i, k+j) are the same.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Oct 23 2020

Keywords

Comments

This sequence is a variant of A337804.

Examples

			The spiral begins:
      10--13---8--12---9--11---7
       |                       |
      11   2---6---5---4---3  10
       |   |               |   |
      14   7   0---1---0   2   8
       |   |   |       |   |   |
      15   4   2   0---0   3   9
       |   |   |           |   |
      12   6   1---3---4---1   7
       |   |                   |
      13   5---7---8---9---5---6
       |
      10--14--11--15--16--17--12
		

Crossrefs

Programs

  • PARI
    See Links section.

A369422 Lexicographically earliest infinite sequence such that no two equal unordered pairs (a(j), a(k)) have the same distance abs(j-k).

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Jan 22 2024

Keywords

Comments

In other words: The absolute distance between the indices of any two terms (A and B) is distinct among all pairs of terms in the sequence with the same two values (A and B).
No value can occur more than twice: 1) If two terms have the same value, one term must be at an odd index and the other at an even index. Otherwise we would have a middle term B equidistant from two equal terms in an ABA-form progression, which contradicts the sequence's definition. 2) So we can have at most one term with a given value at an even index and one at an odd index.
Any unordered pair (A, B) has a maximum of 4 distinct distances (A1 to B1, A1 to B2, A2 to B1, A2 to B2).
For the equivalent sequence using ordered pairs, see A337226.

Examples

			a(7)=5: We cannot have a(7)=1 because then, for example, the unordered pair (1,2) would have the same absolute distance twice at distinct indices:
1, 1, 2, 3, 4, 2, 1
   1--2        2--1
a(7) could not equal 2 because again the pair (1,2) would have the same absolute distance twice at different indices (i=6-1=5 and i=7-2=5):
1, 1, 2, 3, 4, 2, 2
1--------------2
   1--------------2
a(7) cannot be 3 because of the following two equal unordered pairs, which would have the same distance:
1, 1, 2, 3, 4, 2, 3
      2--3     2--3
a(7) cannot be 4, or we would have two equal unordered pairs both with distance 1:
1, 1, 2, 3, 4, 2, 4
            4--2
               2--4
a(7) can be 5 without restriction since 5 is a first occurrence and every unordered pair with 5 has a distinct distance.
		

Crossrefs

Cf. A136119, A184119 (conjectured first and second occurrences).
Showing 1-8 of 8 results.