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

A184117 Lower s-Wythoff sequence, where s(n) = 2n + 1.

Original entry on oeis.org

1, 2, 3, 5, 6, 8, 9, 11, 12, 13, 15, 16, 18, 19, 20, 22, 23, 25, 26, 27, 29, 30, 32, 33, 35, 36, 37, 39, 40, 42, 43, 44, 46, 47, 49, 50, 52, 53, 54, 56, 57, 59, 60, 61, 63, 64, 66, 67, 69, 70, 71, 73, 74, 76, 77, 78, 80, 81, 83, 84, 85, 87, 88, 90, 91, 93, 94, 95, 97, 98, 100, 101, 102, 104, 105, 107, 108, 110, 111, 112, 114, 115, 117, 118, 119, 121, 122, 124, 125, 126, 128, 129, 131, 132, 134, 135, 136, 138, 139, 141
Offset: 1

Views

Author

Clark Kimberling, Jan 09 2011

Keywords

Comments

Suppose that s(n) is a nondecreasing sequence of positive integers. The lower and upper s(n)-Wythoff sequences, a and b, are introduced here. Define
a(1) = 1; b(1) = s(1) + a(1); and for n>=2,
a(n) = least positive integer not in {a(1),...,a(n-1),b(1),...,b(n-1)},
b(n) = s(n) + a(n).
Clearly, a and b are complementary. If s(n)=n, then
a=A000201, the lower Wythoff sequence, and
b=A001950, the upper Wythoff sequence.
A184117 is chosen to represent the class of s-Wythoff sequences for which s is an arithmetic sequence given by s(n) = kn - r. Such sequences (lower and upper) are indexed in the OEIS as shown here:
n+1....A026273...A026274
n......A000201...A001950 (the classical Wythoff sequences)
2n+1...A184117...A184118
2n.....A001951...A001952
2n-1...A136119...A184119
3n+1...A184478...A184479
3n.....A184480...A001956
3n-1...A184482...A184483
3n-2...A184484...A184485
4n+1...A184486...A184487
4n.....A001961...A001962
4n-1...A184514...A184515
The pattern continues for A184516 to A184531.
s-Wythoff sequences for choices of s other than arithmetic sequences include these:
A184419 and A184420 (s = lower Wythoff sequence)
A184421 and A184422 (s = upper Wythoff sequence)
A184425 and A184426 (s = triangular numbers)
A184427 and A184428 (s = squares)
A036554 and A003159 (invariant and limiting sequences).

Examples

			s=(3,5,7,9,11,13,...);
a=(1,2,3,5,6,8,...);
b=(4,7,10,14,17,21,...).
		

Crossrefs

Programs

  • Mathematica
    k=2; r=-1;
    mex:=First[Complement[Range[1,Max[#1]+1],#1]]&;
    s[n_]:=k*n-r; a[1]=1; b[n_]:=b[n]=s[n]+a[n];
    a[n_]:=a[n]=mex[Flatten[Table[{a[i],b[i]},{i,1,n-1}]]];
    Table[s[n],{n,30}]  (* s = A005408 except for initial 1 *)
    Table[a[n],{n,100}] (* a = A184117 *)
    Table[b[n],{n,100}] (* b = A184118 *)
  • PARI
    A184117_upto(N,s(n)=2*n+1,a=[1],U=a)={while(a[#a]1&&U[2]==U[1]+1,U=U[^1]);a=concat(a,U[1]+1));a} \\ M. F. Hasler, Jan 07 2019

Formula

a(n) = A184118(n) - s(n). - M. F. Hasler, Jan 07 2019

Extensions

Removed an incorrect g.f., Alois P. Heinz, Dec 14 2012

A136119 Limiting sequence when we start with the positive integers (A000027) and delete in step n >= 1 the term at position n + a(n).

Original entry on oeis.org

1, 3, 4, 5, 7, 8, 10, 11, 13, 14, 15, 17, 18, 20, 21, 22, 24, 25, 27, 28, 29, 31, 32, 34, 35, 37, 38, 39, 41, 42, 44, 45, 46, 48, 49, 51, 52, 54, 55, 56, 58, 59, 61, 62, 63, 65, 66, 68, 69, 71, 72, 73, 75, 76, 78, 79, 80, 82, 83, 85, 86, 87, 89, 90, 92, 93, 95, 96, 97, 99, 100
Offset: 1

Views

Author

Ctibor O. Zizka, Mar 16 2008

Keywords

Comments

Apparently a(n) = A001953(n-1)+1 = floor((n-1/2)*sqrt(2))+1 (confirmed for n < 20000) and a(n+1) - a(n) = A001030(n). From the definitions these conjectures are by no means obvious. Can they be proved? - Klaus Brockhaus, Apr 15 2008 [For an affirmative answer, see the Cloitre link.]
This is the s(n)-Wythoff sequence for s(n)=2n-1; see A184117 for the definition. Complement of A184119. - Clark Kimberling, Jan 09 2011

Examples

			First few steps are:
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,...
n = 1; delete term at position 1+a(1) = 2: 2;
1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,...
n = 2; delete term at position 2+a(2) = 5: 6;
1,3,4,5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,...
n = 3; delete term at position 3+a(3) = 7: 9;
1,3,4,5,7,8,10,11,12,13,14,15,16,17,18,19,20,...
n = 4; delete term at position 4+a(4) = 9: 12;
1,3,4,5,7,8,10,11,13,14,15,16,17,18,19,20,...
n = 5; delete term at position 5+a(5) = 12: 16;
1,3,4,5,7,8,10,11,13,14,15,17,18,19,20,...
n = 6; delete term at position 6+a(6) = 14: 19;
1,3,4,5,7,8,10,11,13,14,15,17,18,20,...
		

References

  • B. Cloitre, The golden sieve, preprint 2008

Crossrefs

Cf. A000027, A001953 (floor((n+1/2)*sqrt(2))), A001030 (fixed under 1 -> 21, 2 -> 211), A136110, A137292.
Cf. A242535.
Cf. A000217 (T).

Programs

  • Haskell
    import Data.List (delete)
    a136119 n = a136119_list !! (n-1)
    a136119_list = f [1..] where
       f zs@(y:xs) = y : f (delete (zs !! y) xs)
    -- Reinhard Zumkeller, May 17 2014
    
  • Magma
    [Ceiling((n-1/2)*Sqrt(2)): n in [1..100]]; // Vincenzo Librandi, Jul 01 2019
    
  • Mathematica
    f[0] = Range[100]; f[n_] := f[n] = Module[{pos = n + f[n-1][[n]]}, If[pos > Length[f[n-1]], f[n-1], Delete[f[n-1], pos]]]; f[1]; f[n = 2]; While[f[n] != f[n-1], n++]; f[n] (* Jean-François Alcover, May 08 2019 *)
    T[n_] := n (n + 1)/2; Table[1 + 2 Sqrt[T[n-1]] , {n, 1, 71}] // Floor (* Ralf Steiner, Oct 23 2019 *)
  • PARI
    apply( {A136119(n)=sqrtint(n*(n-1)*2)+1}, [1..99]) \\ M. F. Hasler, Jul 04 2022

Formula

a(n) = ceiling((n-1/2)*sqrt(2)). This can be proved in the same way as the formula given for A099267. There are some generalizations. For instance, it is possible to consider "a(n)+K*n" instead of "a(n)+n" for deleting terms where K=0,1,2,... is fixed. The constant involved in the Beatty sequence for the sequence of deleted terms then depends on K and equals (K + 1 + sqrt((K+1)^2 + 4))/2. K=0 is related to A099267. 1+A001954 is the complement sequence of this sequence A136119. - Benoit Cloitre, Apr 18 2008
a(n) = floor(1 + 2*sqrt(T(n-1))), with triangular numbers T(). - Ralf Steiner, Oct 23 2019
Lim_{n->inf}(a(n)/(n - 1)) = sqrt(2), with {a(n)/(n - 1)} decreasing. - Ralf Steiner, Oct 24 2019

Extensions

Edited and extended by Klaus Brockhaus, Apr 15 2008
An incorrect g.f. removed by Alois P. Heinz, Dec 14 2012

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)

A367832 Array T(n, k) read by ascending antidiagonals is a dispersion based on A367467. Column 1 lists the numbers which cannot be represented by A367467(m) + m. For k >= 1, T(n, k+1) = A367467(T(n, k)) + T(n, k).

Original entry on oeis.org

1, 4, 2, 7, 6, 3, 11, 9, 10, 5, 14, 12, 15, 17, 8, 18, 16, 20, 25, 29, 13, 21, 19, 27, 34, 42, 49, 22, 24, 23, 32, 46, 58, 71, 83, 37, 28, 26, 39, 54, 78, 99, 121, 141, 63, 31, 30, 44, 66, 92, 133, 169, 206, 240, 107, 35, 33, 51, 75, 112, 157, 227, 288, 351, 409, 182, 38, 36, 56, 87, 128, 191, 268
Offset: 1

Views

Author

Thomas Scheuerle, Dec 02 2023

Keywords

Comments

This sequence is a permutation of the positive integers.
The array T(n, k+1) - T(n, k) for k > 1 is also a permutation of the positive integers.
Columns k > 2 together consist of all the numbers from A003152. These are all the positive numbers of the form floor(m*(1+1/sqrt(2))).
In column 2 are all the numbers from A184119. These are all the numbers of the form floor((2+sqrt(2))*m - sqrt(2)/2).
Column 2 together with the columns k > 2 are all the numbers from A087057; these are all the numbers of the form ceiling(m*sqrt(2)). Together with column 1, which consists of all the numbers from A083051, they cover all positive integers.
An alternative definition that allows this array to be obtained without using A367467:
Take for T(n, 1) and T(n, 2) the first and the second number which do not appear in any row r < n. Complete all rows by the recurrence T(n, k) = floor(T(n, k-1)*(1 + 1/sqrt(2))). Start in the first row with T(1, 1) = 1 and T(1, 2) = 2.
Let Q(n, k) = T(n, k+2) - T(n, k+1) for k > 0. Let b(m) be the row n where the integer m is found in Q. Then we will obtain for (b(n)) the sequence: 1, 1, 1, 2, 1, 3, 2, 4, 1, 3, 5, 2, 6, 4, 1, ... . If we were to remove the first occurrence of each number in this sequence, we would get the same sequence again, hence (b(n)) is a fractal sequence.

Examples

			Array T(n, k) begins:
   1,  2,  3,  5,   8,  13,  22,  37,  63,  107, ...
   4,  6, 10, 17,  29,  49,  83, 141, 240,  409, ...
   7,  9, 15, 25,  42,  71, 121, 206, 351,  599, ...
  11, 12, 20, 34,  56,  99, 169, 288, 491,  839, ...
  14, 16, 27, 46,  78, 133, 227, 387, 660, 1126, ...
  18, 19, 32, 54,  92, 157, 268, 457, 780, 1331, ...
  21, 23, 39, 66, 112, 191, 326, 556, 949, 1620, ...
  ...
		

References

  • Clark Kimberling, Fractal sequences and interspersions, Ars Combinatoria 45 (1997) 157-168.

Crossrefs

Cf. A083050 (a closely related dispersion).

Formula

T(1, k) = A293078(k).
T(n, 1) = A083051(n-1).
T(n, 2) = A184119(n).
Conjectured: T(n, 3) = A328987(n-1).
T(1, k) = 2*T(1, k-1) - T(1, k-2) + floor(T(1, k-2)/2), for k > 2.
T(n, k+1) = floor(T(n, k)*(1+1/sqrt(2))) for k > 1.
T(n, k+1) = A367467(T(n, k)) + T(n, k).

Extensions

Edited by Peter Munn, Dec 11 2023

A355506 a(n) is the least positive integer not occurring earlier in the sequence such that, if a(m) = a(n)+1, then |m - n| >= a(n).

Original entry on oeis.org

1, 2, 4, 6, 8, 3, 10, 12, 5, 14, 16, 7, 18, 20, 22, 9, 24, 26, 11, 28, 30, 32, 13, 34, 36, 15, 38, 40, 42, 17, 44, 46, 19, 48, 50, 21, 52, 54, 56, 23, 58, 60, 25, 62, 64, 66, 27, 68, 70, 29, 72, 74, 31, 76, 78, 80, 33, 82, 84, 35, 86, 88, 90, 37, 92, 94, 39, 96, 98, 41, 100, 102, 104, 43, 106
Offset: 1

Views

Author

Ali Sada, Jul 04 2022

Keywords

Comments

A permutation of the positive integers (or of the nonnegative integers, if prefixed by a(0) = 0). It seems that all the odd numbers occur in order at indices A184119 and the even numbers occur in order at indices A136119, except for the initial 1 and 2. - M. F. Hasler, Jul 04 2022
The graph of the sequence has two "rays", one with slope 0.583 that contains only every third or fourth value, and one with slope 1.42 which contains the other values. - M. F. Hasler, May 09 2025

Examples

			The distance between a(3) = 4 and a(9) = 5 is |3 - 9| = 6, which is >= 4.
		

Crossrefs

Cf. A353592 (inverse permutation).

Programs

  • PARI
    {A355506_first(N, U=1/*starting value*/, A=Map())=vector(N, n, my(k=U); while(mapisdefined(A,k) || iferr(n < mapget(A,k-1)+k-1 || n2 && mapdelete(A,U-2); U++); k)} \\ M. F. Hasler, Jul 05 2022

Extensions

More terms from M. F. Hasler, Jul 04 2022

A335663 For n >= 1, a(n) = f(n) where f is a bijection on Z such that f(x)-x is also a bijection on Z and f(f(x)) = x.

Original entry on oeis.org

2, 1, 6, 9, 12, 3, 16, 19, 4, 23, 26, 5, 30, 33, 36, 7, 40, 43, 8, 47, 50, 53, 10, 57, 60, 11, 64, 67, 70, 13, 74, 77, 14, 81, 84, 15, 88, 91, 94, 17, 98, 101, 18, 105, 108, 111, 20, 115, 118, 21, 122, 125, 22, 129, 132, 135, 24, 139, 142, 25, 146, 149, 152
Offset: 1

Views

Author

Bhavya Tiwari, Jun 17 2020

Keywords

Comments

This appears in the problem of finding a bijection f on Z such that f(x)-x is also a bijection on Z. a(n) is the value on the natural numbers of an f satisfying the above condition as well as f(f(n)) = n. It is interesting to note that all a(n) such that a(n) > n are precisely A184119 (empirical) and ones satisfying a(n) <= n are precisely A136119 (empirical).

Examples

			We begin with a(1) = 2.
To calculate a(2): we first check if 2 has appeared in this sequence before. Indeed since a(1) = 2 we set a(2) = 1.
For a(3): observe that 3 has not appeared before so we can't apply Rule 1. Since we have performed rule 2 zero times before, therefore, a(3) = 3+2(0)+3 = 6.
For a(4): we cannot apply Rule 1 as 4 has not appeared before. We have applied Rule 2 one time before and hence a(4) = 4+2(1)+3 = 9.
Similarly a(5) = 5+2(2)+3 = 12.
However for a(6) we see a(3) = 6 and hence due to Rule 1, we must set a(6) = 3.
		

Crossrefs

Programs

  • Maple
    a:= proc() local h, t; t:=0; proc(n) option remember;
          if n<3 then 3-n else h:= 3+n+2*t;
            a(h):= n; t:= t+1; h fi end
        end():
    seq(a(n), n=1..100);  # Alois P. Heinz, Jun 17 2020
  • Mathematica
    Nest[Append[#1, If[! FreeQ[#1[[All, 1]], #2], {FirstPosition[#1[[All, 1]], #2][[1]], #1[[-1, -1]]}, {#2 + 2 #1[[-1, -1]] + 3, 1 + #1[[-1, -1]]}]] & @@ {#, Length[#] + 1} &, {{2, 0}}, 62][[All, 1]] (* Michael De Vlieger, Jun 17 2020 *)
  • Python
    Used = [(1, 2)]
    def bfun(num):
        print("a(1)=2")
        for i in range(2, num + 1):
            if any(i in coordinate for coordinate in Used):
                for j in range(0, len(Used) + 1):
                    if i in Used[j]:
                        print("a(" + str(i) + ")=" + str(Used[j][0]))
                        break
            else:
                Used.append((i, i + 2 * len(Used) + 1))
                print("a(" + str(i) + ")=" + str(i + 2 * len(Used) - 1))
    bfun(70)

Formula

a(1) = 2 and for all i > 1 we define a(i) as follows:
Rule 1 : a(i) = j if there is some j such that j < i and a(j) = i.
Rule 2 : If Rule 1 cannot be performed then a(i) = i+2n+3 , if this rule applied n times previously.

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