Rosetta Stone Code Challenge I presume you've all heard of the Rosetta Stone, an ancient stone found to have essentially the same passage written on it in three different scripts. This challenge is based upon that: you have to write three versions of the same program in different languages.

The three programs must output the first n iban numbers, n being a number input by the user. There are only 30,275 iban numbers, so if n is greater than 30275, the program should return an error.

The challenge of the Rosetta Stone was that the scripts didn't appear to be mutually intelligible&ndash;knowing one didn't automatically make the others understandable. Your three programs should similarly be mutually unintelligible. That is, you may not golf down a Python 2 program and then submit it (or a minor modification) as a Python 3 version too, nor a C program as C++, etc. To prevent this, the Levenshtein distance between any two versions should be at least 25% of the length of the shorter of the two versions being compared, and at least 16 as an absolute numerical value. You may check conformance using this online Levenshtein distance calculator.

The winner is the person with the shortest combination of programs.
424 425: Haskell, Python 2, Perl

As they should for a true Rosetta comparison, all three programs work the same way, taking input from the first command-line argument and building up the list with the same rules, and variable names, where possible.

Haskell, 171

import System.Environment
main=do i&lt;-getArgs;putStr.show$[n|n&lt;-[0..777777],all(`notElem`"5689").show$n,all(\d-&gt;n`div`d`mod`100`notElem`13:[30..39])[1,1000]]!!(read.head$i)


Python 2, 156

import sys
print[n for n in range(777778)if all([c not in"5689"for c in str(n)])and all([n/d%100not in[13]+range(30,40)for d in[1,1000]])][int(sys.argv[1])]


Perl, 97 98

$i=@ARGV[0];die if $i&gt;30275;for(0..777777){push@n,$_ if!(/[5689]/ or/(13|3.)(|...)$/)}print@n[$i]