#!/usr/bin/perl use strict; use warnings; use 5.010; my $i = 1; while (1) { my $test = sprintf("%b",$i); say $test; last unless $test%2017; $i++; }