Skip to main content
Commonmark migration
Source Link

#Haskell, 131, 114, 106 bytes

Haskell, 131, 114, 106 bytes

iterate(\n->minimum[x|x<-[read(show=<<filter(/=k)[i..j])::Int|i<-[1..n],j<-[i+2..n],k<-[i+1..j-1]],x>n])13 

This is limited by the size of Int, but it can be easily extended by replacing Int with Integer.

Less golfed:

concatInt x = read (concatMap show x) ::Int allUpToN n = [concatInt $ filter (/=k) [i..j] | i <- [1..n], j <- [i+2..n], k <- [i+1..j-1]] f n = minimum[x | x <- allUpToN, x > n ] iterate f 13 

8 bytes golfed by @nimi.

#Haskell, 131, 114, 106 bytes

iterate(\n->minimum[x|x<-[read(show=<<filter(/=k)[i..j])::Int|i<-[1..n],j<-[i+2..n],k<-[i+1..j-1]],x>n])13 

This is limited by the size of Int, but it can be easily extended by replacing Int with Integer.

Less golfed:

concatInt x = read (concatMap show x) ::Int allUpToN n = [concatInt $ filter (/=k) [i..j] | i <- [1..n], j <- [i+2..n], k <- [i+1..j-1]] f n = minimum[x | x <- allUpToN, x > n ] iterate f 13 

8 bytes golfed by @nimi.

Haskell, 131, 114, 106 bytes

iterate(\n->minimum[x|x<-[read(show=<<filter(/=k)[i..j])::Int|i<-[1..n],j<-[i+2..n],k<-[i+1..j-1]],x>n])13 

This is limited by the size of Int, but it can be easily extended by replacing Int with Integer.

Less golfed:

concatInt x = read (concatMap show x) ::Int allUpToN n = [concatInt $ filter (/=k) [i..j] | i <- [1..n], j <- [i+2..n], k <- [i+1..j-1]] f n = minimum[x | x <- allUpToN, x > n ] iterate f 13 

8 bytes golfed by @nimi.

nimi's suggestion
Source Link
Michael Klein
  • 2.4k
  • 15
  • 29

#Haskell, 131, 114114, 106 bytes

iterate(\n->minimum[x|x<-[read(concatMap show$filtershow=<<filter(/=k)[i..j])::Int|i<-[1..n],j<-[i+2..n],k<-[i+1..j-1]],x>n])13 

This is limited by the size of Int, but it can be easily extended by replacing Int with Integer.

Less golfed:

concatInt x = read (concatMap show x) ::Int allUpToN n = [concatInt $ filter (/=k) [i..j] | i <- [1..n], j <- [i+2..n], k <- [i+1..j-1]] f n = minimum[x | x <- allUpToN, x > n ] iterate f 13 

8 bytes golfed by @nimi.

#Haskell, 131, 114 bytes

iterate(\n->minimum[x|x<-[read(concatMap show$filter(/=k)[i..j])::Int|i<-[1..n],j<-[i+2..n],k<-[i+1..j-1]],x>n])13 

This is limited by the size of Int, but it can be easily extended by replacing Int with Integer.

Less golfed:

concatInt x = read (concatMap show x) ::Int allUpToN n = [concatInt $ filter (/=k) [i..j] | i <- [1..n], j <- [i+2..n], k <- [i+1..j-1]] f n = minimum[x | x <- allUpToN, x > n ] iterate f 13 

#Haskell, 131, 114, 106 bytes

iterate(\n->minimum[x|x<-[read(show=<<filter(/=k)[i..j])::Int|i<-[1..n],j<-[i+2..n],k<-[i+1..j-1]],x>n])13 

This is limited by the size of Int, but it can be easily extended by replacing Int with Integer.

Less golfed:

concatInt x = read (concatMap show x) ::Int allUpToN n = [concatInt $ filter (/=k) [i..j] | i <- [1..n], j <- [i+2..n], k <- [i+1..j-1]] f n = minimum[x | x <- allUpToN, x > n ] iterate f 13 

8 bytes golfed by @nimi.

golfed more + explanation
Source Link
Michael Klein
  • 2.4k
  • 15
  • 29

#Haskell, 131131, 114 bytes

import Data.List iterate(\n->sort[x|x<>minimum[x|x<-[read(concatMap show$filter(/=k)[i..j])::Int|i<-[1..n],j<-[i+2..n],k<-[i+1..j-1]],x>n]!!0)13 

This is limited by the size of Int, but it can be easily extended by replacing Int with Integer.

Less golfed:

concatInt x = read (concatMap show x) ::Int allUpToN n = [concatInt $ filter (/=k) [i..j] | i <- [1..n], j <- [i+2..n], k <- [i+1..j-1]] f n = minimum[x | x <- allUpToN, x > n ] iterate f 13 

#Haskell, 131 bytes

import Data.List iterate(\n->sort[x|x<-[read(concatMap show$filter(/=k)[i..j])::Int|i<-[1..n],j<-[i+2..n],k<-[i+1..j-1]],x>n]!!0)13 

This is limited by the size of Int, but it can be easily extended by replacing Int with Integer.

#Haskell, 131, 114 bytes

iterate(\n->minimum[x|x<-[read(concatMap show$filter(/=k)[i..j])::Int|i<-[1..n],j<-[i+2..n],k<-[i+1..j-1]],x>n])13 

This is limited by the size of Int, but it can be easily extended by replacing Int with Integer.

Less golfed:

concatInt x = read (concatMap show x) ::Int allUpToN n = [concatInt $ filter (/=k) [i..j] | i <- [1..n], j <- [i+2..n], k <- [i+1..j-1]] f n = minimum[x | x <- allUpToN, x > n ] iterate f 13 
Source Link
Michael Klein
  • 2.4k
  • 15
  • 29
Loading