text:
Time taken to print numbers
Summary
Write a program or function, which doesn't take any input, and outputs all the integer numbers, between -1000 and 1000 in ascending order, to the stdout, one per line, like this:
-1000
-999
-998
-997
...

And after that you need to print the time taken to print these numbers, or the time from the start of the program's execution in milliseconds (if necessary, it can also contain some other things, for example: time taken:xxxms is ok). It can be a float, or an integer (if you print an integer, you need to round down to the nearest).
Example code
using System;
using System.Diagnostics;
class P
{
    static void Main(string[] args)
    {
        Stopwatch st = Stopwatch.StartNew();
        for (int i = -1000; i <= 1000; i++)
        {
            Console.WriteLine(i);
        }
        Console.WriteLine(st.ElapsedMilliseconds);
    }
}

Restrictions
Standard loopholes are not allowed
Other infos
It's code golf, so the shortest submission wins.

@GurupadMamadapur No, sorry

Why? I think essentially to print those numbers every statement is involved from the start of the program right?

@GurupadMamadapur Ok, you're right, I will edit the question accordingly.

Can the program wait some amount of time from the start, and print that amount?

@xnor I think, that would change the challenge, and because there are already lots of answers to the original challenge, I would say no.

Can I write an answer in Arduino?

@Blacksilver Yes, why not?

Arduino has a built-in for time since start. Muahaha!

@Blacksilver I think, that's fine.

Can the time output contain anything else besides the raw time in milliseconds? Would "Time taken: 500ms" be ok?

@Carcigenicate Yes, it would be ok.

@HorváthDávid Oh good. Manually handling time is like a third of my answer.

MATL, 13 bytes
1e3t_y&:!DZ`*

Try it online!
       % Implicitly start timer
1e3    % Push 1000
       % STACK: 1000
t_     % Duplicate, negate
       % STACK: 1000, -1000
y      % Duplicate second-top number
       % STACK: 1000, -1000, 1000
&:     % Two-input range
       % STACK: 1000, [-1000, 999, ..., 1000]
!      % Transpose into column vector
       % STACK: 1000, [-1000; 999; ...; 1000]
D      % Display
       % STACK: 1000
Z`     % Push timer value, say t
       % STACK: 1000, t
*      % Multiply
       % STACK: 1000*t
       % Implicitly display

Very nice! Smart to implement: Implicitly start timer. Was that there from day one, or is that the result of an earlier challenge?

@StewieGriffin Not from day one. I added it on 13 Jul 2016, probably after having to intiallize it explicitly in a couple of challenges

Octave, 46 43 36 30 23 bytes
tic;(-1e3:1e3)',toc*1e3

This will print:
ans =

  -1000
   -999
   -998
   -997
   -996
   -995

If you don't like the ans = , then we have to add an additional 6 bytes for disp:
tic;disp((-1e3:1e3)'),toc*1e3

Saved a lot of bytes thanks to a few reminders from rahnema1.
Explanation:
tic;                              % Starts timer
         (-1e3:1e3)'              % A vertical vector -1000 ... 1000
    disp((-1e3:1e3)'),            % Display this vector
                      toc*1e3     % Stop the timer and output the time in milliseconds

JavaScript, 60 bytes
(c=console).time();for(i=~1e3;i++<1e3;c.log(i));c.timeEnd();

In order to get all the events logged, you should use the script from the developer console (otherwise the logs are erased after the certain amount of them).

i=~1e3 to save a byte :-)

Python 3.5, 80 77 73 bytes
import time
*map(print,range(-1000,1001)),
print(time.process_time()*1e3)

Previous solutions involved using timeit and time.time(), they were larger.
Sadly, time.process_time() was introduced in python 3.3.
Thanks to Dennis for saving 4 bytes!

CJam, 18 bytes
es2001{1e3-n}/es\-

Try it online!
How it works
es                  Push the current time (milliseconds since epoch) on the stack.
  2001{     }/      For each integer X from 0 to 2000:
       1e3-           Subtract 1000 from X.
           n          Print with a newline.
              es    Push the current time on the stack.
                \-  Swap and subtract.

Bash (+coreutils), 41, 49, 46, 44, 42 bytes
EDITS:

Refactored to use Bash-builtin (time), to address @Dennis precision concerns;
Reduced by 3 bytes, by utilizing Bash 4+ |& for stderr redirection;
Saved 2 more bytes by replacing seq -1000 1000 with seq -1e3 1e3 (Thanks @Dennis !);
-2 bytes by removing unnecessary backslash, and using default precision (Thx @Dennis !).

Golfed
TIMEFORMAT=%R*1000;(time seq -1e3 1e3)|&bc

Try It Online !
Sidenote
Using a coreutils "time" utility, instead of the Bash-builtin, results in a 41, 35 byte solution:
\time -f "%e*1000" seq -1e3 1e3|&bc

"\" is here to make bash invoke the real command, instead of the builtin.
Unfortunately coreutils time precision is only 1/100s, which have raised concerns on if it is a valid solution.

Bash + GNU utils, 43

Saved 2 bytes thanks to @Dennis
Saved 5 bytes thanks to @zeppelin

c=date\ +%s%3N
s=`$c`
seq -1e3 1e3
$c-$s|bc

The date command gives the number of seconds since the epoch concatenated with current nanoseconds.  This command is run before and after.  bc takes the difference and prints.
Try it online.

I was hoping to do this for 17:
time seq -1e3 1e3

But the output of time gives more than we need:
real    0m0.004s
user    0m0.000s
sys 0m0.004s

You can save two bytes by replacing 1000 with 1e3.

"But the output of time gives ...." ...perhaps you should man bash.

You can probably save a few bytes, by capturing the date with ms precision directly, like this: date +%s%3N.

JavaScript (ES6), 63 59 bytes

for(c=console.log,i=~1e3;i<1e3;c(++i));c(performance.now())

Nice. You can save three bytes by removing the space in new (d=Date) and starting at -1000: for(t=new(d=Date),c=console.log,i=~1e3;i<1e3;c(++i));c(new d-t)

@ETHproductions thanks :) the ~1e3 is a great touch.

In the snippet output is from only 952 to 1000 why is that?

@GurupadMamadapur The snippet output is limited to 50 lines. (Or more precisely: the 50 last lines.)

@Arnauld Oh okay.

Why not use for(c=console.log,i=~1e3;i<1e3;c(++i));c(performance.now()) (59 bytes)? According to MDN, the performance.now() "returns a DOMHighResTimeStamp, measured in milliseconds, accurate to one thousandth of a millisecond". Also, "The returned value represents the time elapsed since the time origin". In your case, the "time origin" will be 0 (the time the code started), since it is the only javascript code in the page. In few words: returns the time offset since the page has loaded.

@IsmaelMiguel Amazing wasn't aware of performance.now() or the Performance interface at all

It is relativelly new. You really should read about it. It's extremelly useful.

R, 42 bytes
system.time(cat(-1e3:1e3,sep="\n"))[3]*1e3

This will print
.
.
.
998
999
1000
elapsed
     60

To remove elapsed, two additional bytes are necessary:
system.time(cat(-1e3:1e3,sep="\n"))[[3]]*1e3

PHP, 110 70 bytes
still a little long; but saved 38 with @AlexHowansky´s hint, and two more with 1e3 and ~1e3.
for($t=($m=microtime)($i=~1e3);$i++<1e3;)echo"$i
";echo($m(1)-$t)*1e3;

prints float. Run with -r.

You can pass microtime() a truthy value and it will return a float directly, you don't have to add the strings.

-30% with that hint. I wish I could do ten upvotes on your comment. :D

It's sad how PHP doesn't have something that returns the time in milliseconds. Like Javascript has. I can't suggest improvements. It's as small as it can get. Well done!

@IsmaelMiguel I think JavaScript doesn´t have microseconds. :)

@Titus What I meant is that Javascript's dates are all handled in milliseconds, while PHP only had seconds or microseconds.

R, 66 bytes
x=proc.time();for(i in -1e3:1e3)cat(i,"\n");(proc.time()-x)[3]*1e3

Probably not the shortest but it works.

Can proc.time be stored in a variable? t=proc.time;x=t(); ...

Mathematica, 51 bytes
p[1*^3#]&@@AbsoluteTiming@Array[p=Print,2001,-1*^3]

Explanation
Array[p=Print,2001,-1*^3]

Store the Print function in p. Print 2001 numbers, starting at -1000, incrementing by 1.
AbsoluteTiming@ ...

Find the total time elapsed in seconds.
p[1*^3#]&@@ ...

Multiply that by 1000 (seconds -> miliseconds) and p (Print) it.

Argh, you beat me by 3 minutes! :) Are you sure Timing doesn't satisfy the (slightly vague) problem description as well as AbsoluteTiming?

@GregMartin Timing outputs the CPU time and does not include the time taken by the front end. That is. the time taken to increment the counter in Array is counted, but the time taken to display those numbers on screen is not counted. This effect can be seen in this simple example: Timing@Print@3 gives 0 seconds, but AbsoluteTiming@Print@3 does not.

Powershell, 27 Bytes
$1=date;-1e3..1e3;(date)-$1

Thanks to AdmBorkBork for pointing out that the verbose default output is acceptable in the challenge.
Outputs result like:
994
995
996
997
998
999
1000

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 5
Milliseconds      : 679
Ticks             : 56799255
TotalDays         : 6.57398784722222E-05
TotalHours        : 0.00157775708333333
TotalMinutes      : 0.094665425
TotalSeconds      : 5.6799255
TotalMilliseconds : 5679.9255

for more contained result of just milliseconds, use original answer:
$1=date;-1e3..1e3;((date)-$1).TotalMilliseconds

Save time before as $1, print to stdout automatically, then get the time between the beginning and end of execution.

You could just pipe the range to oh (Out-Host) which will bypass the fact that Measure-Command captures the pipeline. Example at TIO

@AdmBorkBork the point was that I don't think it will save bytes, unless I'm missing something.

Measure-Command{-1e3..1e3|oh} is 29 bytes. Sure, it prints out extra stuff thanks to the Measure-Command, but the challenge explicitly states that's OK.

Actually missed the point where you can print other data, the challenge creator might need to say if the very-verbose output of Measure-Command is acceptable. also $1=date;-1e3..1e3;(date)-$1 is 2 bytes shorter than the measure-command option there,

Oh right, haha. Nice golf.

Somehow worked out in the end! thanks for that, I would have been bringing shame to all the power shell golfers if this was 15 needless bytes longer.

Matlab, 16 23 Bytes
tic;(-1e3:1e3)'
toc*1e3

Edit: I realised I was violating several of this challenge's rules. That'll teach me to skim read the challenge late at night. I also now realise that the corrected answer is almost identical to the Octave solution, but such is life.
Prints each element in the created linear space array -1000:1000 (the lack of ; prints to console).
tic/toc records the time and toc prints the time to the console with or without the ; . 1e3 is needed to print in milliseconds.

Quite right, a correct solution has been edited.

Noodel, 17 13 bytes
13 bytes
Tried a slightly different approach and saved 4 bytes.
ƇQjȥḶGQɱ⁻Ñ€Ƈ⁻

Try it:)
How it works
Ƈ             # Pushes on the amount of milliseconds passed since 01/01/1970.

 Qjȥ          # Pushes 2001 onto the stack.
 Qj           # Pushes on the string "Qj"
   ȥ          # Converts the string into a number as base 98.

    ḶGQɱ⁻Ñ€   # Loops 2001 times printing -1000 to 1000.
    Ḷ         # Consumes the 2001 and loops the following code 2001 times.
     GQ       # Pushes on the string "GQ"
       ɱ      # Pushes on the current counter of the loop (i)
        ⁻     # Subtracts (i - "GQ") since i is a number, the "GQ" is converted to a number which will fail.
              # So, Noodel will treat the string as a base 98 number producing (i - 1000).
         Ñ    # Consume what is on the top of the stack pushing it to the screen followed by a new line.
          €   # The end of the loop.

           Ƈ⁻ # Calculates the duration of execution.
           Ƈ  # Pushes on the amount of milliseconds passed since 01/01/1970.
            ⁻ # Pushes on (end - start)

17 bytes
ƇGQȥḋɲṡ×2Ḷñ⁺1€ÑƇ⁻

Try it:)
How it works
Ƈ                 # Pushes on the amount of milliseconds passed since 01/01/1970.

 GQȥḋɲṡ×2         # Used to create the range of numbers to be printed.
 GQ               # Pushes on the string "GQ".
   ȥ              # Converts the string into number as if it were a base 98 number. (which is 1000)
    ḋ             # Duplicates the number and pushes it onto the stack.
     ɲ            # Since the item on top is already a number, makes the number negative (random thing I threw in at the very beginning when made the langauge and totally forgot it was there)
      ṡ           # Swaps the first two items on the stack placing 1000 on top.
       ×2         # Doubles 1000 producing... 2000

         Ḷñ⁺1€Ñ   # Prints all of the numbers from -1000 to 1000.
         Ḷ        # Consumes the 2000 to loop the following code that many times (now -1000 is on the top).
          ñ       # Prints the value on top of the stack followed by a new line.
           ⁺1     # Increment the value on top of the stack by 1.
             €    # End of the loop.
              Ñ   # Since 1000 is still not printed, this consumes 1000 and prints it followed by a new line.

               Ƈ⁻ # Calculates the number of milliseconds to execute program.
               Ƈ  # Pushes on the amount of milliseconds passed since 01/01/1970.
                ⁻ # Pushes on (end - start) in milliseconds.
                  # At the end, the top of the stack is pushed to the screen.

The snippet uses the values -4 to 4 in order to not take so long to complete.

Did you create this language after or before the challenge?

@EasterlyIrk, before:)

TI-Basic, 22 bytes
startTmr
For(A,-ᴇ3,ᴇ3
Disp A
End
startTmr-Ans

Many commands are represented by 1 or 2-byte tokens.

Tested on an emulated TI-84 CSE.

Perl 6, 45 bytes
.put for -($_=1e3)..$_;put (now -INIT now)*$_

Try it
Expanded:
# print the values

.put             # print with trailing newline ( method call on ｢$_｣ )

for              # for each of the following
                 # ( temporarily sets ｢$_｣ to the value )

-(
  $_ = 1e3       # store ｢Num(1000)｣ in ｢$_｣
)
..               # inclusive Range object
$_;

# print the time elapsed

put              # print with trailing newline

(now - INIT now) # Duration object that numifies to elapsed seconds
* $_             # times 1000 to bring it to milliseconds

# The ｢INIT｣ phaser runs code (the second ｢now｣) immediately
# as the program starts.

# There is no otherwise unrelated set-up in this code so this is a
# reliable indicator of the amount of time it takes to print the values.

8th, 61 47 bytes
Thanks to 8th_dev for nice improvement (saved 14 bytes)
d:msec ( . cr ) -1000 1000 loop d:msec swap - .

This will print all the integer numbers between -1000 and 1000 in ascending order and the time taken (in milliseconds) to print these numbers
-1000
-999
-998
-997
...
997
998
999
1000
4

It should be noted that suggesting edits to improve code qualifies as "destructive". Suggestions for golfing should be given as a comment instead. I'd ping the user who did it if I could, but I can't. http://meta.codegolf.stackexchange.com/q/1615/34718

I know that you approved it, which is fine since it's your own post, but other reviewers in the review queue should reject it, and the user who suggested the edit in the first place shouldn't have.

@mbomb007 - Thank you for letting me know this. In this specific case I verified the code before accepting it, but for the next time I will skip or reject such kind of review.

Pyth, 18 15 14 bytes
j}_J^T3J;*.d1J

Try it here!
Explanation
This is similar to my python answer.

    J^T3           Set J to 1000
  }_    J         List ranging from -1000 to 1000
j                 Join the list with new lines and implicitly print it
         ;*.d1J   Print time since execution of the program in milliseconds

Edits:

Thanks to fryamtheeggman for saving 3 bytes!
Thanks to busukxuan for saving a byte.

I tried this, 14 bytes, not sure if it works right. You need to add a newline at the start of the program. http://pyth.herokuapp.com/?code=%0AM%7D_J%5ET3J%2a.d1J&debug=0

J, 22 bytes
1e3*timex'echo,.i:1e3'

Try it online!
timex is a builtin that executes the string and returns the time it took to evaluate it in seconds. The string forms the range [-1000, 1000] using i:, then columinizes it using ,., and prints it using the builtin echo.

Groovy, 75 73 bytes
t=System.&nanoTime
s=t()
(-1000..1e3).each{println it}
print((t()-s)/1e6)

Thanks to jaxad0127 for saving 2 bytes!
Try it here !

nanoTime with a divide by 1e6 is shorter than currentTimeMillis. It also gives fractional time.

Japt, 23 bytes
There are two equivalent solutions:
Oo(Ð -(A³òA³n @OpXÃ,Ð¹n
K=Ð;A³òA³n @OpXÃ;OoÐ -K

The first one basically does the following:
output(-(new Date() - (1000 .range(-1000).map(X => print(X)), new Date())));

That is, the numbers are printed in the middle of the subtraction to avoid having to store the time in a variable. However, it's not any shorter than the variable route, which is basically:
K = new Date(); 1000 .range(-1000).map(X => print(X)); output(new Date() - K);

In the latest version of Japt (newer than this challenge), K is set up to automatically return new Date(). This cuts the first solution down to 21 bytes:
Oo(K-(A³òA³n @OpXÃK)n

Test it online!

C++ - 261
Just for a laugh I thought I'd post a C++ answer.
#include <iostream>
#include <chrono>
using namespace std::chrono; using c=std::chrono::system_clock; void p(){c::time_point n=c::now();for(int i=-1001;++i<1001;)std::cout<<i<<"\n";std::cout<<(duration_cast<milliseconds>(system_clock::now()-n)).count()<<"\n";}

I'll leave it as an exercise to determine what it is doing and how to call it - shouldn't be too difficult.

C 134 133 bytes
Thanks to @Thomas Padron-McCarthy for saving 1 byte.
f(){clock_t s,e;s=clock();for(int i=-1000;i<1001;i++)printf("%d\n",i);e=clock();printf("%lf",((double)((e-s))/(CLOCKS_PER_SEC))*1e3);}

Ungolfed version :
void f()
{
  clock_t s,e;

  s=clock();

  for(int i=-1000;i<1001;i++)
    printf("%d\n",i);

  e=clock();
  printf("%f",((double)((e-s))/(CLOCKS_PER_SEC))*1e3);

 }

You can save one character by changing "%lf" to "%f".

Why not int t=time(null); ... printf("%d",time(null)-t)? Shorter AFAIK

Scala, 77 bytes
def t=System.nanoTime
val s=t
Range(-1000,1001)map println
println((t-s)/1e6)

ForceLang, 124
set t timer.new()
set i -1000
label 1
io.writeln set i i+1
if i=1000
 io.write math.floor 0.001.mult t.poll()
 exit()
goto 1

Note: You should supress stderr when running this. I believe the consensus on meta is that this does not incur a byte count penalty.

SimpleTemplate, 92 bytes
What really killed me was the need to record the time.
{@callmicrotime intoX 1}{@for_ from-1000to1000}{@echol_}{@/}{@phpecho microtime(1)-$DATA[X]}

Since there's no math (yet), this makes things pretty hard, forcing me to write PHP directly.
Ungolfed:
{@call microtime into start_time true}
{@for i from -1000 to 1000 step 1}
    {@echol i}{@// echoes a newline after}
{@/}
{@php echo microtime(true) - $DATA["start_time"];}

Disclaimer:
I've ran this with the commit e118ae72c535b1fdbe1b80c847f52aa161854fda, from 2017-01-13.
The latest commit was to fix something that is un-related to the code in here.

QBIC, 34 bytes
d=timer[-z^3,z^3|?a]?z^3*(timer-d)

Uses the QBasic TIMER function, which returns seconds in decimal notation. Making it look pretty adds some bytes.
Explanation
d=timer     Set 'd' to the current # seconds since midnight
[-z^3,z^3|  FOR -1000 to 1000  --  Note that 'z' = 10 in QBIC, and z^3 saves a byte over 1000
?a          Display the iterator
]           Close the FOR loop
    timer-d Take the current time minus the time at the start of the program -- 0.156201
?z^3*()     Multiply by a thousand and display it   156.201

Racket, 72 bytes
(time(map(lambda(x)(display(exact-floor x))(newline))(range -1e3 1001)))

I thought Racket and Scheme were 2 different languages. Is this a polygot?

@Carcigenicate I somehow agree, Racket is a dialect of Scheme. I will remove "Scheme" from the title.

Oh, I didn't know that. I thought they were both just independent lisp dialects.

SAS, 36 bytes
Pretty straightforward, SAS prints out the time taken for a data step by default..
data c;do i=-1000 to 1000;put i;end;

Gura, 75 bytes
t=datetime.now();println(-1000..1000);print((datetime.now()-t).usecs/1000);

Clojure, 94 bytes
(let[t #(System/currentTimeMillis)s(t)](doseq[n(range -1e3 1001)](println n))(println(-(t)s)))

I'm disappointed at how long this got, but I guess no one ever claimed Clojure was a good language to golf in.
Naïve solution that just records the starting time, loops, then prints the current time minus the starting time. Unless Clojure has a ms-time getter than I'm missing, I don't know how this could get any shorter. Maybe some kind of implicit loop?
(defn time-print []
  (let [t #(System/currentTimeMillis) ; Alias the time-getter to "t"
        start (t)] ; Record starting time
    (doseq [n (range -1000 1001)] ; Loop over the range...
      (println n)) ; ... printing the numbers

    (println (- (t) start)))) ; Then print the current time minus the starting time.

Lua, 47 Characters
for i=-1e3,1e3 do print(i)end print(os.clock())

It's nice and simple, a basic printing for loop from -1e3 to 1e3, then just print the os.clock, which is conveniently the ms since program execution.

tcl, 58
set i -1001;puts [time {time {puts [incr i]} 2001}]

testable on http://rextester.com/WQVC76600
Note: The answer is given as microseconds per iteration — The iterations here indicated belong to the outermost time command, which are implicitly 1 when its iterations parameter is omitted, which is the case; and not about the loop iterations!

Pyth, 19 bytes
Edit: So apparently .d1 is the process time. Saved 6 bytes.
Edit: .d1 is the process time in µseconds, so I have to multiply it by 1000.
K^T3FNr_KhKN;*K.d1
This is a naive solution that pretty much does what's asked without any trick. I'm a beginner with Pyth and still getting the hang out of it. Any suggestion would be very appreciated!
Explanation

K^T3FNr_KhKN;*K.d1
K^T3                     Assigns 10^3 to K
    FNr_KhK              Loops on N from -1000 to 1000
           N;            Each loop, print N
             *K.d1       Prints process time * 1000

C# - 123
This isn't going to win anything but hey, here it goes :)
()=>{var t=DateTime.Now;var s="";for(int i=-1000;i<1001;i++)s+=i+"\n";Console.WriteLine(s+(DateTime.Now-t).Milliseconds);};

Run like this:
Action y = ()=>{var t=DateTime.Now;var s="";for(int i=-1000;i<1001;i++)s+=i+"\n";Console.WriteLine(s+(DateTime.Now-t).Milliseconds);};
y();

Forth, 60 bytes
utime - Report the current time in microseconds since some epoch.
utime
: f 1001 -1000 do I dup . CR loop ; f
utime - 1000 / .

Java 7, 125 bytes
void c(){long x=System.nanoTime(),i=-1001;for(;i<1e3;)System.out.println(++i);System.out.println((System.nanoTime()-x)/i/i);}

Ungolfed:
void c() {
  long x = System.nanoTime(),
       i = -1001;
  for(; i < 1e3; ){
    System.out.println(++i);
  }
  System.out.println((System.nanoTime() - x) / i / i);
}

Test code:
Try it here.
class M{
  static void c(){long x=System.nanoTime(),i=-1001;for(;i<1e3;)System.out.println(++i);System.out.println((System.nanoTime()-x)/i/i);}

  public static void main(String[] a){
    c();
  }
}

Example output:
-1000
-999
...
...
...
999
1000
13


text:
The modulus validation
Given a list of math expressions that all hold true and consist of modulo remainder  calculations with two numbers and a result, your task is to yield the first n numbers that hold true for all the statements in the list.
For example:
[m % 3 = 0, m % 4 = 1, m % 5 = 3], where % is the modulo operator.
For n = 3, the first 3 numbers (counting from 0) that fit the sequence  are 33, 93, 153, thus your result would be that (format up to you).
Rules / IO

You take a positive number n and a list of truths. Of course, the things you need take are only the RHS of the modulo operation and the result.
n and the numbers in the list of truths will always be in the range 1 -> 2^31-1, and so are the results.
You take input in any convenient form and output in any convenient form. For example, input: 3 [3 0, 4 1, 5 3] and output: 33 93 153.
It's guaranteed that the solution is mathematically possible.
The source of input can be from a file, function parameters, stdin, etc... Same goes for the output.
No loopholes.
This is code-golf, so the lowest byte count wins.

Testcases
# Input in the form <n>, <(d r), (d2 r2), ...>
# where <d> = RHS of the modulo expression and <r> the result of the expression. Output in the next line.

5, (3 2), (4 1), (5 3)
53 113 173 233 293

3, (8, 0), (13, 3), (14, 8)
120 848 1576

Reference implementation in pseudo-code
n = (an integer from stdin)
truths = (value pairs from stdin)
counter = 0

while n != 0 {
    if matches_criterias(counter, truths) {
        print counter
        n -= 1
    }

    counter += 1
}

Possible duplicate of http://codegolf.stackexchange.com/questions/48057/chinese-remainder-theorem

@flawr EDIT: The other question seems to ban a lot of things and only prints out one term. Not sure if this is a duplicate anymore....

@flawr That challenge has a time restriction. There are golfier ways to tackle this problem that do not rely on the Chinese Remainder Theorem.

Yes I am aware of that, that is why I just linked it.

Is 0 a valid result?

@Neil "...in the range 1 -> 2^32-1, and so are the results." So 0 is technically a valid result for some inputs, but I will never feed you input that would lead to 0.

Are we allowed to take the modulus expressions as a list of string expressions, like "i % 4 == 1"?

@mbomb007 I'm guessing you're going to use a trick related to eval... Well, since it's a convenient input format, why not :)

Jelly, 7 bytes
%⁼⁴
0ç#

This is a full program. Arguments are divisors, target moduli, and number of solutions, in that order.
Try it online!
How it works
0ç#  Main link.
     Left argument: D (array of divisors)
     Right argument: M (array of target moduli)
     Third argument: n (number of solutions)

0ç#  Execute the helper link with k = 0, 1, 2, ... as left argument and D as the
     right one until n of them return 1. Yield the array of matches.

%⁼⁴  Helper link. Left argument: k. Right argument: D

%    Compute k % d for each d in D.
 ⁼⁴  Compare the result with M.

JavaScript (ES6), 71 68 bytes
a=>f=(n,m=0)=>n?a.some(x=>m%x[0]-x[1],++m)?f(n,m):[m,...f(n-1,m)]:[]

A simple recursive function. Use by currying in the array first and n second, like so:
g=a=>f=(n,m=0)=>n?a.some(x=>m%x[0]-x[1],++m)?f(n,m):[m,...f(n-1,m)]:[]
g([[3, 2], [4, 1], [5, 3]])(5)

JavaScript (ES6), 74 70 69 bytes
Takes input as an integer n and an array a of [modulo, remainder] arrays with currying syntax (n)(a).
n=>a=>eval('for(i=r=[];a.some(([b,c])=>i%b-c)||--n*r.push(i);i++);r')

Test cases

let f =

n=>a=>eval('for(i=r=[];a.some(([b,c])=>i%b-c)||--n*r.push(i);i++);r')

console.log(f(5)([[3, 2], [4, 1], [5, 3]]))
console.log(f(3)([[8, 0], [13, 3], [14, 8]]))

Perl 6, 33 bytes
{grep((*X%@^b)eqv@^c,0..*)[^$^a]}

Try it
The input is ( number-of-values, list-of-divisors, list-of-remainders )
Expanded:
{   # bare block lambda with placeholder parameters ｢$a｣ ｢@b｣ ｢@c｣

  grep(

    # WhateverCode lambda:
    (

      *        # the value being tested

      X%       # cross modulus

      @^b      # with the divisors ( second parameter )

    )

    eqv        # is that list equivalent with

    @^c        # the expected remainders ( third parameter )

    # end of WhateverCode lambda

    ,

    0 .. *     # Range of all Integers starting with 0

  )[ ^$^a ]    # grab up-to ｢$a｣ values ( first parameter )
               # ( ｢^$a｣ is the same as ｢0 ..^ $a｣ )
}

JavaScript (ES6), 72 70 bytes
a=>g=(n,i,r=[],m=a.some(e=>i%e[0]^e[1]))=>n?g(n-!m,-~i,m?r:[...r,i]):r

Curried over the conditions array first and number of results second. Edit: Saved 2 bytes by not handling the zero case.

Python, 67 bytes
lambda n,r:[k for k in range(2**32)if all(k%d==m for d,m in r)][:n]

You only need range(2**31). Also, very nice. I came up with this answer independently.

Haskell, 47 bytes
n#l=take n[i|i<-[0..],all(\(d,r)->mod i d==r)l]

Usage example: 3 # [(8,0),(13,3),(14,8)] -> [120,848,1576].

Mathematica, 42 bytes
#2~ChineseRemainder~#+Range[0,#3-1]LCM@@#&

Unnamed function, returning a list of positive integers, and taking three inputs: the list of moduli, the list of remainders, and the number n of integers to return. For example, the second test case is invoked by
#2~ChineseRemainder~#+Range[0,#3-1]LCM@@#&[{8,13,14},{0,3,8},3]

and returns {120, 848, 1576}.
The builtin #2~ChineseRemainder~# gives the smallest nonnegative solution; to get all the desired solutions, we add this number to Range[0,#3-1]LCM@@#, which is the first n nonnegative multiples of the least common multiple of all the moduli.
Mathematica doesn't have lazily-evaluated infinite lists as far as I know, so this implementation was shorter than anything I found that tested nonnegative integers one by one—even with the length of the function name ChineseRemainder, and even though a test like Mod[k,{8,13,14}]=={0,3,8} works perfectly well.

PHP, 97 bytes
longest answer so far. But I´m glad I could get it below 100.
for($a=$argv;++$k;)for($i=$v=2;$m=$a[$i++];$v>$argc/2&&$a[1]-->0?print$k._:0)$v+=$k%$m==$a[$i++];

takes input from separate command line arguments,
prints matches separated and trailed by underscores.
Loop never breaks; barely suitable for online testers.
Run like php -r 'code' <n> <modulo1> <result1> <modulo2> <result2> ....
breakdown
for($a=$argv;++$k;)         // loop $k up from 1
    for($i=$v=2;                // $i = argument index, $v=2+ number of satisfied equations
        $m=$a[$i++];            // loop through modulo/result pairs
        $v>$argc/2                  // 2. if $v>argument-count/2
        &&$a[1]-->0                 // and match count not exhausted
            ?print$k._                  // print match
            :0                          // else do nothing
        )
            $v+=$k%$m==$a[$i++];    // 1. if $k%modulo==result, increment $v

notes
$argc==count($argv). For three pairs there are 8 arguments: the filename $argv[0], n=$argv[1] and the modulo/result pairs above that. $v=2 incremented 3 times gives 5>$argc/2.
Add one byte for a clean exit: Replace &&$a[1]-->0?print$k._ with ?$a[1]--?print$k._:die.

Pyth - 14 13 bytes
.f!fneT%ZhTQE

Try it online here.

SmileBASIC, 102 bytes
DEF V N,M
FOR K=1TO N@L
T=T+1F=0FOR J=1TO LEN(M)F=F||T MOD M[J-1]-M[J]J=J+1NEXT
ON!F GOTO @L?T
NEXT
END

This is the first time I've ever used ON in SB. The reason I used it here instead of IF F GOTO@L was so I could put ?T after it on the same line, saving 1 byte.

Python, 59 bytes
lambda n,m:[i for i in range(2**31)if all(map(eval,m))][:n]

m is a list of expressions in string form like ["i % 4 == 1", ...]
Try it online (with a shorter range, so it will actually finish)

PHP, 91 Bytes
Take the list as associative array

<?for($t=1;$r<$_GET[1];$i+=$t=!$t?:print+$i._.!++$r)foreach($_GET[0]as$k=>$v)$t*=$i%$k==$v;

Try it online!

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Code Golf - Print all unique ways of writing a number as a sum with a lexical order
I found about Code Golf after writing this program and decided to post the rules here so you can try it out too. I saw this, which is a less restrictive version of my question. I've got a bit more rules which (in my opinion) make the task quite a lot more tougher.
Title says it all. If the input is 8, we should get:
8 = 8
8 = 7 + 1
8 = 6 + 2
8 = 6 + 1 + 1
8 = 5 + 3
8 = 5 + 2 + 1
8 = 5 + 1 + 1 + 1
8 = 4 + 4
8 = 4 + 3 + 1
8 = 4 + 2 + 2
8 = 4 + 2 + 1 + 1
8 = 4 + 1 + 1 + 1 + 1
8 = 3 + 3 + 2
8 = 3 + 3 + 1 + 1
8 = 3 + 2 + 2 + 1
8 = 3 + 2 + 1 + 1 + 1
8 = 3 + 1 + 1 + 1 + 1 + 1
8 = 2 + 2 + 2 + 2
8 = 2 + 2 + 2 + 1 + 1
8 = 2 + 2 + 1 + 1 + 1 + 1
8 = 2 + 1 + 1 + 1 + 1 + 1 + 1
8 = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1

Unique means this 7 + 1 and this 1 + 7 is not allowed.
Lexical order means members must be sorted in descending order by the first addend. If their first addend is equal, sort them by their second addend, etc.

Objective
Lowest size program wins.

I'll post my solution after a few days or after a few of you have posted yours. Have fun!

I assume this is code-golf, but you should explicitly state the winning objective somewhere in the post - otherwise, nice challenge.

We've had a bunch of challenges about partitions already. It's probably not a duplicate of this challenge. It might be too similar to this one though.

Is any leading/trailing whitespace allowed?

Welcome to PPCG! This is a nice first challenge, but unfortunately, we've done it before. For the future, I recommend posting challenge ideas in the sandbox to get some feedback before the challenge goes live. Apart from having help looking for duplicates, you can also get feedback about other potential problems with the challenge that can be fixed before anyone starts working on or even posting answers.

@BusinessCat depends on whether people think my challenge is valid or a duplicate.

@MartinEnder should I delete my challenge then?

@HristiyanDodov: It's normally best to leave duplicates in place so that people can find the original challenge more easily. (For example, if you don't know the word "partition", searching for challenges like this is quite difficult; the existence of this challenge makes it easier.)

Here is my answer anyway (in case you're interested). What do you think? It's 326 bytes. https://jsfiddle.net/cyvbub31/

@HristiyanDodov i would suggest copying it to the sandbox and getting some feedback. I have just posted one there and will probably wait a week or so before I post here. No rush. Maybe a couple of folks in the community can help improve it (both yours and mine!).

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Primes with prime bit-counts
Task

Find all the non-negative integers up to and including a given non-zero positive integer n, that are prime and the count of 1's and 0's in their binary representation (having no leading zeroes) are prime too.

Here are the first five such primes,
17, 19, 37, 41, 79

10001, 10011, 100101, 101001, 1001111

Clarifications and rules

Default I/O methods are accepted.
The answer can be a program or a function.
If there are no such primes then output garbage or nothing.
Standard loopholes are forbidden.
2 3 5 7 did not make it to the list because in their binary representation number of occurrences of 0's and 1's are not prime. Consider 7whose binary representation is 111, here 0 occurs zero times and zero is not prime.
Built-ins are allowed.
The shortest code in bytes wins!

Test cases

10
[]

100
[17, 19, 37, 41, 79]

150
[17, 19, 37, 41, 79, 103, 107, 109, 131, 137]

/* Configuration */

var QUESTION_ID = 107050; // Obtain this from the url
// It will be like http://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 47650; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "http://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "http://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });
    else console.log(body);
  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    lang = jQuery(''+lang+'').text();

    languages[lang] = languages[lang] || {lang: a.language, lang_raw: lang, user: a.user, size: a.size, link: a.link};
  });

  var langs = [];
  for (var lang in languages)
    if (languages.hasOwnProperty(lang))
      langs.push(languages[lang]);

  langs.sort(function (a, b) {
    if (a.lang_raw.toLowerCase() > b.lang_raw.toLowerCase()) return 1;
    if (a.lang_raw.toLowerCase() < b.lang_raw.toLowerCase()) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}
body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}

<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

You ask for all primes under a given n, but you also say inclusive. Which do you mean?

@Riley What I mean is ...all the numbers from 1....n. I do not know how to rephrase it in a simple way.

I have phrased it for you.

@JonathanAllan Thanks a lot.

OEIS A144214

@mbomb007 Clearly, for any total ordering of integer sequences, the smallest uninteresting integer sequence would be itself interesting, and thus worthy of inclusion in OEIS. Ergo, OEIS contains all integer sequences, of any interest real or imagined :-)

Does the resulting list have to be sorted?

@mbomb007 nope.

I'm wondering whether Mathematica contains more builtins than OEIS has sequences...

We should do a version of this in the unary number system! Wait...

05AB1E, 9 bytes
ÅPʒbTS¢pP

Pretty straight-forward.
Try it online or verify all test cases.
Explanation:
ÅP         # Push a list of all prime numbers below or equal to the (implicit) input
  ʒ        # Filter this list of primes by:
   b       #  Convert it to a binary string
    TS     #  Push 10, and pop and convert it to a list of digits as strings: ["1","0"]
      ¢    #  Count those characters in the binary string
       p   #  Check for both those counts whether they're a prime number
        P  #  Check that this is truthy for both of them
           # (after which the filtered list is output implicitly as result)

There seems to be a bug in the count builtin ¢ when using an integer list on a string, so some alternatives to TS like Ð‰, 0L, or 1Ý doesn't seem to work and result in a pair of the binary string instead, unless we add a § (cast to string): Try it online.

Python 2, 106 102 100 bytes
k=m=1;p={0}
exec"p^={m%k*k,0};c=bin(k).count\nif{k,c('1'),c('0')-1}<p:print k\nm*=k*k;k+=1;"*input()

Try it online!
Background
To identify primes, we use a corollary of Wilson's theorem:

How it works
We start by initializing k and m as 1 and p as the set {0}. Note that m = 1 = 0!² = (k - 1)!². Immediately afterwards, the following code is executed n times, where n is the integer read from standard input.
p^={m%k*k,0};c=bin(k).count
if{k,c('1'),c('0')-1}<p:print k
m*=k*k;k+=1

By the corollary, m % k will be 1 if k is prime and 0 otherwise. Thus, {m%k*k,0} will return the set {k, 0} if k is prime and the set {0} otherwise.
If (and only if) k is prime, since p cannot contain k at this point, the in-place symmetric difference p^={m%k*k,0} will add k to the set p. Also, p will contain 0 after the update if and only if it does not contain 0 before, so 0 ∊ p if and only if k is even.
On the same line, we define a function c via c=bin(k).count, which will count the occurrences of its argument in k's binary representation.
The second line produces the actual output. {k,c('1'),c('0')-1} returns the set that consists of k itself, the number of set bits in k, and the number of unset bits in k. Since the output of bin(k) begins with 0b, we have to decrement c('0') to account for the leading 0.
If all of them are prime, they will all belong to p, which by now contains all prime numbers up to k (and potentially 0). If k is a Mersenne number (i.e., if it has only set bits), c('0')-1 will yield 0. Since Mersenne numbers are odd, p will not contain 0, so the condition will fail.
After (potentially) printing k, we multiply m by k². Since m = (k-1)!² before the update, m = k!² after it. After incrementing k, the relation m = (k-1)!² holds again and we're ready for the next iteration.

Mathematica, 80 68 54 bytes
Select[p=PrimeQ;Range@#,p@#&&And@@p/@#~DigitCount~2&]&

Explanation
Select[p=PrimeQ;Range@#,p@#&&And@@p/@#~DigitCount~2&]&

       p=PrimeQ                                        (* Store prime check func. in p *)
Select[                                             ]  (* Select *)
                Range@#                                (* from a list {1..n} *)
                        p@#                            (* numbers that are prime *)
                           &&                          (* And *)
                                     #~DigitCount~2    (* whose digit counts in binary *)
                             And@@p/@                  (* are prime as well *)

JavaScript (ES6), 123 118 115 111 104 96 bytes
Saved 4 bytes thanks to @Arnauld
G=n=>n?G(n>>1,++a[n%2]):a.some(n=>(P=x=>n%--x?P(x):x)(n)-1)
F=n=>F(n-1,G(n,a=[0,0,n])||alert(n))

A combination of three typical recursive functions. Alerts the sequence in reverse order and terminates on a "too much recursion" error.
Test snippet
(modified to output to the page)

alert = s => O.textContent += s + "\n"

G=n=>n?G(n>>1,++a[n%2]):a.some(n=>(P=x=>n%--x?P(x):x)(n)-1)
F=n=>F(n-1,G(n,a=[0,0,n])||alert(n))

F(1000)

The main function can return an array for 104 bytes:
G=n=>n?G(n>>1,++a[n%2]):a.some(n=>(P=x=>n%--x?P(x):x)(n)-1)
F=n=>n?F(n-1).concat(G(n,a=[0,0,n])?[]:n):[]

It can also be non-recursive at the cost of another byte:
G=n=>n?G(n>>1,++a[n%2]):a.some(n=>(P=x=>n%--x?P(x):x)(n)-1)
n=>[for(_ of Array(n))if(!G(--n,a=[0,0,n]))n]

Here's the one I started with: (Saved 6 bytes thanks to @Arnauld)
P=(n,x=n)=>n>1&--x<2||n%x&&P(n,x)
G=n=>n?G(n>>1,o+=n%2,t++):P(o)&P(t-o)
F=n=>n?F(n-1).concat(P(n)&G(n,o=t=0)?n:[]):[]

I tried golfing this further and managed to do it in 104 bytes—then realized I had already found that solution (it's at the bottom of the answer). Don't you hate it when that happens? :P
A non-recursive attempt at the main function (again, same byte count):
n=>[for(i of Array(n))if(P(--n)&G(n,o=t=0))n]

This one takes the easy route of counting how many 0's and 1's are in the binary representation:
F=n=>n?F(n-1).concat([n,(G=x=>n.toString(2).split(x).length-1)(0),G(1)].some(n=>(P=x=>n%--x?P(x):x)(n)-1)?[]:n):[]

Same thing with an array comprehension:
n=>[for(_ of Array(n))if(![--n,(G=x=>n.toString(2).split(x).length-1)(0),G(1)].some(n=>(P=x=>n%--x?P(x):x)(n)-1))n]

This one takes a slightly harder route to do the same thing:
F=n=>n?F(n-1).concat([n,(G=(x,w=n)=>w&&G(x,w>>1)+(w%2==x))(0),G(1)].some(n=>(P=x=>n%--x?P(x):x)(n)-1)?[]:n):[]

And this one takes yet another related route that's as short as the original:
F=n=>n?F(n-1).concat([n,o=(G=x=>x&&x%2+G(n>>++t))(n,t=0),t-o].some(n=>(P=x=>n%--x?P(x):x)(n)-1)?[]:n):[]

Again, you can golf 8 bytes by making it alert the sequence in reverse order:
F=n=>F(n-1,[n,o=(G=x=>x&&x%2+G(n>>++t))(n,t=0),t-o].some(n=>(P=x=>n%--x?P(x):x)(n)-1)||alert(n))

You don't really need to recursively pass a. Just initialize it in the initial call to G. (That should save 4 bytes.)

@Arnauld Oh yeah, thanks! This is fun :-)

Wow this has dropped a lot. Nice work

Jelly, 17 16 bytes
BĠL€µ;LÆPẠ
ÆRÇÐf

Try it online!
How?
BĠL€µ;LÆPẠ - Link 1, hasPrimeBits: n  e.g. 7         or 13
B          - convert to binary        e.g. [1,1,1]  or [1,1,0,1]
 Ġ         - group indices            e.g. [1,2,3]  or [3,[1,2,4]]
  L€       - length of €ach           e.g. 3          or [1,3]
    µ      - monadic chain separation
     ;L    - concatenate length       e.g. [3,1]      or [1,3,2]
           -     this caters for the edge case of Mersenne primes (like 7), which have
           -     no zero bits, the length will be 1, which is not prime.
       ÆP  - isPrime?                 e.g. [1,0]      or [0,1,1]
         Ạ - All?                     e.g. 0          or 0

ÆRÇÐf - Main link: N
ÆR    - prime range (primes up to and including N)
   Ðf - filter keep those satisfying
  Ç   - last link (1) as a monad

Ah thanks, I see you changed that, that'll save a byte.

You've got the alphabet going, there. ẠBÇÐ€fĠ...

@mbomb007 Yeah, the LÆµ;P bit always confuses me.

05AB1E, 14 bytes
ƒNpNbSD_‚OpP&–

Try it online!
Explanation
ƒ               # for N in [0 ... input]
 Np             # push N is prime
   Nb           # push N converted to binary
     S          # split into individual digits
      D_        # push an inverted copy
        ‚       # pair the 2 binary lists
         O      # sum them
          p     # elementwise check for primality
           P    # product of list
            &   # and with the primality of N
             –  # if true, print N

I still can't find a use for .¡, this challenge seemed good for it, but is longer: FNb{.¡€gpONp+3QiN}})

@carusocomputing: I had a similar solution I considered as well, but it also ended up slightly longer than this.

Jelly, 14 13 bytes
RBċþd`ÆPPTfÆR

Try it online!
How it works
RBċþd`ÆPPTfÆR  Main link. Argument: n

R              Range; yield [1, ..., n].
 B             Binary; convert each integer to base 2.
    d`         Divmod self; yield [n : n, n % n], i.e., [1, 0].
  ċþ           Count table; count the occurrences of 1 and 0 in each binary
               representation, yielding a pair of lists of length n.
      ÆP       Test each count for primality.
        P      Product; multiply the corresponding Booleans.
         T     Truth; get all indices of 1, yielding the list of integers in
               [1, ..., n] that have a prime amount of 0's and 1's.
           ÆR  Prime range; yield all primes in [1, ..., n].
          f    Filter; intersect the lists.

That d` trick is something else...

05AB1E, 17 15 bytes
LDpÏvybSD_)OpP—

Uses the CP-1252 encoding. Try it online!

LDpÏvybSD_)OpP— for 15 bytes should work.

@Emigna That is really clever! Thanks :).

Perl, 101 bytes
99 bytes of code + -nl flags.
$r=q/^1?$|^(11+)\1+$/;for$@(2..$_){$_=sprintf"%b",$@;print$@if(1x$@)!~$r&y/01/1/dr!~$r&s/0//gr!~$r}

To run it:
perl -lne '$r=q/^1?$|^(11+)\1+$/;for$@(2..$_){$_=sprintf"%b",$@;print$@if(1x$@)!~$r&y/01/1/dr!~$r&s/0//gr!~$r}' <<< 150

Some short explanations
$r holds the classical prime checking regex (q/^1?$|^(11+)\1+$/).
For all numbers between 2 and the input,
(1x$@)!~$r checks if the number is prime,
y/01/1/dr!~$r checks if the number of 0 in the binary representation is prime,
s/0//gr!~$r checks if the number 1 in the binary representation is prime.
(if the 3 conditions are met, print$@ prints it).

Thanks for the explanation. Quite amazing what you can do with what is basically regex and some logic :)

@Emigna Thanks! The explanations aren't very detailed (I'm having a hard time writing longer explanations), but it seems it was enough for you :) (I still believe the code is slightly too long, but I don't see how to get it shorter, so here it is)

As someone who doesn't know Perl I appreciate every explanation I can get. It won't help me make a Perl program but I understand some of the reasoning behind the method employed, which is always interesting.

MATL, 16 15 bytes
:"@tB!t~hshZp?@

Try it online!
:         % Input n (implicit). Push range [1 2 ... n]
"         % For each k in [1 2 ... n]
  @       %   Push k
  tB!     %   Duplicate. Binary expansion as an m×1 vector
  t~      %   Duplicate. Negate
  hs      %   Concatenate horizontally into an m×2 matrix. Sum of each column.
          %   This gives a 1×2 vector. However, for k==1 this gives the sum of
          %   the original 1×2 matrix (m==1). But fortunately it doesn't matter
          %   because 1 is not a prime anyway
  h       %   Concatenate horizontally into a 1×3 row vector
  Zp      %   Isprime function applied on each of those three numbers
  ?       %   If all gave true
    @     %     Push k
          %   End (implicit)
          % End (implicit)
          % Display (implicit)

Python, 129 125 123 bytes
If only zero were prime...
p=lambda n:all(n%m for m in range(2,n))*n>1
lambda n:[i for i in range(n+1)if p(i)*all(p(bin(i)[2:].count(x))for x in'01')]

Try it online
Function p is the prime-checking function, which has >0 at the end so that it works for zero as well, which would otherwise return -1. The anonymous lambda is the lambda that checks all the conditions required.

Here's a slightly different method using a set comprehension. The result will be a set. (124 bytes):
p=lambda n:all(n%m for m in range(2,n))*n>1
lambda n:{i*p(i)*all(p(bin(i)[2:].count(x))for x in'01')for i in range(n+1)}-{0}

Perl 6, 65 bytes
{grep {all($^a,|map {+$a.base(2).comb(~$_)},0,1).is-prime},0..$_}

Try it
Expanded:
{           # bare block lambda with implicit parameter ｢$_｣

  grep      # find all of the values where

  {         # lambda with placeholder parameter ｢$a｣

    all(    # all junction ( treat multiple values as a single value )

      $^a,  # declare parameter to block

      |\    # slip the following list into the outer list

      # get the count of 0's and 1's in the binary representation
      map

      {             # bare block lambda with implicit parameter ｢$_｣

        +           # turn to numeric ( count the values in the list )
        $a          # the outer parameter
        .base(2)    # in base 2
        .comb(~$_)  # find the characters that are the same as
      },0,1         # 0 or 1

    # ask if $a, count of 0's, count of 1's are all prime
    ).is-prime

  },

  0 .. $_ # Range from 0 to the input inclusive

}

Octave, 73 bytes
@(n)(p=primes(n))(all(isprime([s=sum(dec2bin(p)'-48);fix(log2(p))+1-s])))

Try It Online!
@(n)
    (p=primes(n))                           generate prime numbers
        (all(                               from them select those that
            isprime(                        are prime both
                [s=sum(dec2bin(p)'-48);     sum of 1s
                fix(log2(p))+1-s])))        and sum of 0s

Perl 6, 50 bytes
{grep {($_&+.base(2).comb(~0&~1)).is-prime},0..$_}

Variation of b2gills' answer, using the & junction operator to great effect.
Try it online!
How it works
{                                                }  # Lambda
                                            0..$_   # Range from 0 to the lambda argument.
 grep {                                   },        # Filter values satisfying:
       ($_                      ).is-prime          #  a) The Number itself is prime.
       (   +.base(2).comb(~0   )).is-prime          #  b) The count of 0's is prime.
       (   +.base(2).comb(   ~1)).is-prime          #  c) The count of 1's is prime.
          &                 &                       # Junction magic! :)

CJam, 26 27 bytes
ri){mp},{2b_1-,mp\0-,mp&},p

Straightforward algorithm, will golf further.
EDIT: Forgot n was inclusive.
Try it online!
For fun, this is very similar and also 27 bytes:
ri){_mp\2b_1-,mp\0-,mp&&},p

Explanation
ri                          e# Take an int as input
  ){mp},                    e# Take the range up and including to the input,
                            e#   including only prime numbers
       {                    e# For each prime...
        2b_                 e# Convert it to binary and copy it
           1-,mp            e# Take the top binary number, remove 1's, check if the length
                            e#   is prime
                \           e# Swap top elements
                 0-,mp      e# Do the same but remove 0's
                      &     e# And
                       },   e# Filter out primes for which the above block was false
                         p  e# Print nicely

Python, 172 170 168 159 154 133 130 bytes
p=lambda n:[i for i in range(1,n)if n%i==0]==[1]
lambda n:[i for i in range(n+1)if p(i)*all(p(bin(i)[2:].count(x))for x in'10')]

Usage: Call the anonymous lambda function
Method p checks whether a number is prime

Saved 2+2+9=13 bytes thanks to Gurupad Mamadapur
Saved 5 bytes thanks to mbomb007

You can save 2 more by using this v - def v(n):a=bin(n)[2:];return p(n)and(p(a.count('1'))and p(a.count('0')))

A much shorter one - v=lambda a:p(a)and all(p(bin(a)[2:].count(x))for x in['1','0'])

Strings are iterable. So you can use for x in'01'.

Jelly, 14 bytes
BċÆPðÐf
ÆRç0ç1

Try it online!
Unfortunately, I could only tie with @Dennis, but the algorithm seems to be somewhat different so I'm posting this anyway.
Explanation
Helper function (deletes list elements that don't have a prime number of occurrences of a given bit):
BċÆPðÐf
     Ðf   Filter {the first argument}, looking for truthy returns from
    ð     the preceding code, which takes two arguments:
B         Convert {the element being checked} to binary
 ċ        Count the number of occurrences of {the second argument}
  ÆP      Return true if prime, false if not prime

Main program:
ÆRç0ç1
ÆR        Generate all primes from 2 to the input
  ç0      Call the subroutine to require a prime 0 count
    ç1    Call the subroutine to require a prime 1 count

Bash + GNU utilities, 129 126 123 114 111 109 bytes
seq '-fp()([ `factor|wc -w` = 2 ]);g()(dc -e2o${n}n|tr -cd $1|wc -c|p);n=%.f;p<<<$n&&g 0&&g 1&&echo $n' $1|sh

Try it online!
Noticed the comment that the output doesn't have to be in increasing order -- shaved off 3 bytes by counting down instead of counting up.
Replaced grep with wc to save 3 additional bytes.
Eliminated a variable (9 more bytes off).
Changed the way factor is used -- 3 more bytes.
Made it golfier with seq (2 bytes).

Haxe, 169 171 bytes
function f(n,?p)return[for(j in(p=[for(i in 0...++n)i<2?0:i]))if(j>0){var x=j*2,y=0,z=0,k=j;while(k<n)p[k+=j]=0;while((x>>=1)>0)x&1>0?y++:z++;p[y]<1||p[z]<1?continue:j;}];

Nothing crazy. Essentially a modified sieve of Eratosthenes that evaluates the primality of the 0 / 1 count in the same iteration as crossing out higher non-primes. With some whitespace:
function f(n, ?p)
  return [ for (j in (p = [ for(i in 0...++n) i < 2 ? 0 : i ]))
    if (j > 0){
      var x = j * 2, y = 0, z = 0, k = j;
      while (k < n)
        p[k += j] = 0;
      while((x >>= 1) > 0)
        x & 1 > 0 ? y++ : z++;
      p[y] < 1 || p[z] < 1 ? continue : j;
    }
  ];

But today I learned I could put continue in a ternary operator and Haxe doesn't even mind.
Edit: +2 because n is an inclusive upper bound!

Hey, the n is inclusive.

@GurupadMamadapur You're right, fixed!

Stax, 14 bytes
ò≥úû╙2ï⌡T5è╧²■

Run and debug it

Vyxal, 14 bytes
'bĊvtJ₅3=$væA∧

Try it Online!
'              # (implicitly convert to range), then filter by...
 b             # Binary representation
  Ċ            # Count the amount of each value in a (1 & 0 only)
   vt          # Get the counts
     J         # Join the current number to each of those
      ₅        # Duplicate and get length
       3=      # Is it equal to 3?
         $     # Swap
          væA  # Are all prime?
             ∧ # Are both true?

Rust, 147 bytes
fn f(x:u32){let p=|n|n>1&&(2..n).all(|x|n%x!=0);for n in 9..x+1{if p(n)&&p(n.count_ones())&&p(n.count_zeros()-n.leading_zeros()){print!("{} ",n)}}}

playground link
The count_ones, count_zeros, and leading_zeros methods came in handy.
Formatted version
fn f(x: u32) {
    // primality test closure using trial division
    let p = |n| n > 1 && (2..n).all(|x| n % x != 0);

    for n in 9..x + 1 {
        if p(n) && p(n.count_ones()) && p(n.count_zeros() - n.leading_zeros()) {
            print!("{} ", n)
        }
    }
}

Pyke, 21 bytes
S#j_PI\0[jb2R/_P)I\1[

Try it here!
S#j                   - for j in filter(range(1, input+1))
   _PI                -  if is_prime(j):
        [jb2R/_P)     -   function_[(a) = V
         jb2          -      base_2(j)
            R/        -     ^.count(a)
      \0         I    -   if function_[("0"):
                  \1[ -    function_[("1")

Pyth, 18 bytes
f.APM_M+T/LSjT2U2S

Try it online here.

@GurupadMamadapur srry changing U to S

@GurupadMamadapur done

@GurupadMamadapur eS

@GurupadMamadapur cuz we're out of chars :P Pyth is ascii only.

Groovy, 120 bytes
p={x->(2..<x).every{x%it!=0}&x>1|x==2}
{x->(1..x).findAll({y->p(y)&'10'.every{p(Integer.toBinaryString(y).count(it))}})}

This is an unnamed closure.
Try it here!

JavaScript (ES6), 110 bytes
B=n=>n?B(n>>1,v[n%2]++):v.every(n=>(P=i=>n%--i?P(i):1==i)(n))
F=(n,a=[])=>n?F(n-1,B(n,v=[0,0,n])?[n,...a]:a):a

B=n=>n?B(n>>1,v,v[n%2]++):v.every(n=>(P=i=>n%--i?P(i):1==i)(n))
F=(n,a=[])=>n?F(n-1,B(n,v=[0,0,n])?[n,...a]:a):a

const update = () => {
  console.clear();
  console.log(F(input.value))
}

input.oninput = update;
update();
<input id="input" type="number" min="1" value="100" />

That primality test function is... just amazing :-) Did you create it yourself?

@ETHproductions You've seen it before http://codegolf.stackexchange.com/a/91309/11182 modified from here. I also borrowed your 1 and 0 counting code (whooped anything I could come up with) but alas I couldn't beat your byte count.

@ETHproductions Good catch thanks! Was an artefact of a previous version

Python 3, 97 bytes
def f(n,k=2,m=1,p={0}):f(n-1,k+1,m*k*k,p^{m%k*k,{*map(bin(m%k%n*k)[2:].count,'01')}<p==print(k)})

This is the same algorithm as in my Python 2 answer, but the implementation is quite different. The function prints to STDOUT and terminates with an error.
Try it online!

MATLAB, 50 bytes
@(n)all(isprime([n,sum(de2bi(n)),sum(~de2bi(n))]))

Haxe, 158 147 bytes
function p(n,x=1)return n%++x<1||n<2?x==n:p(n,x);function f(n){var q=n,t=0,o=0;while(q>0){t++;o+=q%2;q>>=1;}p(n)&&p(o)&&p(t-o)?trace(n):0;f(n-1);};

Outputs to STDOUT and terminates on a "too much recursion" error; call with e.g. f(1000);. You can use a while loop with no error for 156 bytes:
function p(n,x=1)return n%++x<1||n<2?x==n:p(n,x);function f(n){while(n>0){var q=n,t=0,o=0;while(q>0){t++;o+=q%2;q>>=1;}p(n)&&p(o)&&p(t-o)?trace(n):0;n--;}};

Using a range turned out three bytes longer:
function p(n,x=1)return n%++x<1||n<2?x==n:p(n,x);function f(n){for(i in 0...n+1){var q=i,t=0,o=0;while(q>0){t++;o+=q%2;q>>=1;}p(i)&&p(o)&&p(t-o)?trace(i):0;}};

Test it online!

Husk, 16 bytes
↑<⁰foΛṗo§e#0Σḋİp

Try it online!

Husk, 15 13 bytes
fȯΛṗmėΣ#0ḋḋŀ→

Try it online!
Explanation:
fȯΛṗmėΣ#0ḋḋŀ→
           ŀ→    Inclusive range from 0 to input
fȯ               Filter by
    mė             Map three functions over
          ḋ        The binary digits
      Σ              Sum of digits
       #0            Count of zeroes
         ḋ           And convert back to decimal
  Λṗ               Are all the results prime?

Japt, 15 bytes
õA fÈ¤ü mÊpX ej

Try it

Thunno 2, 11 bytes
œPæ2B01,cPp

Try it online!
Explanation
œPæ2B01,cPp  # Implicit input
œP           # Only keep primes from [1..input]
  æ          # Filter this list of primes by:
   2B        #  Convert it to a binary list
     01,c    #  Count 0s and 1s
         Pp  #  Are they both prime?
             # Implicit output

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Find the inside of a Loop
Task
Given a ASCII diagram of a loop
e.g.
....................
......@@@@@.........
......@...@.........
.....@@...@@@@@.....
....@@........@.....
....@........@@.....
....@@@@@@@@@@......
....................
....................

And a location on the loop
e.g.
(7,1)

You must find the inside and outside of the loop
e.g.
00000000000000000000
00000011111000000000
00000011111000000000
00000111111111100000
00001111111111100000
00001111111111100000
00001111111111000000
00000000000000000000
00000000000000000000

Specifications

You may take input for the diagram as a string separated by newlines or obvious equivalent
You will receive a coordinate on the loop (0 or 1 indexed) as part of your input.  You may place your origin at any place you wish.  You may take this coordinate in (<row>, <column>), (<column>, <row>) or as the linear position on the string.  You may receive these data in any reasonable method.  All characters on the loop will be the same as the character at that index.
Preferred output is a 2 dimensional array of truthy and falsy values, however strings of 1 and 0 separated by newlines or any obvious equivalent of the later two are accepted.  The inside and outside must have different truth values but it does not matter which is which.
A loop is defined as a group of characters such that they are all the same character (e.g. @) and so that every character in the loop has a path to the original character (The character at the coordinate of input) that only passes through that same character (Taxicab geometry No diagonals).
The inside is all the loop itself and the places that cannot reach the edge of the diagram without crossing the loop.
The outside is everywhere else
This is code-golf

Test Cases
PasteBin

Are we allowed to take the diagram as a matrix of characters, sth. like [['.', '.'],['.', '@']] instead of a string with newlines?

@hbaderts That is an obvious equivalent

@WheatWizard Thanks for the additional test case! I would however recommend to put them into a snippet or in a gist / pastebin, in order to make the challenge a bit more decluttered=)

Can we assume the input will be at least 2x2? Or if it¡s for example 1xN (a single line) how is insideness defined?

@LuisMendo For a line the inside will be the "loop" and nothing else

If I take the input as a linear coordinate into the 2D char array, can it be column-major (i.e. down, then across)?

@LuisMendo Go ahead.  I don't care how you take the data in I am not concerned with data processing but more the underlying algorithm.

@WheatWizard Thanks! Anyway my algorithm was flawed because it assumed the loop was convex :-(

can there be more than one loop in an image?

@Razetime It depends on what you mean by "more than one loop" I suppose.  Have a look at the testcases they might answer your question.  But if they don't if you reword the question I can answer and add a test case if needed.

MATLAB, 163 159 146 78 bytes
function m=f(m,y,x);[~,i]=bwfill(m~=m(y,x),x,y,8);m=m*0;m(i)=1;m=bwfill(m,'h')

Thanks @rahnema1 for -66 bytes!!!
Now it does work on Try it online! BUT a few adjustments were needed, as MATLAB and Octave are not entirely compatible.
Explanation
First we make a binary image that just masks all the characters that are equal to the initial character. Then we determine the connected component the initial character is in.
% determine the connected component that is contains initial character

[~,i]=bwfill(m~=m(y,x),x,y,8);     % i contains the indices of the connected component
m=m*0;m(i)=1;                      % create an image of the connected component

After that we create an image of that connected component and apply fill all the "holes" in the image.
m=bwfill(m,'h')

I think for golfing  Octave  is better so you may reduce it to at least 72 bytes

@rahnema1 I already started in MATLAB, so I'm not gonna change this submission now, but thanks for the suggestion=)

MATLAB: 67 bytes
function A=f(A,r,c),A=bwlabel(A==A(r,c),4);A=imfill(A==A(r,c),'h');

A couple caveats:

A is assumed to be a character array.
Indices in MATLAB are 1-based, with rows indexed first. It is assumed these changes would be made to the function input (i.e. the question example would be called as output = f(A,2,8)).
bwlabel and imfill are part of the Image Processing Toolbox.

welcome to codegolf!

@rahnema1: Amazed I didn't visit sooner, since I did some golfing on SO before this site was born.