g | x | w | all
Bytes Lang Time Link
087Rust240917T184730Zbzr
010Vyxal 3240917T174226ZGinger
037JavaScript240913T082733ZShaggy
008Japt201112T162318ZShaggy
007Vyxal240913T053441Zemanresu
011Pip211012T175613ZDLosc
064Excel211012T175204ZAxuary
064Python 3211012T105055ZOlupo
00605AB1E legacy201112T141747ZKevin Cr
042Julia 1.0201117T162811ZMarcMush
036Bash + GNU utils151023T162937ZDigital
076Java JDK211011T002406ZDel
033AWK211010T045728Zcnamejj
008Jelly201112T124157Zcaird co
018GolfScript201113T032100ZSamuel W
010Husk201113T170541ZDominic
024Raku201113T185218ZSean
043JavaScript ES6151023T214437Zedc65
025Perl 5 p201112T154648ZXcali
015Brachylog201112T125307Zxash
010Burlesque151023T161653Zmroman
043PHP151025T210958Zleymannx
011Pyth151023T200955Zkirbyfan
034Perl 5151023T191114ZLukStorm
051Haskell151023T223521Znimi
037MUMPS151023T195815Zsenshin
050Python 2151023T182032Zxnor
074Python 3151023T165815ZMorgan T
047Perl 5151023T160800Zmsh210
053JavaScript151023T160956ZMwr247

Rust, 87 bytes

let f=|n|(0..=n).zip((0..).filter(|x|!x.to_string().contains("11"))).last().unwrap().1;

Attempt This Online!

Vyxal 3, 11 10 bytes

vÞṆΩ11c¬}i

Vyxal It Online!

JavaScript, 37 bytes

f=(n,i=0)=>n?f(n-!/11/.test(++i),i):i

Try it online!

Japt, 9 8 bytes

È¥srB}iU

Try it

È¥srB}iU     :Implicit input of integer U
È            :Function taking an integer as argument
 ¥           :  Test equality with
  s          :    Convert to string
   r         :    Remove all occurrences of
    B        :      11
     }       :End function
      iU     :Get the Uth integer that returns true

Vyxal, 7 bytes

11c¬)ȯt

Try it Online!

      t # nth
     ȯ  # integer
    )   # which
   ¬    # does not
  c     # contain
11      # 11

Pip, 11 bytes

LaW11N Ui_i

Attempt This Online!

Explanation

             i is 0; a is first command-line argument (implicit)
La           Loop (a) times:
  W           Loop while
   11N        11 is a substring of
       Ui     i, incremented:
         _     No-op
          i  Once the loop completes, output i

Excel, 64 bytes

=LET(x,SEQUENCE(2^20),INDEX(FILTER(x,ISERROR(FIND("11",x))),I7))

Works up to 1,000,579 -> 1,048,576

Python 3, 64 bytes

[print(e) for e in map(str,range(int(input())+1))if not'11'in e]

Try it online!

05AB1E (legacy), 7 6 bytes

µN11å≠

-1 byte switching to the legacy version of 05AB1E, where the index is output implicitly after a while-loop µ. In the new 05AB1E version we have to push the N explicitly, and it'll output the top of the stack after the while-loop instead (so the N would be NN or ND).

Try it online or verify all test cases.

Explanation:

µ       # Loop until the counter_variable is equal to the (implicit) input-integer:
        # (the counter_variable is 0 by default)
 N11å   #  Check if the 0-based loop-index `N` contains 11 as substring
     ≠  #  Invert this boolean (1→0; 0→1)
        #  (implicitly pop the top of the stack, and increase the counter_variable by
        #  1 if it's truthy)
        # (after which the index `N` is output implicitly as result)

Julia 1.0, 44 42 bytes

x->(r=1:9x)[.!occursin.("11",repr.(r))][x]

Try it online!

Bash + GNU utils, 36

seq $1$1|grep -v 11|sed -n "$1{p;q}"

Try it Online

Java (JDK), 76 bytes

p->{int c=1,s=0;while((c+s+"").indexOf("11")>=0&&++s>0||c++<p);return p+s;};

Try it online!

How it works: Lambda function obviously, but mostly it uses short-circuit logic in the while loop boolean to increment the appropriate counter keeping track of the cumulative shift for each input and returning the input plus that shift.

AWK, 33 bytes

{for(;$1;)$1-=!index(++b,11)}$0=b

Try it online!

It works by running a loop that increments a counter blindly each iteration, but only decrements the control variable if the blind counter does NOT include the string 11. Once the loop exits, the blind counter is printed as the answer.

 {                            }     - code block run for each input line
  for(;$1;)                         - loop until $1 is 0
           $1-=!index(   ,11)       - decrement $1 if "b" doesn't include "11"
                      ++b           - blindly increment a counter
                               $0=b - set $0 to blind count, prints automatically

Jelly, 8 bytes

1w11¬$#Ṫ

Try it online!

Almost entirely printable ASCII! Takes input from STDIN

How it works

1w11¬$#Ṫ - Main link. No arguments
     $   - Group the previous 2 links into a monad f(k):
  11     -   Yield 11
 w       -   Yield 1 if 11 is a sublist of k's digit else 0
    ¬    -   Map 1 to 0 and 0 to 1
1     #  - Count up k = 1, 2, 3, ... until n integers return true under f(k)
       Ṫ - Return the last k

Jelly, 8 bytes

²wÐḟ11ị@

Try it online!

An alternate approach, still only 8 bytes though. Relies on the assumption that the output is always less than the square of the input

How it works

²wÐḟ11ị@ - Main link. Takes n on the left
²        - n²
  Ðḟ     - Filter-false the range [1, 2, ..., n²] on:
    11   -   11
 w       -   Is a sublist of the digits
      ị@ - Take the n'th value in this list

GolfScript, 29 24 18 bytes

~0\{{).`11`?)}do}*

Try it online!

This is my first code golf, so this is probably the least effecient way of doing things

-5 bytes by not being dumb and using the increment symbol as well as just keeping the input on the stack and decrementing instead of wasting space saving it as a variable and comparing it, probably more things I could save on

-6 bytes the loop is fixed size and I don't need the input after the loop so I can just use repeat

Husk, 11 10 bytes

Edit: -1 byte thanks to Razetime

!fö¬€ḋ3QdN

Try it online!

Finds index of input among natural numbers filtered to exclude those with digit-sublists that include [1,1].

Raku, 24 bytes

{grep(?1^/11/,^∞)[$_]}

Try it online!

grep(..., ^∞) filters the numbers from zero to infinity according to the given test object, and [$_] indexes into that sequence with the function argument, returning the number at that index.

/11/ matches any number whose decimal representation contains two consecutive one digits. The sense of the match can be inverted by writing True ^ /11/, where ^ creates an exclusive-or junction matcher that succeeds only if exactly one of its operands succeeds. True will always succeed, so the overall junction can only succeed if the /11/ fails. Finally, True can be expressed more concisely as ?1, that is, 1 coerced to a Boolean.

none(/11/) also works as a matcher, but is longer.

JavaScript (ES6) 43 bytes

As an anonymous function

n=>eval('for(i=0;/11/.test(i)||n--;i++);i')

Note: the very simplest way would be 44:

n=>{for(i=0;/11/.test(i)||n--;i++);return i}

Test running the snippet below.

f=n=>eval('for(i=0;/11/.test(i)||n--;i++);i')

var o='',v=0,r,c;
for(r=0;r<30;r++)
{
  o += '<tr>';
  for(c=0;c<10;c++)
  {
  
    o += '<td>' +v + '⇨' + f(v) + '</td>';
    v++;
  }
  o += '</tr>'

}
O.innerHTML=o
<table id=O style='font-size:80%'></table>

Perl 5 -p, 25 bytes

$\++while$\=~/11/||$_--}{

Try it online!

Brachylog, 15 bytes

∧{ℕ₁≜¬s11&}ᶠ↖?t

Try it online!

∧{ℕ₁≜¬s11&}ᶠ↖?t
∧{ …      }ᶠ↖?t get the N'th output from …
  ℕ₁≜             try a number, starting with 1
     ¬s11         doesn't contain 11
         &        output that number

Burlesque, 10 bytes

{11~[n!}FO

Older versions:

ro{11~[n!}f[

ro{Sh"11"~=n!}f[

PHP, 43 bytes

while(preg_match('/11/',$i)){$i++;}print$i;

Pyth, 13 11 bytes

e.f!}`hT`ZQ

Saved 2 bytes thanks to @FryAmTheEggman.

Live demo and test cases.

13-byte version

e.f!}"11"+ZkQ

Perl 5, 34 Bytes

Looping a counter and changing the occasional double-one.

map{$i++;$i=~s/11/12/}1..pop;say$i

Test

$ perl -M5.012 -e 'map{$i++;$i=~s/11/12/}1..pop;say$i' 111
$ 122

Haskell, 51 bytes

([x|x<-[0..],notElem('1','1')$zip=<<tail$show x]!!)

Usage example: ([x|x<-[0..],notElem('1','1')$zip=<<tail$show x]!!) 110 -> 121.

How it works:

[x|x<-[0..]                                   ]    -- take all x starting with 0
           ,                                       -- where
                   ('1','1')                       -- the pair of two chars '1'
            notElem                                -- is not part of
                             zip=<<tail            -- the list of pairs of neighbor elements of
                                        show x     -- the string representation of x
                                               !!  -- take nth element, where n is the parameter

MUMPS, 37 bytes

t(i) f j=1:1 s:j'[11 k=k+1 q:k=i
    q j

Pretty straightforward. The only "interesting" thing here is the construct j'[11 - '[ is the "does not contain" operator, so that "abc"'["ab" is false and "abc"'["cd" is true. Despite both operands of j'[11 being numbers, MUMPS remains unperturbed. It will happily autocoerce both operands to strings and move on with its life. Hooray!

(Incidentally, if you're okay with the program never terminating, we can shorten this to 35 bytes: t2(i) f j=1:1 s:j'[11 k=k+1 w:k=i j)

Python 2, 50

lambda n:[i for i in range(n*2)if'11'not in`i`][n]

An anonymous function that lists the numbers not containing 11 in order, and takes the nth one. The off-by-one error of zero-indexing cancels with the inclusion of 0 in the list.

In theory, this will fail for sufficiently high numbers where f(n)>2*n, but this shouldn't happen until n is at least 10**50.


51 bytes:

n=input();i=0
while n:i+=1;n-='11'not in`i`
print i

Counts up numbers i until the quota of n numbers without 11 is met.

A function is the same length because of the off-by-one corrections needed.

f=lambda n,i=0:n+1and f(n-('11'not in`i`),i+1)or~-i

Python 3 74

Still need a bit of golfing.

n=int(input())
c=0
for x in ' '*n:
 c+=1
 while'11'in str(c):c+=1
print(c)

It's pretty brute force right now.

Perl 5, 47 bytes

@_[$_]=++$i!~/11/?$i:redo for 1..<>;print$_[-1]

JavaScript, 53 bytes

n=>[...Array(n*2).keys()].filter(a=>!/11/.test(a))[n]

Alternate (using comprehensions, same length):

n=>[for(i of Array(n*2).keys())if(!/11/.test(i))i][n]