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.

Previous Showing 11-20 of 24 results. Next

A377091 a(0) = 0; thereafter a(n) is the least integer (in absolute value) not yet in the sequence such that the absolute difference between a(n-1) and a(n) is a square; in case of a tie, preference is given to the positive value.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Oct 16 2024

Keywords

Comments

Conjecture 1: Every integer (positive or negative) appears in this sequence.
Conjecture 2: For n > 16, |a(n)| is within sqrt(n/2) of floor(n/2). See A379071. - N. J. A. Sloane, Dec 29 2024 [Corrected by Paolo Xausa, Jan 21 2025]
Conjecture 3: lim sup ||a(n)| - floor(n/2)|/sqrt(n) = 1/2. (See link.) - N. J. A. Sloane and Paolo Xausa, Feb 03 2025
Conjecture 4: After a(n) has been found, the sequence contains all numbers in the range [0,f(n)], where lim sup f(n) = (n-sqrt(n))/2. There is a corresponding conjecture for the negative terms. See A379067. - N. J. A. Sloane and Paolo Xausa, Feb 13 2025

Examples

			The initial terms are:
  n   a(n)  |a(n)-a(n-1)|
  --  ----  -------------
   0     0  N/A
   1     1  1^2
   2     2  1^2
   3    -2  2^2
   4    -1  1^2
   5     3  2^2
   6     4  1^2
   7     5  1^2
   8    -4  3^2
   9    -3  1^2
  10     6  3^2
  11     7  1^2
  12     8  1^2
  13    -8  4^2
  14    -7  1^2
		

Crossrefs

This sequence is a variant of A277616 allowing negative values.
A large number of sequences have been derived from the present sequence in the hope (so far unfulfilled) of finding a formula or recurrence: see A379057-A379078, A379786-A379798, A379802, A379803, A379804, A379880, A380223, A380224, A380225, A382715-A382718.
First differences are A379061 (certainly the most relevant derived sequence). - M. F. Hasler, Feb 08 2025
"Lexicographically earliest" sequences for which there is a proof that every number that could appear does appear: A064413, A098550, A109812, A121216, A347113, etc. - N. J. A. Sloane, Feb 08 2025

Programs

  • JavaScript
    A377091 = [0]; A377091.least_unused = 1;
    function a(n){
      for(let i = A377091.length-1; i < n; ++i) {
        let k = A377091.least_unused;
        while(!Number.isInteger(Math.sqrt(Math.abs(A377091[i] - k)))
              || A377091.indexOf(k) > 0) k = (k<0)-k;
        A377091.push(k);
        if (k == A377091.least_unused) {
          do k = (k<0)-k; while ( A377091.indexOf( k ) > 0 );
          A377091.least_unused = k;
      } };
      return A377091[n];
    } // M. F. Hasler, Jan 26 2025
  • Maple
    h := proc(b, a, i) option remember; ifelse(issqr(abs(a[-1] - i)) and not is(i in a), ifelse(b < nops(a) + 1, a, h(b, [op(a), i], 1)), h(b, a, ifelse(i < 0, 1 - i, -i))) end:
    a_list := length -> h(length, [0], 1): a_list(62);  # Peter Luschny, Jan 20 2025
  • Mathematica
    A377091list[nmax_] := Module[{s, a, u = 1}, s[_] := False; s[0] = True; NestList[(While[s[u] && s[-u], u++]; a = u; While[s[a] || !IntegerQ[Sqrt[Abs[# - a]]], a = Boole[a < 0] - a]; s[a] = True; a) &, 0,nmax]];
    A377091list[100] (* Paolo Xausa, Mar 18 2025 *)
  • PARI
    \\ See Links section.
    
  • PARI
    A377091_upto(n,S=[])={vector(n+1, k, S=setunion(S, [n=if(k>1, k=1; while(setsearch(S,k) || !issquare(abs(n-k)), k=(k<0)-k); k)]); n)} \\ M. F. Hasler, Jan 18 2025
    
  • Python
    from math import isqrt
    from itertools import count, islice
    def cond(n): return isqrt(n)**2 == n
    def agen(): # generator of terms
        an, aset, m = 0, {0}, 1
        for n in count(0):
            yield an
            an = next(s for k in count(m) for s in [k, -k] if s not in aset and cond(abs(an-s)))
            aset.add(an)
            while m in aset and -m in aset: m += 1
    print(list(islice(agen(), 62))) # Michael S. Branicky, Dec 25 2024
    
  • Python
    from math import sqrt
    def a_list(b: int, a: list[int] = [0], i: int = 1) -> list[int]:
        if sqrt(abs(a[-1] - i)).is_integer() and not (i in a):
            a += [i]
            if b < len(a):
                return a
            else:
                return a_list(b, a)
        else:
            return a_list(b, a, int(i < 0) - i)
    print(a_list(40))  # Peter Luschny, Jan 20 2025
    
  • Python
    class A377091: # A377091(n) gives a(n)
        terms = [0]; N = 1 # next candidate
        def _new_(A, n): A.extend(A, n-len(A.terms)+1); return A.terms[n]
        def extend(A, n): any((k:=A.N) in A.terms and setattr(A, 'N', k:=(k<0)-k) or
            A.terms.append(next(k for _ in range(9**9) if (abs(A.terms[-1]-k)**.5)
           .is_integer() and k not in A.terms or not(k:=(k<0)-k))) for _ in range(n))
    # M. F. Hasler, Feb 08 2025
    

A084937 Smallest number which is coprime to the last two predecessors and has not yet appeared; a(1)=1, a(2)=2.

Original entry on oeis.org

1, 2, 3, 5, 4, 7, 9, 8, 11, 13, 6, 17, 19, 10, 21, 23, 16, 15, 29, 14, 25, 27, 22, 31, 35, 12, 37, 41, 18, 43, 47, 20, 33, 49, 26, 45, 53, 28, 39, 55, 32, 51, 59, 38, 61, 63, 34, 65, 57, 44, 67, 69, 40, 71, 73, 24, 77, 79, 30, 83, 89, 36, 85, 91, 46, 75, 97, 52, 81
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 13 2003

Keywords

Comments

Equivalently, this is the lexicographically earliest sequence of positive numbers satisfying the condition that each term is relatively prime to the next two terms. - N. J. A. Sloane, Nov 03 2014
Empirically, the points lie roughly on two lines: if n == 2 mod 3 then a(n) ~= 2n/3, otherwise a(n) ~= 4n/3. See A249680-A249683 for the three trisections, and see also the Sigrist scatterplot. - N. J. A. Sloane, Nov 03 2014, Nov 04 2014
All primes and prime powers occur, and the primes occur in their natural order. For any prime p, p occurs before p^2 before p^3, ...
Empirically, this is a permutation of the natural numbers, with inverse A084933: a(A084933(n))=A084933(a(n))=n. It seems that there are no further fixed points after {1,2,3,8,33,39}. Empirically, a(n) mod 2 = A011655(n+1); ABS(a(n)-n) < n; a(3*n+1)>n; a(3*n+2)Reinhard Zumkeller, Dec 16 2007
For a(n) mod 3 see A249603. - N. J. A. Sloane, Nov 03 2014
A249694(n) = GCD(a(n),a(n+3)). - Reinhard Zumkeller, Nov 04 2014

Crossrefs

Cf. A084933 (inverse), A103683, A121216, A247665, A090252, A249603 (read mod 3), A249680, A249681, A249682, A249683 (trisections), A249694, A011655, A249684 (numbers that take a record number of steps to appear), A249685.
Indices of primes: A249602, and of prime powers: A249575.
Running counts of missing numbers: A249686, A250099, A250100; A249777, A249856, A249857.
Where a(3n)>a(3n+1): A249689.
See also A353706, A353709, A353710.

Programs

  • Haskell
    import Data.List (delete)
    a084937 n = a084937_list !! (n-1)
    a084937_list = 1 : 2 : f 2 1 [3..] where
       f x y zs = g zs where
          g (u:us) | gcd y u > 1 || gcd x u > 1 = g us
                   | otherwise = u : f u x (delete u zs)
    -- Reinhard Zumkeller, Jan 28 2012
    
  • Maple
    N:= 1000: # to get a(n) until the first entry > N
    a[1]:= 1: a[2]:= 2:
    R:= {$3..N}:
    for n from 3 while R <> {} do
      success:= false;
      for r in R do
        if igcd(r,a[n-1]) = 1 and igcd(r,a[n-2])=1 then
           a[n]:= r;
           R:= R minus {r};
           success:= true;
           break
        fi
      od:
      if not success then break fi;
    od:
    seq(a[i], i = 1 .. n-1); # Robert Israel, Dec 12 2014
  • Mathematica
    lst={1,2,3}; unused=Range[4,100]; While[n=Select[unused, CoprimeQ[#, lst[[-1]]] && CoprimeQ[#, lst[[-2]]] &, 1]; n != {}, AppendTo[lst, n[[1]]]; unused=DeleteCases[unused, n[[1]]]]; lst
    f[s_] := Block[{k = 1, l = Take[s, -2]}, While[ Union[ GCD[k, l]] != {1} || MemberQ[s, k], k++]; Append[s, k]]; Nest[f, {1, 2}, 67] (* Robert G. Wilson v, Jun 26 2011 *)
  • PARI
    taken(k,t=v[k])=for(i=3,k-1, if(v[i]==t, return(1))); 0
    step(k,g)=while(gcd(k,g)>1, k++); k
    first(n)=local(v=vector(n,i,i)); my(nxt=3,t); for(k=3,n, v[k]=step(nxt, t=v[k-1]*v[k-2]); while(taken(k), v[k]=step(v[k]+1,t)); if(v[k]==t, while(taken(k+1,t++),))); v \\ Charles R Greathouse IV, Aug 26 2016
  • Python
    from math import gcd
    A084937_list, l1, l2, s, b = [1,2], 2, 1, 3, set()
    for _ in range(10**3):
        i = s
        while True:
            if not i in b and gcd(i,l1) == 1 and gcd(i,l2) == 1:
                A084937_list.append(i)
                l2, l1 = l1, i
                b.add(i)
                while s in b:
                    b.remove(s)
                    s += 1
                break
            i += 1 # Chai Wah Wu, Dec 09 2014
    

Extensions

Entry revised by N. J. A. Sloane, Nov 04 2014

A353709 a(0)=0, a(1)=1; thereafter a(n) = smallest nonnegative integer not among the earlier terms of the sequence such that a(n) and a(n-2) have no common 1-bits in their binary representations and also a(n) and a(n-1) have no common 1-bits in their binary representations.

Original entry on oeis.org

0, 1, 2, 4, 8, 3, 16, 12, 32, 17, 6, 40, 64, 5, 10, 48, 65, 14, 128, 33, 18, 68, 9, 34, 20, 72, 35, 132, 24, 66, 36, 25, 130, 96, 13, 144, 98, 256, 21, 42, 192, 257, 22, 104, 129, 258, 28, 97, 384, 26, 37, 320, 136, 7, 80, 160, 11, 84, 288, 131, 76, 272, 161, 70, 264, 49, 134, 328, 512, 19, 44, 448, 513, 30, 224, 768, 15, 112, 640, 259, 52, 200, 514, 53
Offset: 0

Views

Author

N. J. A. Sloane, May 06 2022

Keywords

Comments

A set-theory analog of A084937.
Conjecture: This is a permutation of the nonnegative numbers.

Crossrefs

Cf. A084937 (number theory analog), A109812, A121216, A353405 (powers of 2), A353708, A353710, A353715 and A353716 (a(n)+a(n+1)), A353717 (inverse), A353718, A353719 (primes), A353720 and A353721 (Records).
For the numbers that are the slowest to appear see A353723 and A353722.

Programs

A354169 a(0) = 0, a(1) = 1, a(2) = 2; for k >= 2, given a(k), the sequence is extended by adjoining two terms: a(2*k-1) = smallest m >= 0 not among a(0) .. a(k) such that {m, a(k), a(k+1), ..., a(2*k-2)} are pairwise disjoint in binary, and a(2*k) = smallest m >= 0 not among a(0) .. a(k) such that {m, a(k), ..., a(2*k-1)} are pairwise disjoint in binary.

Original entry on oeis.org

0, 1, 2, 4, 8, 3, 16, 32, 64, 12, 128, 256, 512, 17, 1024, 34, 2048, 4096, 8192, 68, 16384, 136, 32768, 65536, 131072, 768, 262144, 524288, 1048576, 1025, 2097152, 18, 4194304, 2080, 8388608, 16777216, 33554432, 12288, 67108864, 134217728, 268435456, 16388
Offset: 0

Views

Author

N. J. A. Sloane, Jun 05 2022

Keywords

Comments

The paper by De Vlieger et al. (2022) calls this the "binary two-up sequence".
"Pairwise disjoint in binary" means no common 1-bits in their binary representations.
This is a set-theory analog of A090252. It bears the same relation to A090252 as A252867 does to A098550, A353708 to A121216, A353712 to A347113, etc.
A consequence of the definition, and also an equivalent definition, is that this is the lexicographically earliest infinite sequence of distinct nonnegative numbers with the property that the binary representation of a(n) is disjoint from (has no common 1's with) the binary representations of the following n terms.
An equivalent definition is that a(n) is the smallest nonnegative number that is disjoint (in its binary representation) from each of the previous floor(n/2) terms.
For the subsequence 0, 3, 12, 17, 34, ... of the terms that are not powers of 2 see A354680 and A354798.
All terms are the sum of at most two powers of 2 (see De Vlieger et al., 2022). - N. J. A. Sloane, Aug 29 2022

Examples

			After a(2) = 2 = 10_2, a(3) must equal ?0?_2, and the smallest such number we have not seen is a(3) = 100_2 = 4, and a(4) must equal ?00?_2, and the smallest such number we have not seen is a(4) = 1000_2 = 8.
		

Crossrefs

A355889 is a more efficient way to present this sequence.

Programs

Extensions

More terms from Rémy Sigrist, Jun 06 2022

A270139 a(n)=n when n<=3, otherwise a(n) is the smallest unused positive integer which is not coprime to the two previous terms.

Original entry on oeis.org

1, 2, 3, 6, 9, 12, 15, 10, 5, 20, 25, 30, 35, 14, 7, 21, 28, 18, 4, 8, 16, 22, 24, 26, 32, 34, 36, 38, 40, 42, 44, 33, 11, 55, 66, 45, 27, 39, 48, 51, 54, 57, 60, 63, 56, 49, 70, 77, 84, 88, 46, 50, 52, 58, 62, 64, 68, 72, 74, 76, 78, 80, 65, 75, 85, 90, 95, 100, 105, 96
Offset: 1

Views

Author

Ivan Neretin, Mar 11 2016

Keywords

Comments

Other possible conditions on a(n) with respect to its common factors with a(n-2) and a(n-1) lead to the following:
Coprime to both: A084937.
Coprime to the latter and not the former: A098550.
Coprime to the former and not the latter: with any initial conditions, the sequence "paints itself into a corner", i.e., is finite. With the added condition of a(n) having an extra prime factor not contained in a(n-1), it is A336957.
Coprime to the latter, regardless of the former: simply A000027.
Coprime to the former, regardless of the latter: A121216.
Non-coprime to the latter, regardless of the former: A064413.
Non-coprime to the former, regardless of the latter: A121217.

Examples

			a(12) = 30, a(13) = 35, so a(14) must have common factors (possibly different) with 30 and 35, and the smallest unused number with that property turns out to be 14, so a(14) = 14.
		

Crossrefs

Programs

  • Mathematica
    a = {1, 2, 3}; Do[k = 1; While[(MemberQ[a, k] || GCD[a[[-1]], k] == 1 || GCD[a[[-2]], k] == 1), k++]; AppendTo[a, k], {n, 2, 68}]; a

A352588 a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest positive number that has not yet appeared that is coprime to a(n-1) but does not equal a(n-1)+1.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Apr 29 2022

Keywords

Comments

Theorem: This is a permutation of the natural numbers. The proof is essentially the same as for A093714. - N. J. A. Sloane, May 02 2022
Coincides with A093714 for n >= 17. - Scott R. Shannon, May 02 2022.
In the first 100 million terms the sequence's values are concentrated along the line a(n) = n, resulting in 1160 fixed points in this range. However the last fixed point in this range is a(1034312), with the sequence oscillating above and below the line a(n) = n from then on. It is unknown if this behavior continues or if more fixed points eventually appear.
The largest offset in the first 100 million terms from the line a(n) = n is a(45902952) = 45902981, with an offset of 29. In this range a number is rejected as the next term on 207 occasions as it equals a(n-1)+1.
Beyond a(4) = 3 the primes appear in their natural order.
From Michael De Vlieger, May 01 2022: (Start)
Theorem: if prime p | a(n-1) then p does not divide a(n). Proof: primes either divide or are coprime to a given number. We say numbers m and n are coprime iff gcd(m,n) = 1. Suppose p | a(n-1) and p | a(n), then p | m, where m = gcd(a(n-1), a(n)). By definition of prime and divisor, m > 1, a contradiction.
Corollary: even terms do not appear adjacently in the sequence, however we may have runs of odd terms.
Theorem: fixed point a(n) = n implies a(n) and n have the same parity. Proof: a(n) = n iff a(n) mod n = 0, since n | n. Suppose prime q|n yet gcd(a(n), q) = 1, then a(n) != n, a contradiction.
Observation: there are 9 runs of odd terms for n = 1..2^28, one of 3 odd terms {5, 3, 7}, the rest of 2. Fixed points appear in intervals [1, 3], [4, 17], [78, 1787], [15022, 38123], and [45053, 1036043]. The last run of odd terms for n <= 2^28 begins at n = 1036043. Is there another run of odd terms that will begin a new interval that harbors fixed points? (End)

Examples

			a(3) = 5 as a(2) = 2, and the smallest unused number coprime to 2 that does not equal 2+1=3 is 5.
		

Crossrefs

Programs

  • Mathematica
    nn = 76; c[_] = 0; a[1] = c[1] = 1; a[2] = c[2] = 2; u = 3
    Do[k = u; While[Nand[c[k] == 0, CoprimeQ[#, k], k != # + 1], k++] &@ a[i - 1]; Set[{a[i], c[k]}, {k, i}]; If[a[i] == u, While[c[u] > 0, u++]], {i, 3, nn}]; Array[a, nn] (* Michael De Vlieger, May 01 2022 *)

A121217 a(1)=1, a(2)=2, a(3)=3; for n > 3, a(n) is the smallest positive integer which does not occur earlier in the sequence and which is not coprime to a(n-2).

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 10, 12, 5, 14, 15, 7, 18, 21, 16, 24, 20, 22, 25, 11, 30, 33, 26, 27, 13, 36, 39, 28, 42, 32, 34, 38, 17, 19, 51, 57, 45, 48, 35, 40, 49, 44, 56, 46, 50, 23, 52, 69, 54, 60, 58, 55, 29, 65, 87, 70, 63, 62, 66, 31, 64, 93, 68, 72, 74, 75, 37, 78, 111, 76, 81
Offset: 1

Views

Author

Leroy Quet, Aug 20 2006

Keywords

Comments

Conjecture: this is a permutation of the positive integers, cf. A256618. - Reinhard Zumkeller, Apr 05 2015
The B-sequence mentioned in the Maple program is not in the OEIS. It is 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, ... - Alois P. Heinz, Feb 02 2019

Crossrefs

Cf. A064413, A121216, A251622, A256414 (indices of primes), A256419 (smoothed version).
Cf. A256618 (conjectured inverse).

Programs

  • Haskell
    a121217 n = a121217_list !! (n-1)
    a121217_list = 1 : 2 : 3 : f 2 3 [4..] where
       f u v xs = g xs where
         g (w:ws) = if gcd w u > 1 then w : f v w (delete w xs) else g ws
    -- Reinhard Zumkeller, Apr 05 2015
  • Maple
    # From N. J. A. Sloane, Apr 04 2015: A121217 gcd(A[n],A[n-2])>1 A=seq, for B see the COMMENTS
    N:= 60: # to get a(1) to a(n) where a(n+1) is the first term > N
    B:= Vector(N, datatype=integer[4]):
    for n from 1 to 3 do A[n]:= n: od:
    for n from 4 do
      for k from 4 to N do
        if B[k] = 0 and igcd(k, A[n-2]) > 1 then
           A[n]:= k;
           B[k]:= 1;
           break
        fi
      od:
      if k > N then break fi
    od:
    [seq(A[i], i=1..n-1)];
  • Mathematica
    a = Range@ 3; Do[k = 4; While[Or[MemberQ[a, k], CoprimeQ[a[[i - 2]], k]], k++]; AppendTo[a, k], {i, 4, 72}]; a (* Michael De Vlieger, Aug 19 2017 *)

Extensions

Extended by Ray Chandler, Aug 22 2006

A340783 a(n) = n if n <= 3; for n>3, a(n) = the closest number to a(n-1) that has not occurred earlier and has at least one common factor with a(n-2), but none with a(n-1). In case of a tie, choose the smaller.

Original entry on oeis.org

1, 2, 3, 4, 9, 8, 15, 14, 5, 6, 25, 24, 35, 34, 45, 44, 39, 38, 33, 32, 27, 26, 21, 20, 7, 10, 49, 48, 77, 76, 63, 62, 57, 56, 51, 50, 69, 68, 75, 74, 81, 80, 87, 86, 93, 92, 99, 98, 111, 110, 117, 116, 123, 122, 129, 128, 135, 134, 141, 140, 153, 152, 147, 146, 133, 132, 119, 118, 105, 104, 95
Offset: 1

Views

Author

Scott R. Shannon, Jan 21 2021

Keywords

Comments

The sequence uses a similar selection rule to the Yellowstone permutation A098550 but instead of choosing the smallest number that has not occurred earlier that has a common factor with a(n-2) and no common factor with a(n-1), the number closest to a(n-1) that satisfies these rules is selected for a(n). If two such numbers are the same distance from a(n-1) then the smaller is chosen.
As any number n is coprime to n-1 there are many such pairs of values differing by one in the sequence. If a(n-1) is even and a(n) is odd then the only time a(n+1) will not be a(n)-1 is if a(n)-1 has already appeared in the sequence.
The majority of terms are clustered along a line with gradient approximately 1.25 . However the line is broken into smaller regions, each region having a slightly higher gradient, by the terms dropping to much smaller values before returning to the main line. See the linked image.
Excluding the first five terms, in the first 5 million terms the maximum number of consecutive terms that increase is only two. This only occurs at five places, when n=9,25,79,13705,275345. In the same range there are many regions of consecutive decreasing terms, the longest being 5997 terms starting from n=1902153.
In the first 5 million terms the only fixed points, other than the first three terms, are 4 and 313362. As the terms for larger n seem to drop below the a(n)=n line on numerous occasions it is possible more exist, although this is unknown. The smallest number not appearing is 31. It is unknown is all values eventually appear. In the same range the largest change in consecutive terms is from a(3503960)=30982 to a(3503961)=3191249, a difference of 3160267.

Examples

			a(5) = 9 as a(5-2) = a(3) = 3 so a(5) must have 3 as a factor, but cannot be 6 as it cannot have common factor with a(5-1) = a(4) = 2.
a(12) = 24 as a(12-2) = a(10) = 6 so a(12) must have 2 or 3 as a factor, but cannot have a factor with a(12-1) = a(11) = 25. The closest numbers to a(12-1) = a(11) = 25 which have not occurred and satisfy these criteria are 24 and 26, but 24 is chosen as it is the smaller of the two. This is the first term differing from A098550 as the later chooses the smallest number satisfying the criteria that has not occurred, namely 12.
		

Crossrefs

A353708 a(0)=0, a(1)=1; thereafter a(n) = smallest nonnegative integer not among the earlier terms of the sequence such that a(n) and a(n-2) have no common 1-bits in their binary representations.

Original entry on oeis.org

0, 1, 2, 4, 5, 3, 8, 12, 6, 16, 9, 7, 18, 24, 13, 32, 34, 10, 17, 20, 14, 11, 33, 36, 22, 19, 40, 44, 21, 64, 42, 15, 65, 48, 26, 66, 37, 25, 72, 38, 23, 73, 96, 50, 27, 68, 100, 35, 128, 28, 29, 67, 98, 52, 129, 74, 30, 49, 97, 70, 130, 41, 45, 80, 82, 39, 132, 88, 43, 131, 84, 56, 136, 69, 51, 58, 76, 133, 144, 90, 46, 160, 81, 31, 134, 192, 57, 47
Offset: 0

Views

Author

N. J. A. Sloane, May 06 2022

Keywords

Comments

A set-theory analog of A121216.
This is a permutation of the nonnegative numbers.

Crossrefs

Programs

A256399 First differences of A256219.

Original entry on oeis.org

1, 1, 3, 1, 3, 3, 1, 3, 8, 3, 5, 4, 3, 1, 4, 10, 1, 4, 4, 4, 4, 7, 4, 9, 3, 1, 4, 3, 4, 16, 4, 4, 4, 8, 1, 8, 7, 1, 8, 4, 4, 8, 3, 4, 4, 8, 16, 1, 3, 1, 11, 1, 4, 12, 7, 5, 3, 1, 8, 3, 5, 19, 4, 1, 3, 16, 5, 11, 1, 4, 4, 11, 5, 7
Offset: 1

Views

Author

N. J. A. Sloane, Mar 28 2015

Keywords

Crossrefs

Previous Showing 11-20 of 24 results. Next