text:
Write an IBAN validator
Write a program (the body of the function is enough) that accepts a string of alphanumeric characters and validates it according to ISO 13616:2007. The algorithm for validation is (source: wikipedia article on IBAN http://en.wikipedia.org/wiki/International_Bank_Account_Number):

Validating the IBAN An IBAN is validated by converting it into an
  integer and performing a basic mod-97 operation (as described in ISO
  7064) on it. If the IBAN is valid, the remainder equals 1.The
  algorithm of IBAN validation is as follows:

Check that the total IBAN length is correct as per the country. If not, the IBAN is invalid. The correct IBAN lengths can be found here: http://pastebin.com/kp4eECVk (can also be found below), ordered by the length of the IBAN number. the first 2 characters of each number is the country code. All other characters (lowercase letters on the pastebin, but can be any case in the actual IBAN) behind the first 2 can be any alphanumeric character.
Move the four initial characters to the end of the string.
Replace each letter in the string with two digits,thereby expanding the string, where A = 10, B = 11, ..., Z = 35.
Interpret the string as a decimal integer and compute the remainder of that number on division by 97

If the remainder is 1, the check digit test is passed and the IBAN might be valid.
Example (fictitious United Kingdom bank, sort code 12-34-56, account number 98765432):
- IBAN:               GB82 WEST 1234 5698 7654 32
- Rearrange:          W E S T12345698765432 G B82
- Convert to integer: 3214282912345698765432161182
- Compute remainder:  3214282912345698765432161182    mod 97 = 1

The algorithm moest return true (or a truthy value) if the number is valid, and false (or a falsy value) if the number is invalid according to the algorithm. You do not need to check if the number actually exists, only if it's valid. The algorithm has to work for each of the different approved IBAN numbers mentioned in the wikipedia article above. The algorithm should be compatible with numbers both with or without separator characters between 2 alphanumeric characters. The separator character can either be periods, spaces or dashes and one number can contain different types of separators.
Usual loopholes apply: no external resources, no built-in functions or methods.
Puzzle type is code golf. Shortest code in bytecount wins. Standard boilerplate needed to execute the program (e.g. namespace, class, function declaration in OOP) is not included in the bytecount.
Bonus: if you can return the properly formatted IBAN number (according to the national format on wikipedia) instead of true in the case of a valid number, you get a 25% reduction in your score. If the number is invalid, you return a literal string with the value "Invalid".

Copy of the IBAN lengths in case the pastebin ever is removed:
Country;Chars;IBAN Fields
Norway;15;NOkk bbbb cccc ccx
Belgium;16;BEkk bbbc cccc ccxx
Burundi;16;BIkk nnnn nnnn nnnn
Denmark;18;DKkk bbbb cccc cccc cc
Faroe Islands;18;FOkk bbbb cccc cccc cx
Finland;18;FIkk bbbb bbcc cccc cx
Greenland;18;GLkk bbbb cccc cccc cc
Netherlands;18;NLkk bbbb cccc cccc cc
Macedonia;19;MKkk bbbc cccc cccc cxx
Slovenia;19;SIkk bbss sccc cccc cxx
Austria;20;ATkk bbbb bccc cccc cccc
Bosnia and Herzegovina;20;BAkk bbbs sscc cccc ccxx
Estonia;20;EEkk bbss cccc cccc cccx
Kazakhstan;20;KZkk bbbc cccc cccc cccc
Lithuania;20;LTkk bbbb bccc cccc cccc
Luxembourg;20;LUkk bbbc cccc cccc cccc
Costa Rica;21;CRkk bbbc cccc cccc cccc c
Croatia;21;HRkk bbbb bbbc cccc cccc c
Latvia;21;LVkk bbbb cccc cccc cccc c
Liechtenstein;21;LIkk bbbb bccc cccc cccc c
Switzerland;21;CHkk bbbb bccc cccc cccc c
Bahrain;22;BHkk bbbb cccc cccc cccc cc
Bulgaria;22;BGkk bbbb ssss ddcc cccc cc
Georgia;22;GEkk bbcc cccc cccc cccc cc
Germany;22;DEkk bbbb bbbb cccc cccc cc
Ireland;22;IEkk aaaa bbbb bbcc cccc cc
Montenegro;22;MEkk bbbc cccc cccc cccc xx
Serbia;22;RSkk bbbc cccc cccc cccc xx
United Kingdom;22;GBkk bbbb ssss sscc cccc cc
Gibraltar;23;GIkk bbbb cccc cccc cccc ccc
Israel;23;ILkk bbbn nncc cccc cccc ccc
United Arab Emirates;23;AEkk bbbc cccc cccc cccc ccc
Andorra;24;ADkk bbbb ssss cccc cccc cccc
Czech Republic;24;CZkk bbbb ssss sscc cccc cccc
Moldova;24;MDkk bbcc cccc cccc cccc cccc
Pakistan;24;PKkk bbbb cccc cccc cccc cccc
Romania;24;ROkk bbbb cccc cccc cccc cccc
Saudi Arabia;24;SAkk bbcc cccc cccc cccc cccc
Slovakia;24;SKkk bbbb ssss sscc cccc cccc
Spain;24;ESkk bbbb gggg xxcc cccc cccc
Sweden;24;SEkk bbbc cccc cccc cccc cccx
Tunisia;24;TNkk bbss sccc cccc cccc cccc
Virgin Islands;24;VGkk bbbb cccc cccc cccc cccc
Algeria;24;DZkk nnnn nnnn nnnn nnnn nnnn
Portugal;25;PTkk bbbb ssss cccc cccc cccx x
Angola;25;AOkk nnnn nnnn nnnn nnnn nnnn n
Cape Verde;25;CVkk nnnn nnnn nnnn nnnn nnnn n
Mozambique;25;MZkk nnnn nnnn nnnn nnnn nnnn n
Iceland;26;ISkk bbbb sscc cccc iiii iiii ii
Turkey;26;TRkk bbbb bxcc cccc cccc cccc cc
Iran;26;IRkk nnnn nnnn nnnn nnnn nnnn nn
France;27;FRkk bbbb bggg ggcc cccc cccc cxx
Greece;27;GRkk bbbs sssc cccc cccc cccc ccc
Italy;27;ITkk xaaa aabb bbbc cccc cccc ccc
Mauritania;27;MRkk bbbb bsss sscc cccc cccc cxx
Monaco;27;MCkk bbbb bsss sscc cccc cccc cxx
San Marino;27;SMkk xaaa aabb bbbc cccc cccc ccc
Burkina Faso;27;BFkk nnnn nnnn nnnn nnnn nnnn nnn
Cameroon;27;CMkk nnnn nnnn nnnn nnnn nnnn nnn
Madagascar;27;MGkk nnnn nnnn nnnn nnnn nnnn nnn
Albania;28;ALkk bbbs sssx cccc cccc cccc cccc
Azerbaijan;28;AZkk bbbb cccc cccc cccc cccc cccc
Cyprus;28;CYkk bbbs ssss cccc cccc cccc cccc
Dominican Republic;28;DOkk bbbb cccc cccc cccc cccc cccc
Guatemala;28;GTkk bbbb cccc cccc cccc cccc cccc
Hungary;28;HUkk bbbs sssk cccc cccc cccc cccx
Lebanon;28;LBkk bbbb cccc cccc cccc cccc cccc
Poland;28;PLkk bbbs sssx cccc cccc cccc cccc
Benin;28;BJkk annn nnnn nnnn nnnn nnnn nnnn
Ivory Coast;28;CIkk annn nnnn nnnn nnnn nnnn nnnn
Mali;28;MLkk annn nnnn nnnn nnnn nnnn nnnn
Senegal;28;SNkk annn nnnn nnnn nnnn nnnn nnnn
Brazil;29;BRkk bbbb bbbb ssss sccc cccc ccct n
Palestinian;29;PSkk bbbb xxxx xxxx xccc cccc cccc c
Qatar;29;QAkk bbbb cccc cccc cccc cccc cccc c
Ukraine;29;UAkk bbbb bbcc cccc cccc cccc cccc c
Jordan;30;JOkk bbbb nnnn cccc cccc cccc cccc cc
Kuwait;30;KWkk bbbb cccc cccc cccc cccc cccc cc
Mauritius;30;MUkk bbbb bbss cccc cccc cccc cccc cc
Malta;31;MTkk bbbb ssss sccc cccc cccc cccc ccc

To whoever suggested to add perl and python tags: language tags in challenges should be used to confine the challenge to a certain language (or at least, I think that's the intent of them). This challenge is open to all languages. As such, I rejected the edit.

J (294 - 73.5 = 220.5)
I've not counted the function definition (f=:3 :0...)) because it can be considered boilerplate, counting the whole block gives a score of 304 - 76 = 228.
f=:3 :0
>((1=97|1".'x',~' '-.~":48-~k-7*64<k=.3&u:4|.b)*(#b)=15+1 i.~+/"1(2{.b)&E.;.2'NO.BEBI..DKFOFIGLNL.MKSI.ATBAEEKZLTLU.CRHRLVLICH.BHBGGEDEIEMERSGB.GIILAE.ADCZMDPKROSASKESSETNVGDZ.PTAOCVMZ.ISTRIR.FRGRITMRMCSMBFCMMG.ALAZCYDOGTHULBPLBJCIMLSN.BRPSQAUA.JOKWMU.MT.'){'Invalid';1}.;' '&,&.>_4<\b=.y-.' -.'
)

Tests:
   NB. invalid numbers
   f ''
Invalid
   f 'GB82 WEST 1234 5698 7654 31'
Invalid
   f 'NL82 WEST 1234 5698 7654 32'
Invalid

   NB. different separators and formatting
   f 'GB82.WEST.1234.5698.7654.32'
GB82 WEST 1234 5698 7654 32
   f 'GB82-WEST-1234-5698-7654-32'
GB82 WEST 1234 5698 7654 32
   f 'GB82WEST12345698765432'
GB82 WEST 1234 5698 7654 32
   f 'GB82 WEST 1234 5698 7654 32'
GB82 WEST 1234 5698 7654 32
   f 'GB.82-WE ST-12.345698.76-5432'
GB82 WEST 1234 5698 7654 32

   NB. wikipedia examples
   f 'GR16 0110 1250 0000 0001 2300 695'
GR16 0110 1250 0000 0001 2300 695
   f 'CH93 0076 2011 6238 5295 7'
CH93 0076 2011 6238 5295 7
   f 'SA03 8000 0000 6080 1016 7519'
SA03 8000 0000 6080 1016 7519
   f 'GB29 NWBK 6016 1331 9268 19'
GB29 NWBK 6016 1331 9268 19

Explanation:

b=.y-.' -.': remove any separators from the argument and store the result in b.
1}.;' '&,&.>_4<\b: split b up in groups of four, add a space in front of every group, join the groups and remove the leading space. If y contained a valid IBAN number, this is its canonical representation (i.e. groups of four, separated by spaces, with the last group maybe having less than four elements).
(...){'Invalid';: create an array with the string Invalid as element 0 and the formatted IBAN number as element 1. Select the right one based on whether the IBAN number is valid:

Check the length:

'NO.BEBI.---.JOKWU.MT.': a list of all the country codes for each length, separated by dots
+/"1(2{.b)&E.;.2: group the string by the dots, and see which one contains the given country code (the first 2 elements of b).
15+1 i.~: find the index of the matching one and add 15 to find the length.
(#b)=: check it against the actual length of b.

Check the number:

4|.b: rotate b to the left by 4 (rearrange)
k=.3&u:: find the ASCII value for each number
48-~k-7*64<k: subtract 7 from each letter, then subtract 48 from all, giving the values
1".'x',~' '-.~":: format, remove spaces, add an 'x' at the end (for high-precision mode, which is necessary for large numbers), and turn it back into a number
1=97|: check if the number mod 97 equals 1.

>: unbox the resulting string

CJam, 151.5 141.75 points
0000000: 6c22 202e 2d22 2d3a 512c 220f a86e 5136  l" .-"-:Q,"..nQ6
0000010: 1bff 75f6 e8e4 0b35 5dab f190 0d85 59c4  ..u....5].....Y.
0000020: 1938 4366 3d29 5eaa e879 024a 77d9 8baf  .8Cf=)^..y.Jw...
0000030: 5c16 3258 a4d2 4e6c 1a60 429f affa b8f4  \.2X..Nl.`B.....
0000040: 435d e706 457b 89a9 16b8 1d4b 08f7 9970  C]..E{.....K...p
0000050: eeb9 7467 f8e9 c935 33be 2467 3dd4 1afb  ..tg...53.$g=...
0000060: e2ec 20cc 99e4 2783 cb96 512d f9f8 7e75  .. ...'...Q-..~u
0000070: 7066 4307 2232 3536 6232 3762 2740 662b  pfC."256b27b'@f+
0000080: 2740 2f7b 5132 3c23 3126 217d 235f 573e  '@/{Q2<#1&!}#_W>
0000090: 462a 2b3d 5134 6d3c 412c 7327 5b2c 3635  F*+=Q4m<A,s'[,65
00000a0: 3e2b 6623 737e 3937 2531 3d5d 312d 2249  >+f#s~97%1=]1-"I
00000b0: 6e76 616c 6964 2251 342f 532a 3f         nvalid"Q4/S*?

The above program is 189 bytes long and qualifies for the bonus.
At the cost of 26 more bytes – for a total score of 161.25 – we can avoid unprintable characters:
l" .-"-:Q,",YER,moTd$V6nH\-Mh/I-z(]k!uw()=j9_[C3n&As0(F;TAn$eB-r%:p+^b,1Y.j;thavi@!d,Dt7M_x-5V:#o/m_CKj-c*Imy~IjXPBCo?aM#lrN:o48u_2EKgyG@.V"33f-94b27b'@f+'@/{Q2<#1&!}#_W>F*+=Q4m<A,s'[,65>+f#s~97%1=]1-"Invalid"Q4/S*?

You can test this version in the CJam interpreter.
Example run
$ cat gen.cjam
"l\" .-\"-:Q,"[32,15>{[
"NO"15"BE"16"BI"16"DK"18"FO"18"FI"18"GL"18"NL"18"MK"19"SI"19
"AT"20"BA"20"EE"20"KZ"20"LT"20"LU"20"CR"21"HR"21"LV"21"LI"21
"CH"21"BH"22"BG"22"GE"22"DE"22"IE"22"ME"22"RS"22"GB"22"GI"23
"IL"23"AE"23"AD"24"CZ"24"MD"24"PK"24"RO"24"SA"24"SK"24"ES"24
"SE"24"TN"24"VG"24"DZ"24"PT"25"AO"25"CV"25"MZ"25"IS"26"TR"26
"IR"26"FR"27"GR"27"IT"27"MR"27"MC"27"SM"27"BF"27"CM"27"MG"27
"AL"28"AZ"28"CY"28"DO"28"GT"28"HU"28"LB"28"PL"28"BJ"28"CI"28
"ML"28"SN"28"BR"29"PS"29"QA"29"UA"29"JO"30"KW"30"MU"30"MT"31
]2/{1=L=},0f=_!!{:+}*}fL]"@"*'@f-27b256b:c`"\\\\"/"\\"*
"256b27b'@f+'@/{Q2<#1&!}#_W>F*+=Q4m<A,s'[,65>+f#s~97%1=]1-\"Invalid\"Q4/S*?"
$ LANG=en_US cjam gen.cjam | tee >(cksum) > iban.cjam
770150303 189
$ LANG=en_US cjam iban.cjam <<< GB82WEST12345698765432; echo
GB82 WEST 1234 5698 7654 32

How it works
"…"256b27b'@f+"

converts the string "…" into an integer by considering it a base-256 number, then into an array of integers by considering it a base 27-number, adds the character code of @ to each digit and casts to Character in the process.
As a result, the following code gets executed:
" Read one line from STDIN, remove allowed separators, store the result in variable
  “Q” and push its length (“,”).                                                      ";

l" .-"-:Q,

" Push the string from above.
  The correct number of characters for country code “NO” is 15.
  The correct number of characters for country codes “BE” and “BI” is 16.
  The number of characters should never be 17.
  ⋮                                                                                ";

"NO@BEBI@@DKFOFIGLNL@MKSI@ATBAEEKZLTLU@CRHRLVLICH@BHBGGEDEIEMERSGB@"
"GIILAE@ADCZMDPKROSASKESSETNVGDZ@PTAOCVMZ@ISTRIR@FRGRITMRMCSMBFCMMG@"
"ALAZCYDOGTHULBPLBJCIMLSN@BRPSQAUA@JOKWMU@MT"++

" Split the above string at the at signs (“@”).                                       ";

'@/

" Find the index of the (first) substring such that the index of the country code
  (“Q2<”) in the substring is even.                                                   ";

{Q2<#1&!}#

" If the country code is invalid, the index will be -1. If the index is greater than
  -1 (“W>”), add 15 to it; if it isn't, leave -1 on the stack.                        ";

_W>F*+

" Compare the result to the length of the IBAN. Push 1 if they match and 0 otherwise. ";

=

" Push the IBAN rotated to the left by four characters.                               ";

Q4m<

" “A,s'[,65>+” pushes “0123456789ABCDEFGHIJKLMNOPQRSTUVXYZ”. For each character of
   the IBAN, push its index in that string (-1 if not present).                       ";

A,s'[,65>+f#

" Stringify (“s”) the result, interpret the string (“~”) and compute the residue of
  the (topmost) resulting integer modulo 97.                                          ";

s97%

" Push 1 if the residue is 1; otherwise, push 0                                       ";

1=

" Wrap the entire stack in an array and remove the integer 1 from it. If the IBAN is
  valid, the array will be empty.

" If the result is falsy, the IBAN is valid; split it into substrings of length 4
  and join them using spaces (“S”). Otherwise, the IBAN is invalid; say so.           ";

"Invalid"Q4/S*?

LANG=en_US java -jar cjam-0.6.2.jar iban.cjam<<<GB82WEST12345698765432 outputs Invalid, what am I doing wrong (running on Windows8.1 and Cygwin)?

@professorfish: I don't have a Windows computer, so I can't check from this end, but let's start by verifying the following: 1. Did iban.cjam get generated successfully? md5sum iban.cjam should print 1960c33e31ae5646cd0400826757b3bc. 2. Is the locale installed properly? You can check by executing locale -a | grep en_US.

It hasn't generated properly (fb620d509887f1a7298c3e5ff312401a). locale -a|grep en_US outputs en_US and en_US.utf8

@professorfish: Interesting. You could try this to avoid the iban.cjam file: LANG=en_US cjam <(LANG=en_US cjam gen.cjam) <<< GB82WEST12345698765432. I've included an ASCII-only version in my answer that should be easier to verify.

Bash, 738 519 444 434 427
Here's something to start us off, I wrote it (and saved 317 characters, mostly in the country code storage bit) while the question was in the sandbox. Let me know if there are any issues.
The function reads from stdin, which is quite common in Bash (the question says "accepts a string of alphanumeric characters", it doesn't require this to be via arguments).
It returns 0 if the IBAN is valid and a non-zero value if it is invalid.
An IBAN containing any characters other than the delimiters . - and A-Z0-9 is invalid
t=return
v=`tr -d .\ -`
[ "`tr -dc A-Z0-9<<<$v`" = $v ]||$t
((${#v}>9))||$t
r=`grep -oE "[0-9]+[A-Z]{2}*${v:0:2}"<<<15NO16BEBI18DKFIFOGLNL19MKSI20ATBAEEKZLTLU21CHCRHRLILV22BGBHDEGBGEIEMERS23AEGIIL24ADCZDZESMDPKROSASESKTNVG25AOCVMZPT26IRISTR27BFCMFRGRITMCMGMRSM28BJCICYDOGTHULBMLPLSNAZ29BRPSQAUA30JOKWMU31MT`
[ "${r:0:2}" = ${#v} ]||$t
v=${v:4:99}${v:0:4}
d=({A..Z})
for a in {10..35};{
v=${v//${d[a-10]}/$a}
}
$t `bc<<<$v%97-1`

Explanation
t=return # Alias return to $t
v=`tr -d .\ -` # Remove delimiters from STDIN and save to a variable $v.
# If you want the function to take the IBAN as an argument, insert <<<$1 just before the last ` in the line above
# Check that the number now contains no characters other than A-Z0-9 (i.e. if all other characters are removed, the string should remain the same because there aren't any of them)
# If not, return. By default, return uses the exit status of the previous command, which will be 1
[ "`tr -dc A-Z0-9<<<$v`" = $v ]||$t
# Check that $v is long enough to have a country code at the start, return if not
# I could have put 2 instead of 9, but the character count is the same
((${#v}>9))||$t
# give grep the country code data string, which is of the format <length1><country><country><length2><country><country><country>...
# for example, this tells you that EE has an IBAN length of 20
# grep searches for a number ([0-9]+), followed by any number including zero of country codes ([A-Z]{2}*), followed by the first two characters of the input IBAN, i.e. its country code (${v:0:2})
# -o makes grep only output the match, not the line containing it; -E enables extended regexes
# The result is saved to the variable $r
r=`grep -oE "[0-9]+[A-Z]{2}*${v:0:2}"<<<15NO16BEBI18DKFIFOGLNL19MKSI20ATBAEEKZLTLU21CHCRHRLILV22BGBHDEGBGEIEMERS23AEGIIL24ADCZDZESMDPKROSASESKTNVG25AOCVMZPT26IRISTR27BFCMFRGRITMCMGMRSM28BJCICYDOGTHULBMLPLSNAZ29BRPSQAUA30JOKWMU31MT`
# Check that the length specified by the country code, the first two chars of $r, is equal to the actual IBAN's length ${#v}. return 1 if not.
[ "${r:0:2}" = ${#v} ]||$t
v=${v:4:99}${v:0:4} # Put the first 4 chars to the back
d=({A..Z}) # Make an array of letters A to Z
# Loop for each number from 10 to 35
for a in {10..35};{
# in the IBAN, replace letters A to Z by the corresponding number from 10 to 35
v=${v//${d[a-10]}/$a}
}
# $v is now an integer
# note: I used bc here because Bash's built-in arithmetic couldn't handle big numbers
# find the remainder of dividing $v by 97, subtract 1, and return the value
# if the remainder is 1, then the IBAN is valid and 1-1=0 is returned.
$t `bc<<<$v%97-1`

Examples
ibanfn<<<'-GB82-WEST-1234 5698.7654.32    ' #returns 0, valid
ibanfn<<<'-GB82-WEST-1234 5698.7654.33    ' #returns 27, invalid, fails remainder test
ibanfn<<<'GB82 WEST 1234 5698 7654 32a'     #returns 1, invalid, contains invalid character a
ibanfn<<<'YY82 WEST 1234 5698 7654 32'      #returns 1, invalid, country code does not exist
ibanfn<<<'GB82 WEST 1234 5698 7654 3210'    #returns 1, invalid, wrong length

Python 3 - (483 - 25%) 362
import re
def c(i):
 i=re.sub('\W','',i);q,s='NOBEBIDKFOFIGLNLMKSIATBAEEKZLTLUCRHRLVLICHBHBGGEDEIEMERSGBGIILAEADCZMDPKROSASKESSETNVGDZPTAOCVMZISTRIRFRGRITMRMCSMBFCMMGALAZCYDOGTHULBPLBJCIMLSNBRPSQAUAJOKWMUMT',i
 for m in b" !!#####$$%%%%%%&&&&&''''''''((())))))))))))****+++,,,,,,,,,------------....///0":
  if(i[:2],len(i)+17)==(q[:2],m):
   i=i[4:]+i[:4]
   for z in range(26):i=re.sub(chr(65+z),str(z+10),i)
   return(int(i)%97==1)and re.findall('.{,4}',s)or 0
  q=q[2:]
 return 0

WT?? - that's some golfing! Nice work. It looks a bit like line noise from a distance ... j/k besides it's a complement ;-)

Perl 6 - 354 chars - (not sure of bonus)
my $r = slurp 'ir';
my @cs = $r.comb(/(\D)+/);my @ns = $r.comb(/(\d)+/);
my %h;
for @ns Z @cs -> $n, $c {%h{$n}=[$c.comb(/\w**2/)]};
for my @ =lines() {
 my $o=$_;
 my $y=$_.substr(0,2);
 $_=s:g/\s|\-|\.//.uc.comb.rotate(4).join;
 my $l=$_.chars ;
 $_.=trans(['A'..'Z'] => ['10'..'35']);
 next if $y !~~ %h{$l}.any;
 say $_%97==1??"$o ok"!!"Invalid";
}

Reading input from IBANS.txt on STDIN and slurping the rules from the file ir (I left the rules out of the total in case they were boilerplate - the rules file is 191 characters so the total would be 545.
 perl6 ibanvalidate.p6 IBANS.txt

IBANS.txt is as follows:
GB82 WEST 1234 5698 7654 32
GB82-WEST-1234-5698-7654-32
gb82-west-1234-5698-7654-32
GB82WEST12345698765432
GB82.WEST.1234.5698.7654.32
GR16 0110 1250 0000 0001 2300 695
GB82 WEST 1234 5698 7654 31
NL82 WEST 1234 5698 7654 32
GB29 NWBK 6016 1331 9268 19
Whee perl6
CANADA 000 Banks 007 911

Notes

validates country code and length and outputs as below
Character count from: wc -m ibanvalidate.p6
Currently not much error checking validation of input is done.
Whitespace is signficant in Perl6 (or more significant than Perl 5) so is counted.

Typical output:
GB82 WEST 1234 5698 7654 32 ok
GB82-WEST-1234-5698-7654-32 ok
GB82WEST12345698765432 ok
GB82.WEST.1234.5698.7654.32 ok
GR16 0110 1250 0000 0001 2300 695 ok
Invalid
GB29 NWBK 6016 1331 9268 19 ok

This is not typical Perl6 code (especially the comb - lines a friendly and influential Perl developper mentioned this in passing): I'm a beginner. Once the contest is done I will add/change and make any modifications suggested by Perl6-ers.  Thanks for playing and being nice :-)

Where's the country code checking?

@professorfish ... I did that in the wrong version of perl ;-) it will add 200+ more characters I'm sure.

Perl (356+2 * 75% = 268.5)
the code is so confusing that even SE's syntax highlighting gets lost in it :)
#!perl -ln
use bignum;s/\W//g;$_=$T=uc;$q=15;/\w/?$H{$_}=$q:$q++for'NO,BEBI,,NLGLDKFOFI,SIMK,KZEEATLTLUBA,HRCHLVCRLI,RSIEGEDEBGBHGBME,GIAEIL,SASESKESCZMDTNPKADDZVGRO,PTMZCVAO,TRISIR,CMMGMRSMITFRGRBFMC,ALAZPLCIGTHUSNCYDOBJLBML,UABRQAPS,KWMUJO,MT'=~/,|../g;/../;$q=$H{$&}==y///c;/..../;$_=$'.$&;s/[A-Z]/ord($&)-55/ge;print+(Invalid,join' ',($T=~/.{1,4}/g))[1==$_%97*$q]

Explanation
#!perl -nl

-n means read stdin line by line; -l adds newlines to print
use bignum;

required for modulo operation later to return correct value.
s/\W//g;

remove everything that's not \w from IBAN.
$_=$T=uc;

convert the iban number to upper case, also save it to $T - will be used for pretty-printing later.
$q=15;

set the temporary variable to 15, it will be used to build a hash table with country code to iban length mapping.
/\w/ ? $H{$_}=$q : $q++
for 'NO,BEBI,,NLGLDKFOFI,SIMK,KZEEATLTLUBA,HRCHLVCRLI,RSIEGEDEBGBHGBME,GIAEIL,SASESKESCZMDTNPKADDZVGRO,PTMZCVAO,TRISIR,CMMGMRSMITFRGRBFMC,ALAZPLCIGTHUSNCYDOBJLBML,UABRQAPS,KWMUJO,MT' =~ /,|../g;

split the large string into an array of commas or two-letter country codes, iterate over it.
if the element starts with a letter, it's a country code - save it in the hash with a value of $q; otherwise, a comma means to increment $q.  so, NO will get the value of 15, BE and BI will be 16, and so on.
/../;

match first two characters from IBAN (the country code)
$q=$H{$&}==y///c;

check if IBAN has correct length for the country code, save result in $q
/..../;$_=$'.$&;

move first four characters to the end of IBAN
s/[A-Z]/ord($&)-55/ge;

replace all letters with corresponding numbers, starting with A = 10
print+(Invalid,join' ',($T=~/.{1,4}/g))[1==$_%97*$q]

print either "Invalid" or the pretty-printed IBAN.  1==$_%97*$q will only equal 1 for an IBAN with a correct length and correct remainder.

nice!  In the "perl only" subcontest you win ;-) Even though it's confusing could you try explaining it a bit as in the bash example? Pretty please?!  If you explain yours I'll explain mine :-) (though I might steal one of your tricks real the IBAN lengths country first).  Cheers.

Perl 6, 311 bytes, score 233.25
{/:i^(..)<[A..Z0..9]>+$/&&'NobeBIdkfofiglNlmkSiatbaeekzltLucrhrlvliChbhbggedeiemersGbgiilAeadczmdpkrosaskessetnvgDzptaocvMzistrIrfrgritmrmcsmbfcmMgalazcydogthulbplbjcimlSnbrpsqaUajokwMumt'~~/^:i(..)*$($0)/&&.comb==$0.comb(/<:Lu>/)+15&&[.comb].rotate(4)>>.&{:36($_)}.join%97==1&&~.comb(4)||'Invalid'}o{TR/\ .-//}

Try it online!
I'm not sure

where separator characters are allowed exactly. I simply remove all of them.
whether the final formatted output should be uppercase.

Explanation
{
  /                # Match against regex
    :i             #   ignore case
    ^              #   start of string
    (..)           #   country code (stored in $0)
    <[A..Z0..9]>+  #   alphanumeric characters
    $              #   end of string
  /
  &&
  'NobeBIdk...'    # Country code string with uppercase letter
                   # for each length increase
  ~~               # match against
  /                # regex
    :i             #   ignore case
    ^              #   start of string
    (..)*          #   series of two characters (stored in $0)
    $($0)          #   country code
  /
  &&
  .comb==          # IBAN length equals
  $0.comb(/<:Lu>/) # number of uppercase characters
  +15              # plus 15
  &&
  [.comb]          # Split IBAN into characters
  .rotate(4)       # Rotate by four
  >>.&{:36($_)}    # Convert each from base-36
  .join            # Join
  %97==1           # Modulo 97 check
  &&
  ~.comb(4)        # Add space after every four characters
  ||
  'Invalid'        # Return 'Invalid' if any of the checks failed
}
o                  # Function composition
{
  TR/\ .-//        # Remove space, dot, dash
}

Python3.x (539 chars - 25% = 404.25)
(To be said first: I'm a bit confused what HAS to be counted by your rules so I just counted my whole function)
539 characters - Including import and def IBAN(i): (tabs at the beginning of the line are counted anyway in python so they don't matter)
Bonus applied as stated in the rules.
def IBAN(i):
    import re
    i=re.sub(r'[^\w]','',i).upper()
    k=len(i)
    z=i[:2]in re.search(r'%s([A-Z ]*)'%k,'15NO16BE BI18DK FO FI GL NL19MK SI20AT BA ES KZ LT LU21CR HR LV LI CH22BH BG GE DE IE MK RS GB23GI IL AE24MD PK RO SA SK ES SE TN VG DZ25CV MZ26IS TR IR FR GR IT MR MC SM BF CM MG28AL AZ CY DO GT HU LB PL BJ CI ML SN29BR PS QA UA30JO KW MU31MT').group(1)or None
    if int(''.join([c if c.isdigit()else str(ord(c)-55)for c in i[4:]+i[:4]]))%97!=1 or z is None:return('Invalid')
    return(' '.join([i[0+j:4+j]for j in range(0,k,4)]))

Code with comments (not completed yet... I'm way too tired to write the remaining part of the comments... I'll do that tomorrow)
def IBAN(i):
    import re
    # Remove all non word characters (including space) and change to uppercase
    # as0098-7*46.76A -> AS009874676A
    i=re.sub(r'[^\w]','',i).upper()
    # Get the length of it because I need it later multiple times
    k=len(i)
    #                   r'%s([A-Z ]*)'%k = Replace %s with the length of i
    #         re.search(                ,'15NO16BE BI18DK FO FI GL NL19MK SI20AT BA ES KZ LT LU21CR HR LV LI CH22BH BG GE DE IE MK RS GB23GI IL AE24MD PK RO SA SK ES SE TN VG DZ25CV MZ26IS TR IR FR GR IT MR MC SM BF CM MG28AL AZ CY DO GT HU LB PL BJ CI ML SN29BR PS QA UA30JO KW MU31MT')
    #                                    = search (with regexp) in this string (which are the lengths and countrycodes seperated by space)
    # Return the first found match (scroll to the right to see)                                                                                .group(1)
    # i[:2]in                                                                                or None
    # = The first two characters in the returned string (in the same order and same case)
    z=i[:2]in re.search(r'%s([A-Z ]*)'%k,'15NO16BE BI18DK FO FI GL NL19MK SI20AT BA ES KZ LT LU21CR HR LV LI CH22BH BG GE DE IE MK RS GB23GI IL AE24MD PK RO SA SK ES SE TN VG DZ25CV MZ26IS TR IR FR GR IT MR MC SM BF CM MG28AL AZ CY DO GT HU LB PL BJ CI ML SN29BR PS QA UA30JO KW MU31MT').group(1)or None
    if int(''.join([c if c.isdigit()else str(ord(c)-55)for c in i[4:]+i[:4]]))%97!=1 or z is None:return('Invalid')
    return(' '.join([i[0+j:4+j]for j in range(0,k,4)]))

Perl (535)
Not really golfed yet - no idea if I qualify for the bonus ;-) I will add some @professorfish type explanations.
#!perl -ln
$r="15NO16BEBI18DKFIFOGLNL19MKSI20ATBAEEKZLTLU21CHCRHRLILV22BGBHDEGBGEIEMERS23AEGIIL24ADCZDZESMDPKROSASESKTNVG25AOCVMZPT26IRISTR27BFCMFRGRITMCMGMRSM28BJCICYDOGTHULBMLPLSNAZ29BRPSQAUA30JOKWMU31MT";
$c{$1} = [unpack("(A2)*", $2)] while($r) =~/(\d{2})(\D{2,})/g;
@h{("A".."Z")}=(10..35);
chomp;$o=$_;$_=uc$_;
s/[ -.]//g;
$l=y///c;
($m)=($_=~m/^.{2}/g);
($n=$_) =~s/^(....)(.*)/$2$1/dg;
$n=~s/([A-Z])/$h{$1}/g;
print $m ~~ @{$c{$l}} ? "length valid for $m":"invalid length";
use bignum;
print $n%97==1 ? "$o ok":"$o Invalid";

JavaScript (Node.js), 372 bytes * .75 = 279
s=>(s=s[R="replace"](/[^A-Z0-9]/g,"")).length-14-"NO|BEBI||DKFOFIGLNL|MKSI|BATEEKZLTLU|CRCHRLVLI|GBHBGEDEIEMERS|GILAE|SADCZMDZPKROSASKESETNVG|PTAOCVMZ|ISTRIR|BFRGRITSMRMCMG|ALBJAZCYDOGTHUPLCIMLSN|BRPSQAUA|JOKWMU|MT".match(eval(`/.*${s.slice(0,2)}/i`))[0].split`|`.length||BigInt((s.slice(4)+s.slice(0,4))[R](/\w/g,x=>parseInt(x,36)))%97n-1n?"Invalid":s[R](/(.{4})/g,"$1 ")

Try it online!
Test cases borrowed from @marinus 's J answer.

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


text:
Recursive Mathematical Puzzle from a high school contest
The problem appeared on the 2013 SJCNY High School Programming Contest. It was the last question in the set of problems and no team produced a correct answer during the 2.5 hours they had to work on it. Shortest solution that can handle the full range of inputs with a reasonable run time (say under 2 minutes on a Pentium i5) wins.
Vases
Ryan’s mom gave him a vase with a cherished inscription on it, which he often places on his
window ledge. He is moving into a high rise apartment complex and wants to make sure that if the vase falls off the ledge, it won’t break. So he plans to purchase several identical vases and drop them out of the window to determine the highest floor he can live on without the vase breaking should it fall off the window ledge. Time is short, so Ryan would like to minimize the number of drops he has to make.
Suppose that one vase was purchased and the building was 100 stories. If it was dropped out of the first floor window and broke, Ryan would live on the first floor. However if it did not break, it would have to be dropped from all subsequent floors until it broke. So the worst case minimum number of drops for one vase (V=1) and an N story building is always N drops. It turns out that if Ryan’s drop scheme is used, the worst case minimum number of drops falls off rapidly as the number of vases increases. For example, only 14 drops are required (worst case) for a 100 story building if two (V = 2) vases are used, and the worst case number of drops decreases to 9 if three vases are used.
Your task is to discover the optimum drop algorithm, and then code it into a program to
determine the minimum number of drops (worst case) given the number of vases Ryan purchased, V, and the number of floors in the building, N. Assume that if a vase is dropped and it does not break, it can be reused.
Inputs: (from a text file)
The first line of input contains the number of cases to consider. This will be followed by one line of input per case. Each line will contain two integers: the number of vases Ryan purchased, V, followed by the number of stories in the building, N. N < 1500 and V < 200
Output: (to console)
There will be one line of output per case, which will contain the minimum number of drops, worst case.
Sample Input
   5
   2 10
   2 100
   3 100
   25 900
   5 100

Sample Output  (1 for each input)
    4
    14
    9
    10
    7

This is a site for hosting contests, not really a site for discussing contests. You need some way to decide a winner. Since the puzzle is fairly well known and the optimal solution is quite simple, I suspect that the best one would be [tag:code-golf]: the shortest code wins. But in that case you need to clarify whether you require submissions to be programs which read from stdin and write to stdout or whether they can be functions or even blocks of code which assume the input in certain variables and leave  the output in others.

I will edit the question. This is a well known problem? Can you provide some references?

http://stackoverflow.com/q/3974077/573420 , http://acm.timus.ru/problem.aspx?space=1&num=1223 , http://code.google.com/codejam/contest/dashboard?c=32003#s=p2 , http://stackoverflow.com/q/4699067/573420 (ah, that's where I saw this before. I knew I remembered solving it)

Excellent. Thank you for the reference. I would say that the problem with 2 vases (or cats or eggs) is well known, but the generalization is less common. In any case, you gave a nice solution on SO. It looks like all solutions I've seen followed by solution path of first computing the maximal floor for a given number of vases and drops.

I think the answer is the regular r-polytopic number, where n=vases and r=drops, with the lowest r, whose value is greater than the number of floors. http://mathworld.wolfram.com/FigurateNumber.html

I solved this in excel, as my work machine doesn't have any languages on it. obviously the input/output part doesn't quite match the question... so psuedocode answer :
Setup
Array Heights[200][1500]

for v = 1 to 200
  Heights[v][1] = 1
for d = 1 to 1500
  Heights[1][d] = d
for d = 2 to 200
  for d = 2 to 1500
    Heights[v][d] = Heights[v-1][d-1] + Heights[v][d-1] + 1

'Heights' now contains all the answers within range. (sort of)
Solutions
for each input (V,N) :
d = 1
while (d <= 1500) and (Heights[V][d] < N)
  d++
print d

A few notes:

if speed is vital the search in the 'solution' part can be replaced with a binary search
because of the 1500 limit on floors, you never need to consider more than 11 vases. (in fact if V > log2(N+1), then answer is just round up log2(N+1) )  ((ie binary vase drop search))
There is slight ambiguity in the question regarding the first floor. It says 'if it breaks on the 1st floor, he will live on the 1st floor' which leads to 'if it breaks on the 2nd floor, he will live on the 1st floor regardless of whether or not it breaks on the 1st'...

source: Stack Exchange

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

sort: votes


text:
place vials in your centrifuge
This question originates in this reddit thread by reddit user taho_teg but it is expanded to a more general 'puzzle'.
You have a centrifuge with 24 holes for the vials uniformly distributed in a circle around the central axis. If you now have a number of vials and you want to start the centrifuge, you need to make sure that they are placed in a balanced manner. The only numbers of vials you cannot balance are 1 and 23. You can for example balance 4 obviously, but you can also balance 5 by making a 'triangle' with 3 vials and placing the other two on two opposite sites.
Goal
You have to write a program that accepts the number of holes (that are uniformly distributed in a circle around the rotating axis) of your centrifuge as input, and that outputs a list of numbers of vials that cannot be balanced in the centrifuge.
You have to do the calculation and cannot just hardcode the precomputed solutions.
Input and output have to be implemented in a way so that the program code does not have to be changed for calling the program for different inputs. It is also acceptable to write a function (or a similar construct in your language) that can be called via a console.
Be also aware that if you have 6 holes in your centrifuge, you can centrifuge 2 and 3 vials, but you cannot balance 5 since the 'triangle' and the opposite two will overlap at one point. Another example would be for n=15 you cannot balance 11 vials, you can balance 6 and 5 vials, but the combination of those solutions will overlap (this is of course not yet the criterion that it is impossible to do so).
Update
It seems some people did not understand the given example, so I made a graphic here. PLEASE write a short description of how your algorithm works as well as some example outputs for verification. Please include following examples:
n = 1, 6, 10, 24, 63, 100 = 10^2, 163 (prime), 40320 = 8!, 65536=2^2^2^2^2, 105953 (prime)

Note that 40320 and 65536 will produce huge lists, it will perhaps be a good idea to only indicate the length of those lists.
If you know some interesting numbers to add to that list please let me know!
The algorithm should work at least up to n = 1'000'000.

Example outputs:
These are some example outputs-but perhaps faulty because I just calculated them manually.
1: 1
2: 1
3: 1,2
4: 1,3
5: 1,2,3,4
6: 1,5
7: 1,2,3,4,5,6
8: 1,3,5,7
9: 1,2,4,5,7,8
10:1,3,7,9
11:1,2,3,4,5,6,7,8,9,10
12:1,11
13:1,2,3,4,5,6,7,8,9,10,11,12
14:1,3,5,9,11,13
15:1,2,4,7,8,11,13,14

Hint
If you have a centrifuge with n holes, and you cannot balance e.g. 6 vials, you will also not be able to blance n-6 vials - it is basically the same task to balance m vials on an empty centrifuge or to balance a filled centrifuge by taking away m vials. So you if you have the number m in your list you will also have to include n-m.

Shouldn't we need to have the vials evenly spaced to be balanced? I fail to see how the 5 vials in 24 holes example satisfies this. One "half" of the centrifuge will have more vials than the other half. That sounds like the definition of unbalanced to me.

@Thorn Ignore the 2 vials and concentrate on the 3 vials in an (equilateral) triangle. You have 1 vial at 0 degrees, one at 120 degrees, and one at 240 degrees. So yes, you have one vial at the top (at vertical distance R from the axle) and two at the bottom, but the bottom ones are at vertical distance R/2 from the axle (and horizontal distance R*sqrt(3)/2) So being an equilateral triangle it all balances. (Then you can add your other 2 vials at 90 degrees and 270 degrees.)

That still sounds unbalanced. Lets represent it like this:

@steveverrill That still sounds unbalanced. Lets represent it like this:     10000000 10000000 10000000 (spaces just added for readability). 1 = occupied space with vial, 0=empty. Clearly 3 vials in 24 slots is balanced. If we add two vials to this configuration, we are not balanced. Adding a vial at 90 degrees and 270 gives us this: 10001000 10000000 10001000. We can draw a line of symmetry and see that it divides the centrifuge into two parts of unequal weight. The first half of the bits contain 3 vases while the second half contain 2.

I think that by "balanced" what is meant is that the centre of mass of the vials is vertically above or below the centre of mass of the centrifuge.

@Thorn you need to think in two dimensions, not one. The coordinates of the first 3 vials are (0,1), (-sqrt(3)/2,-1/2) and (+sqrt(3)/2,-1/2.) The 5 vial arrangement is not symmetric (apart from possibly a mirror plane) but it is balanced. It's quite common for car wheels to have different numbers of spokes and wheelnuts (again, not symmetrical, but fully balanced because the spokes form a balanced set and the nuts form a balanced set.) Google 7 spoke wheel and have a look.

I don't understand what you mean by "You have to do the calculation and cannot just hardcode the precomputed solutions." Does the code actually have to try every possibility to output a number it claims is impossible?

Is there an expected range for the number of holes?  You gave the example of 24, but should our programs also work with 1023 holes?  Some methods would be unpractical for higher numbers of holes.

@xnor No you do not have to try every possible output, you can use basic number theory for eliminating many possibilities.

@JeffSB I updated it, I think at up to at least one million is reasonable.

@Thorn I included the example I provided as a graphic.

The center of gravity definition of "balanced" makes it perfectly clear. But the graphic is a nice touch.

“The algorithm should work at least up to n = 1'000'000.” Just to be sure: Did you really mean the algorithm or did you mean the program? My algorithm works as well for n = 1.000.000 as it does for n = 10. The program however, has some issues.

63 is not a prime number

@steveverrill I still don't get the 'balanced' think. Googling 7 spike wheel all I find is perfectly simmetric and balanced. Nothin to do with out 24 holes examples.

Nexus and Wrzlprmft, thank you for reporting those errorss. @edc65 did you look at the image? (I am not refering to the 7 spike wheel, I know nothing about it) The key is that if you have two solutions where the center of mass is right on the rotating axis, you can combine them (as long as you do nto get 'overlaps' - two vials in the same hole) and even though this comibination is not symmetric, it can still be balanced.

@edc65. balanced != symmetrical... so long as you break your vials into sub-groups, where each sub-group is in a symmetrical state, then the sum outward force of all sub-groups will be in a balanced state.

Can you add a more formal definition of "balanced" to the question? Based on the discussion here, it sounds like it means "center of mass is in the center". If that's correct, this definition would actually be a whole lot easier and clearer than what you have with all the examples and figures.

@RetoKoradi Yes that's correct. (Assuming all vials have the same mass.) I originally thought that was the intuitively the first thing you might think of, but some people did not agree as far as I remember!

Sage – 102 104/115
Why use number theory, when there is brute force?
v=lambda n:[j for j in range(n+1)if all(sum(e^(i*2*I*pi/n)for i in c)for c in Combinations(range(n),j))]

For a given number of vials, this goes over all ways to position the vials and calculates their center of mass by using complex arithmetics. If the center of mass is zero for none of these ways, the number is returned.
Unfortunately, this does not work in certain cases (10,14), because Sage fails to simplify some expressions to zero (which may be related to this bug). One could regard this as a flaw of the interpreter and not the program and still say that the algorithm and program are fine.
The following 113-character alternative relies on floats instead of symbols and does not suffer from these problems:
v=lambda n:[j for j in range(n+1)if all(abs(sum(exp(i*2j*pi/n)for i in c))>1e-9for c in Combinations(range(n),j))]

Test output of the 113-character version (for n in range(14): print n,v(n)):
0 []
1 [1]
2 [1]
3 [1, 2]
4 [1, 3]
5 [1, 2, 3, 4]
6 [1, 5]
7 [1, 2, 3, 4, 5, 6]
8 [1, 3, 5, 7]
9 [1, 2, 4, 5, 7, 8]
10 [1, 3, 7, 9]
11 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
12 [1, 11]
13 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
14 [1, 3, 5, 9, 11, 13]

I did not want to wait the runtime for higher n.

This originates from the following Python solution. Exact arithmetics and not having to import some modules is quite something.
Python – 173 154 156
from itertools import*
from cmath import*
v=lambda n:[j for j in range(n+1)if all(abs(sum(exp(i*2j*pi/n)for i in c))>1e-9for c in combinations(range(n),j))]

Test output of this variant (for n in range(24): print n,v(n)):
0 []
1 [1]
2 [1]
3 [1, 2]
4 [1, 3]
5 [1, 2, 3, 4]
6 [1, 5]
7 [1, 2, 3, 4, 5, 6]
8 [1, 3, 5, 7]
9 [1, 2, 4, 5, 7, 8]
10 [1, 3, 7, 9]
11 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
12 [1, 11]
13 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
14 [1, 3, 5, 9, 11, 13]
15 [1, 2, 4, 7, 8, 11, 13, 14]
16 [1, 3, 5, 7, 9, 11, 13, 15]
17 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
18 [1, 17]
19 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
20 [1, 3, 17, 19]
21 [1, 2, 4, 5, 8, 10, 11, 13, 16, 17, 19, 20]
22 [1, 3, 5, 7, 9, 13, 15, 17, 19, 21]
23 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]
24 [1, 23]

I did not want to wait the runtime for higher n.

I like the idea of using the complex unit roots! Could you please show some example outputs just for verification? I posted some suggestions.

Lua - 197
A non brute force method, it creates a list of factors and rules them out. It also rules out numbers that can be gotten with the addition of those factors as long as the greatest factor used is less than the amount of unfilled holes. One is always printed and isn't used in the algorithm.
i=io.read("*n")f={}print(1)for z=2,i do
x=z
if i%x<1 then
table.insert(f,1,x)end
for q=1,#f do
y=f[q]x=x*math.min(1,z%y)while x>=y and x-1~=y and y<=i-z do x=x-y end
end
if x>0 then print(z)end
end

Example output: (some put as ranges so I don't exceed the character limit)
1: 1

6: 1,5

10:1,3,7,9

24:1,23

63:1,2,4,5,8,11,13,17,20,22,23,25,26,29,32,34,38,41,44,47,50,53,58,59,61,62

100:1,3,13,23,33,43,53,63,73,83,93,97,99

163:1-162

40320:1,11,13,17,19,29,31,37,41,43,61,71,73,97,113,121,127,139,157,169,179,181,191,193,209,211,221,223,241,251,253,263,269,271,277,281,289,299,307,313,331,337,347,349,353,361,373,377,379,397,401,403,409,421,431,433,437,439,449,461,467,473,479,481,491,493,499,517,521,523,529,533,541,547,571,577,587,589,593,601,607,613,617,619,631,641,653,659,671,673,683,689,691,697,701,703,709,713,731,733,737,739,751,757,761,769,781,793,811,817,841,851,853,857,859,869,871,877,881,883,907,913,929,937,953,961,971,977,979,989,991,997,1003,1009,1019,1021,1027,1033,1037,1039,1049,1051,1069,1073,1079,1081,1093,1121,1133,1139,1151,1153,1163,1171,1177,1181,1189,1193,1201,1213,1217,1223,1237,1243,1249,1261,1271,1273,1277,1279,1289,1291,1297,1301,1303,1321,1331,1333,1357,1361,1363,1369,1373,1381,1387,1409,1417,1429,1441,1451,1453,1457,1459,1469,1471,1481,1483,1489,1501,1511,1513,1531,1537,1553,1567,1579,1597,1601,1609,1619,1621,1633,1643,1649,1651,1661,1663,1681,1691,1693,1697,1699,1709,1711,1717,1721,1723,1741,1751,1753,1777,1793,1801,1807,1819,1837,1849,1859,1861,1871,1873,1889,1891,1901,1903,1921,1931,1933,1937,1949,1951,1957,1961,1963,1969,1991,1993,2011,2017,2027,2029,2033,2041,2047,2053,2057,2059,2077,2081,2087,2089,2101,2113,2129,2137,2143,2161,2171,2173,2197,2207,2209,2221,2227,2237,2239,2251,2257,2269,2273,2281,2297,2311,2321,2353,2369,2381,2419,2431,2449,2461,2477,2491,2503,2509,2521,2531,2533,2537,2539,2549,2551,2557,2561,2563,2581,2591,2593,2617,2633,2641,2647,2659,2677,2689,2699,2701,2707,2713,2717,2719,2729,2731,2749,2753,2759,2761,2773,2801,2809,2827,2833,2843,2857,2867,2869,2879,2881,2893,2897,2899,2909,2911,2917,2921,2923,2929,2941,2951,2953,2971,2977,2993,3001,3007,3019,3037,3041,3049,3061,3071,3083,3089,3091,3103,3121,3131,3133,3149,3151,3161,3169,3179,3181,3187,3193,3211,3217,3229,3233,3251,3253,3257,3259,3277,3281,3289,3293,3301,3313,3317,3319,3329,3341,3347,3359,3361,3371,3373,3377,3379,3389,3391,3397,3401,3403,3421,3431,3433,3457,3473,3481,3487,3499,3517,3529,3539,3541,3551,3553,3569,3571,3581,3583,3601,3611,3613,3623,3629,3631,3637,3641,3649,3659,3667,3673,3691,3697,3707,3709,3713,3721,3733,3737,3739,3757,3761,3763,3769,3781,3791,3793,3797,3799,3809,3821,3827,3833,3839,3841,3851,3853,3859,3877,3881,3883,3889,3893,3901,3907,3931,3937,3947,3949,3953,3961,3967,3973,3977,3979,3991,4001,4013,4019,4031,4033,4043,4049,4051,4057,4061,4063,4069,4073,4093,4097,4103,4117,4129,4153,4159,4171,4177,4187,4189,4201,4211,4213,4223,4237,4241,4243,4253,4267,4273,4283,4297,4301,4303,4309,4313,4321,4331,4337,4339,4363,4369,4379,4381,4387,4393,4409,4411,4427,4429,4433,4441,4447,4453,4463,4469,4471,4477,4481,4493,4499,4511,4513,4517,4523,4537,4541,4553,4561,4577,4601,4607,4609,4619,4621,4637,4649,4661,4673,4691,4703,4717,4721,4733,4751,4757,4769,4787,4793,4801,4811,4813,4817,4829,4841,4853,4859,4877,4883,4889,4897,4901,4913,4919,4939,4957,4961,4973,4979,4997,5003,5009,5017,5021,5027,5041,5051,5053,5057,5059,5069,5071,5077,5081,5083,5101,5111,5113,5137,5153,5161,5167,5179,5197,5209,5219,5221,5231,5233,5249,5251,5261,5263,5281,5291,5293,5303,5309,5311,5317,5321,5329,5339,5347,5353,5371,5377,5387,5389,5393,5401,5413,5417,5419,5437,5441,5443,5449,5461,5471,5473,5477,5479,5489,5501,5507,5513,5519,5521,5531,5533,5539,5557,5561,5563,5569,5573,5581,5587,5611,5617,5627,5629,5633,5641,5647,5653,5657,5659,5671,5681,5693,5699,5711,5713,5723,5729,5731,5737,5741,5743,5749,5753,5771,5773,5777,5779,5791,5797,5801,5809,5821,5833,5851,5857,5881,5899,5917,5921,5939,5941,5951,5953,5963,5969,5981,5983,6001,6011,6023,6029,6031,6037,6049,6059,6061,6067,6073,6091,6107,6109,6113,6121,6131,6133,6137,6157,6161,6163,6169,6173,6191,6193,6197,6199,6221,6227,6233,6239,6241,6253,6257,6259,6277,6281,6283,6289,6301,6313,6331,6337,6347,6353,6361,6367,6373,6379,6401,6413,6431,6443,6449,6451,6457,6463,6469,6473,6481,6491,6493,6497,6499,6509,6511,6521,6523,6529,6541,6551,6553,6571,6577,6593,6611,6613,6617,6619,6631,6637,6641,6649,6667,6673,6689,6697,6721,6731,6733,6737,6739,6749,6751,6757,6761,6763,6781,6791,6793,6817,6833,6841,6847,6859,6877,6889,6899,6901,6911,6913,6929,6931,6941,6943,6961,6971,6973,6983,6989,6991,6997,7001,7009,7019,7027,7033,7051,7057,7067,7069,7073,7081,7093,7097,7099,7117,7121,7123,7129,7141,7151,7153,7157,7159,7169,7181,7187,7193,7199,7201,7211,7213,7219,7237,7241,7243,7249,7253,7261,7267,7291,7297,7307,7309,7313,7321,7327,7333,7337,7339,7351,7361,7373,7379,7391,7393,7403,7409,7411,7417,7421,7423,7429,7433,7451,7453,7457,7459,7471,7477,7481,7489,7501,7513,7531,7537,7561,7571,7573,7577,7579,7589,7591,7597,7601,7603,7627,7633,7649,7657,7673,7681,7691,7697,7699,7709,7711,7717,7723,7729,7739,7741,7747,7753,7757,7759,7769,7771,7789,7793,7799,7801,7813,7841,7853,7859,7871,7873,7883,7891,7897,7901,7909,7913,7921,7933,7937,7943,7957,7963,7969,7981,7991,7993,7997,7999,8009,8011,8017,8021,8023,8041,8051,8053,8077,8081,8083,8089,8093,8101,8107,8129,8137,8149,8161,8177,8191,8203,8209,8219,8221,8233,8243,8257,8269,8273,8287,8299,8317,8327,8329,8333,8341,8353,8363,8369,8371,8377,8401,8411,8413,8417,8419,8437,8441,8443,8459,8461,8467,8473,8479,8497,8501,8503,8509,8513,8531,8537,8543,8557,8563,8569,8579,8581,8587,8593,8597,8599,8609,8611,8641,8651,8653,8657,8669,8671,8677,8681,8683,8689,8717,8723,8737,8747,8749,8753,8761,8767,8773,8777,8779,8797,8801,8803,8809,8821,8833,8849,8857,8881,8917,8921,8923,8929,8933,8941,8947,8971,8977,8989,8993,9001,9017,9041,9043,9049,9053,9061,9067,9073,9083,9089,9091,9097,9101,9103,9109,9113,9133,9137,9143,9157,9169,9197,9203,9209,9217,9227,9229,9241,9253,9257,9259,9277,9281,9287,9301,9307,9313,9337,9341,9343,9349,9353,9361,9367,9389,9397,9409,9419,9421,9427,9433,9437,9439,9449,9451,9469,9473,9479,9481,9493,9517,9521,9523,9529,9533,9547,9553,9577,9589,9601,9617,9631,9643,9649,9659,9661,9673,9683,9697,9707,9713,9727,9739,9757,9761,9763,9769,9773,9781,9787,9809,9817,9829,9841,9857,9871,9883,9889,9899,9901,9913,9923,9937,9949,9953,9967,9979,9997,10001,10009,10013,10021,10027,10033,10049,10057,10069,10081,10091,10093,10097,10099,10109,10111,10117,10121,10123,10141,10151,10153,10177,10193,10201,10207,10219,10237,10249,10259,10261,10271,10273,10289,10291,10301,10303,10321,10331,10333,10343,10349,10351,10357,10361,10369,10379,10387,10393,10411,10417,10427,10429,10433,10441,10453,10457,10459,10477,10481,10483,10489,10501,10511,10513,10517,10519,10529,10541,10547,10553,10559,10561,10571,10573,10579,10597,10601,10603,10609,10613,10621,10627,10651,10657,10667,10669,10673,10681,10687,10693,10697,10699,10711,10721,10733,10739,10751,10753,10763,10769,10771,10777,10781,10783,10789,10793,10811,10813,10817,10819,10831,10837,10841,10849,10861,10873,10891,10897,10921,10931,10933,10937,10939,10949,10951,10957,10961,10963,10987,10993,11009,11017,11033,11041,11051,11057,11059,11069,11071,11077,11083,11089,11099,11101,11107,11113,11117,11119,11129,11131,11149,11153,11159,11161,11173,11201,11213,11219,11231,11233,11243,11251,11257,11261,11269,11273,11281,11293,11297,11303,11317,11323,11329,11341,11351,11353,11357,11359,11369,11371,11377,11381,11383,11401,11411,11413,11437,11441,11443,11449,11453,11461,11467,11489,11497,11509,11521,11531,11533,11537,11539,11549,11551,11561,11563,11569,11581,11591,11593,11611,11617,11633,11647,11659,11677,11681,11689,11699,11701,11713,11723,11729,11731,11741,11743,11761,11771,11773,11777,11779,11789,11791,11797,11801,11803,11821,11831,11833,11857,11873,11881,11887,11899,11917,11929,11939,11941,11951,11953,11969,11971,11981,11983,12001,12011,12013,12017,12029,12031,12037,12041,12043,12049,12071,12073,12091,12097,12107,12109,12113,12121,12127,12133,12137,12139,12157,12161,12167,12169,12181,12193,12209,12217,12223,12241,12251,12253,12277,12287,12289,12301,12307,12317,12319,12331,12337,12349,12353,12361,12377,12391,12401,12433,12449,12461,12499,12511,12529,12541,12557,12571,12583,12589,12601,12611,12613,12617,12619,12629,12631,12637,12641,12643,12661,12671,12673,12697,12713,12721,12727,12739,12757,12769,12779,12781,12787,12793,12797,12799,12809,12811,12829,12833,12839,12841,12853,12881,12889,12907,12913,12923,12937,12947,12949,12959,12961,12973,12977,12979,12989,12991,12997,13001,13003,13009,13021,13031,13033,13051,13057,13073,13081,13087,13099,13117,13121,13129,13141,13151,13163,13169,13171,13183,13201,13211,13213,13229,13231,13241,13249,13259,13261,13267,13273,13291,13297,13309,13313,13331,13333,13337,13339,13357,13361,13369,13373,13381,13393,13397,13399,13409,13421,13427,13439,13441,13451,13453,13457,13459,13469,13471,13477,13481,13483,13501,13511,13513,13537,13553,13561,13567,13579,13597,13609,13619,13621,13631,13633,13649,13651,13661,13663,13681,13691,13693,13703,13709,13711,13717,13721,13729,13739,13747,13753,13771,13777,13787,13789,13793,13801,13813,13817,13819,13837,13841,13843,13849,13861,13871,13873,13877,13879,13889,13901,13907,13913,13919,13921,13931,13933,13939,13957,13961,13963,13969,13973,13981,13987,14011,14017,14027,14029,14033,14041,14047,14053,14057,14059,14071,14081,14093,14099,14111,14113,14123,14129,14131,14137,14141,14143,14149,14153,14171,14173,14177,14179,14191,14197,14201,14209,14221,14233,14251,14257,14281,14291,14293,14297,14299,14309,14311,14317,14321,14323,14347,14353,14369,14377,14393,14401,14411,14417,14419,14429,14431,14437,14443,14449,14459,14461,14467,14473,14477,14479,14489,14491,14509,14513,14519,14521,14533,14561,14573,14579,14591,14593,14603,14611,14617,14621,14629,14633,14641,14653,14657,14663,14677,14683,14689,14701,14711,14713,14717,14719,14729,14731,14737,14741,14743,14761,14771,14773,14797,14801,14803,14809,14813,14821,14827,14849,14857,14869,14881,14891,14893,14897,14899,14909,14911,14921,14923,14929,14941,14951,14953,14971,14977,14993,15007,15019,15037,15041,15049,15059,15061,15073,15083,15089,15091,15101,15103,15121,15131,15133,15137,15139,15149,15151,15157,15161,15163,15181,15191,15193,15217,15233,15241,15247,15259,15277,15289,15299,15301,15311,15313,15329,15331,15341,15343,15361,15371,15373,15377,15389,15391,15397,15401,15403,15409,15431,15433,15451,15457,15467,15469,15473,15481,15487,15493,15497,15499,15517,15521,15527,15529,15541,15553,15569,15577,15583,15601,15611,15613,15637,15647,15649,15661,15667,15677,15679,15691,15697,15709,15713,15721,15737,15751,15761,15793,15809,15821,15859,15871,15889,15901,15917,15931,15943,15949,15961,15971,15973,15977,15979,15989,15991,15997,16001,16003,16021,16031,16033,16057,16073,16081,16087,16099,16117,16129,16139,16141,16147,16153,16157,16159,16169,16171,16189,16193,16199,16201,16213,16241,16249,16267,16273,16283,16297,16307,16309,16319,16321,16333,16337,16339,16349,16351,16357,16361,16363,16369,16381,16391,16393,16411,16417,16433,16441,16447,16459,16477,16481,16489,16501,16511,16523,16529,16531,16543,16561,16571,16573,16589,16591,16601,16609,16619,16621,16627,16633,16651,16657,16669,16673,16691,16693,16697,16699,16717,16721,16729,16733,16741,16753,16757,16759,16769,16781,16787,16799,16801,16811,16813,16817,16819,16829,16831,16837,16841,16843,16861,16871,16873,16897,16913,16921,16927,16939,16957,16969,16979,16981,16991,16993,17009,17011,17021,17023,17041,17051,17053,17063,17069,17071,17077,17081,17089,17099,17107,17113,17131,17137,17147,17149,17153,17161,17173,17177,17179,17197,17201,17203,17209,17221,17231,17233,17237,17239,17249,17261,17267,17273,17279,17281,17291,17293,17299,17317,17321,17323,17329,17333,17341,17347,17371,17377,17387,17389,17393,17401,17407,17413,17417,17419,17431,17441,17453,17459,17471,17473,17483,17489,17491,17497,17501,17503,17509,17513,17533,17537,17543,17557,17569,17593,17599,17611,17617,17627,17629,17641,17651,17653,17663,17677,17681,17683,17693,17707,17713,17723,17737,17741,17743,17749,17753,17761,17771,17777,17779,17803,17809,17819,17821,17827,17833,17849,17851,17867,17869,17873,17881,17887,17893,17903,17909,17911,17917,17921,17933,17939,17951,17953,17957,17963,17977,17981,17993,18001,18017,18041,18047,18049,18059,18061,18077,18089,18101,18113,18131,18143,18157,18161,18173,18191,18197,18209,18227,18233,18241,18251,18253,18257,18269,18281,18293,18299,18317,18323,18329,18337,18341,18353,18359,18379,18397,18401,18413,18419,18437,18443,18449,18457,18461,18467,18481,18491,18493,18497,18499,18509,18511,18517,18521,18523,18541,18551,18553,18577,18593,18601,18607,18619,18637,18649,18659,18661,18671,18673,18689,18691,18701,18703,18721,18731,18733,18743,18749,18751,18757,18761,18769,18779,18787,18793,18811,18817,18827,18829,18833,18841,18853,18857,18859,18877,18881,18883,18889,18901,18911,18913,18917,18919,18929,18941,18947,18953,18959,18961,18971,18973,18979,18997,19001,19003,19009,19013,19021,19027,19051,19057,19067,19069,19073,19081,19087,19093,19097,19099,19111,19121,19133,19139,19151,19153,19163,19169,19171,19177,19181,19183,19189,19193,19211,19213,19217,19219,19231,19237,19241,19249,19261,19273,19291,19297,19321,19339,19357,19361,19379,19381,19391,19393,19403,19409,19421,19423,19441,19451,19463,19469,19471,19477,19489,19499,19501,19507,19513,19531,19547,19549,19553,19561,19571,19573,19577,19597,19601,19603,19609,19613,19631,19633,19637,19639,19661,19667,19673,19679,19681,19693,19697,19699,19717,19721,19723,19729,19741,19753,19771,19777,19787,19793,19801,19807,19813,19819,19841,19853,19871,19883,19889,19891,19897,19903,19909,19913,19921,19931,19933,19937,19939,19949,19951,19961,19963,19969,19981,19991,19993,20011,20017,20033,20051,20053,20057,20059,20071,20077,20081,20089,20107,20113,20129,20137,20161,20171,20173,20177,20179,20189,20191,20197,20201,20203,20221,20231,20233,20257,20273,20281,20287,20299,20317,20329,20339,20341,20351,20353,20369,20371,20381,20383,20401,20411,20413,20423,20429,20431,20437,20441,20449,20459,20467,20473,20491,20497,20507,20509,20513,20521,20533,20537,20539,20557,20561,20563,20569,20581,20591,20593,20597,20599,20609,20621,20627,20633,20639,20641,20651,20653,20659,20677,20681,20683,20689,20693,20701,20707,20731,20737,20747,20749,20753,20761,20767,20773,20777,20779,20791,20801,20813,20819,20831,20833,20843,20849,20851,20857,20861,20863,20869,20873,20891,20893,20897,20899,20911,20917,20921,20929,20941,20953,20971,20977,21001,21011,21013,21017,21019,21029,21031,21037,21041,21043,21067,21073,21089,21097,21113,21121,21131,21137,21139,21149,21151,21157,21163,21169,21179,21181,21187,21193,21197,21199,21209,21211,21229,21233,21239,21241,21253,21281,21293,21299,21311,21313,21323,21331,21337,21341,21349,21353,21361,21373,21377,21383,21397,21403,21409,21421,21431,21433,21437,21439,21449,21451,21457,21461,21463,21481,21491,21493,21517,21521,21523,21529,21533,21541,21547,21569,21577,21589,21601,21617,21631,21643,21649,21659,21661,21673,21683,21697,21709,21713,21727,21739,21757,21767,21769,21773,21781,21793,21803,21809,21811,21817,21841,21851,21853,21857,21859,21877,21881,21883,21899,21901,21907,21913,21919,21937,21941,21943,21949,21953,21971,21977,21983,21997,22003,22009,22019,22021,22027,22033,22037,22039,22049,22051,22081,22091,22093,22097,22109,22111,22117,22121,22123,22129,22157,22163,22177,22187,22189,22193,22201,22207,22213,22217,22219,22237,22241,22243,22249,22261,22273,22289,22297,22321,22357,22361,22363,22369,22373,22381,22387,22411,22417,22429,22433,22441,22457,22481,22483,22489,22493,22501,22507,22513,22523,22529,22531,22537,22541,22543,22549,22553,22573,22577,22583,22597,22609,22637,22643,22649,22657,22667,22669,22681,22693,22697,22699,22717,22721,22727,22741,22747,22753,22777,22781,22783,22789,22793,22801,22807,22829,22837,22849,22859,22861,22867,22873,22877,22879,22889,22891,22909,22913,22919,22921,22933,22957,22961,22963,22969,22973,22987,22993,23017,23029,23041,23057,23071,23083,23089,23099,23101,23113,23123,23137,23147,23153,23167,23179,23197,23201,23203,23209,23213,23221,23227,23249,23257,23269,23281,23297,23311,23323,23329,23339,23341,23353,23363,23377,23389,23393,23407,23419,23437,23441,23449,23453,23461,23467,23473,23489,23497,23509,23521,23531,23533,23537,23539,23549,23551,23557,23561,23563,23581,23591,23593,23617,23633,23641,23647,23659,23677,23689,23699,23701,23711,23713,23729,23731,23741,23743,23761,23771,23773,23783,23789,23791,23797,23801,23809,23819,23827,23833,23851,23857,23867,23869,23873,23881,23893,23897,23899,23917,23921,23923,23929,23941,23951,23953,23957,23959,23969,23981,23987,23993,23999,24001,24011,24013,24019,24037,24041,24043,24049,24053,24061,24067,24091,24097,24107,24109,24113,24121,24127,24133,24137,24139,24151,24161,24173,24179,24191,24193,24203,24209,24211,24217,24221,24223,24229,24233,24251,24253,24257,24259,24271,24277,24281,24289,24301,24313,24331,24337,24361,24371,24373,24377,24379,24389,24391,24397,24401,24403,24427,24433,24449,24457,24473,24481,24491,24497,24499,24509,24511,24517,24523,24529,24539,24541,24547,24553,24557,24559,24569,24571,24589,24593,24599,24601,24613,24641,24653,24659,24671,24673,24683,24691,24697,24701,24709,24713,24721,24733,24737,24743,24757,24763,24769,24781,24791,24793,24797,24799,24809,24811,24817,24821,24823,24841,24851,24853,24877,24881,24883,24889,24893,24901,24907,24929,24937,24949,24961,24971,24973,24977,24979,24989,24991,25001,25003,25009,25021,25031,25033,25051,25057,25073,25087,25099,25117,25121,25129,25139,25141,25153,25163,25169,25171,25181,25183,25201,25211,25213,25217,25219,25229,25231,25237,25241,25243,25261,25271,25273,25297,25313,25321,25327,25339,25357,25369,25379,25381,25391,25393,25409,25411,25421,25423,25441,25451,25453,25457,25469,25471,25477,25481,25483,25489,25511,25513,25531,25537,25547,25549,25553,25561,25567,25573,25577,25579,25597,25601,25607,25609,25621,25633,25649,25657,25663,25681,25691,25693,25717,25727,25729,25741,25747,25757,25759,25771,25777,25789,25793,25801,25817,25831,25841,25873,25889,25901,25939,25951,25969,25981,25997,26011,26023,26029,26041,26051,26053,26057,26059,26069,26071,26077,26081,26083,26101,26111,26113,26137,26153,26161,26167,26179,26197,26209,26219,26221,26227,26233,26237,26239,26249,26251,26269,26273,26279,26281,26293,26321,26329,26347,26353,26363,26377,26387,26389,26399,26401,26413,26417,26419,26429,26431,26437,26441,26443,26449,26461,26471,26473,26491,26497,26513,26521,26527,26539,26557,26561,26569,26581,26591,26603,26609,26611,26623,26641,26651,26653,26669,26671,26681,26689,26699,26701,26707,26713,26731,26737,26749,26753,26771,26773,26777,26779,26797,26801,26809,26813,26821,26833,26837,26839,26849,26861,26867,26879,26881,26891,26893,26897,26899,26909,26911,26917,26921,26923,26941,26951,26953,26977,26993,27001,27007,27019,27037,27049,27059,27061,27071,27073,27089,27091,27101,27103,27121,27131,27133,27143,27149,27151,27157,27161,27169,27179,27187,27193,27211,27217,27227,27229,27233,27241,27253,27257,27259,27277,27281,27283,27289,27301,27311,27313,27317,27319,27329,27341,27347,27353,27359,27361,27371,27373,27379,27397,27401,27403,27409,27413,27421,27427,27451,27457,27467,27469,27473,27481,27487,27493,27497,27499,27511,27521,27533,27539,27551,27553,27563,27569,27571,27577,27581,27583,27589,27593,27611,27613,27617,27619,27631,27637,27641,27649,27661,27673,27691,27697,27721,27731,27733,27737,27739,27749,27751,27757,27761,27763,27787,27793,27809,27817,27833,27841,27851,27857,27859,27869,27871,27877,27883,27889,27899,27901,27907,27913,27917,27919,27929,27931,27949,27953,27959,27961,27973,28001,28013,28019,28031,28033,28043,28051,28057,28061,28069,28073,28081,28093,28097,28103,28117,28123,28129,28141,28151,28153,28157,28159,28169,28171,28177,28181,28183,28201,28211,28213,28237,28241,28243,28249,28253,28261,28267,28289,28297,28309,28321,28337,28351,28363,28369,28379,28381,28393,28403,28417,28429,28433,28447,28459,28477,28487,28489,28493,28501,28513,28523,28529,28531,28537,28561,28571,28573,28577,28579,28597,28601,28603,28619,28621,28627,28633,28639,28657,28661,28663,28669,28673,28691,28697,28703,28717,28723,28729,28739,28741,28747,28753,28757,28759,28769,28771,28801,28811,28813,28817,28829,28831,28837,28841,28843,28849,28877,28883,28897,28907,28909,28913,28921,28927,28933,28937,28939,28957,28961,28963,28969,28981,28993,29009,29017,29041,29077,29081,29083,29089,29093,29101,29107,29131,29137,29149,29153,29161,29177,29201,29203,29209,29213,29221,29227,29233,29243,29249,29251,29257,29261,29263,29269,29273,29293,29297,29303,29317,29329,29357,29363,29369,29377,29387,29389,29401,29413,29417,29419,29437,29441,29447,29461,29467,29473,29497,29501,29503,29509,29513,29521,29527,29549,29557,29569,29579,29581,29587,29593,29597,29599,29609,29611,29629,29633,29639,29641,29653,29677,29681,29683,29689,29693,29707,29713,29737,29749,29761,29777,29791,29803,29809,29819,29821,29833,29843,29857,29867,29873,29887,29899,29917,29921,29923,29929,29933,29941,29947,29969,29977,29989,30001,30017,30031,30043,30049,30059,30061,30073,30083,30097,30109,30113,30127,30139,30157,30161,30169,30173,30181,30187,30193,30209,30217,30229,30241,30251,30253,30257,30259,30283,30299,30301,30307,30313,30323,30329,30337,30347,30349,30353,30361,30367,30383,30389,30391,30397,30413,30419,30431,30433,30449,30451,30467,30469,30473,30481,30487,30493,30497,30523,30529,30539,30547,30553,30557,30559,30571,30577,30593,30617,30623,30637,30641,30643,30649,30661,30673,30683,30689,30691,30697,30701,30703,30713,30721,30733,30743,30757,30763,30769,30803,30809,30811,30817,30823,30829,30833,30841,30859,30881,30889,30913,30923,30929,30931,30937,30941,30943,30949,30953,30973,30977,30983,30997,31009,31033,31039,31051,31057,31067,31069,31081,31091,31093,31103,31117,31121,31123,31133,31147,31153,31163,31177,31181,31183,31189,31193,31201,31211,31217,31219,31243,31249,31259,31261,31267,31273,31289,31291,31307,31309,31313,31321,31327,31333,31343,31349,31351,31357,31361,31373,31379,31391,31393,31403,31411,31417,31427,31429,31433,31441,31447,31453,31457,31459,31483,31489,31499,31501,31513,31517,31519,31529,31531,31537,31543,31553,31571,31583,31597,31601,31603,31609,31613,31621,31627,31643,31649,31651,31657,31663,31669,31673,31681,31693,31697,31723,31729,31753,31763,31769,31771,31777,31781,31783,31789,31793,31819,31837,31841,31849,31873,31883,31889,31891,31897,31901,31903,31909,31921,31931,31933,31937,31939,31949,31951,31957,31961,31963,31981,31991,31993,32017,32033,32051,32057,32063,32077,32083,32089,32093,32101,32107,32113,32129,32149,32161,32173,32183,32189,32191,32197,32201,32203,32209,32213,32233,32237,32243,32257,32267,32269,32273,32281,32293,32297,32299,32317,32321,32323,32329,32341,32351,32353,32357,32359,32369,32381,32387,32393,32399,32401,32411,32413,32419,32437,32441,32443,32449,32453,32461,32467,32491,32497,32507,32509,32513,32521,32527,32533,32537,32539,32551,32561,32573,32579,32591,32593,32603,32609,32611,32617,32621,32623,32629,32633,32651,32653,32657,32659,32671,32677,32681,32689,32701,32713,32731,32737,32761,32779,32797,32801,32819,32821,32831,32833,32843,32849,32861,32863,32881,32891,32903,32909,32911,32917,32929,32939,32941,32947,32953,32971,32987,32989,32993,33001,33011,33013,33017,33037,33041,33043,33049,33053,33071,33073,33077,33079,33101,33107,33113,33119,33121,33133,33137,33139,33157,33161,33163,33169,33181,33193,33211,33217,33227,33233,33241,33247,33253,33259,33281,33293,33311,33323,33329,33331,33337,33343,33349,33353,33361,33371,33373,33377,33379,33389,33391,33401,33403,33409,33421,33431,33433,33451,33457,33473,33491,33493,33497,33499,33511,33517,33521,33529,33547,33553,33569,33577,33601,33611,33613,33617,33629,33641,33653,33659,33683,33689,33697,33701,33713,33739,33757,33773,33779,33797,33809,33821,33827,33833,33841,33851,33853,33857,33869,33871,33877,33881,33883,33889,33911,33913,33931,33937,33953,33961,33967,33979,33997,34001,34009,34019,34021,34031,34033,34043,34049,34051,34061,34063,34081,34091,34093,34103,34109,34117,34121,34129,34141,34147,34171,34177,34187,34189,34193,34201,34211,34213,34217,34219,34241,34243,34249,34253,34261,34271,34273,34277,34289,34301,34313,34319,34331,34333,34337,34339,34357,34361,34369,34373,34381,34387,34393,34411,34417,34427,34429,34441,34453,34457,34459,34471,34481,34493,34499,34511,34513,34523,34529,34537,34541,34543,34549,34553,34561,34571,34577,34579,34603,34609,34619,34621,34627,34633,34649,34651,34667,34669,34673,34681,34687,34693,34703,34709,34711,34717,34721,34733,34739,34751,34753,34757,34763,34777,34781,34793,34801,34817,34841,34847,34849,34859,34861,34877,34889,34901,34913,34931,34943,34957,34961,34973,34991,34997,35009,35027,35033,35041,35051,35053,35057,35069,35081,35093,35099,35117,35123,35129,35137,35141,35153,35159,35179,35197,35201,35213,35219,35237,35243,35249,35257,35261,35267,35281,35291,35293,35297,35309,35321,35327,35333,35339,35351,35377,35389,35393,35411,35417,35423,35429,35449,35453,35473,35477,35489,35513,35519,35521,35531,35533,35537,35549,35561,35573,35597,35603,35617,35627,35629,35633,35657,35663,35669,35681,35699,35713,35723,35729,35741,35747,35753,35771,35789,35801,35807,35809,35813,35831,35837,35851,35857,35867,35869,35879,35881,35887,35893,35897,35921,35923,35929,35947,35953,35963,35969,35971,35977,35989,35993,36011,36013,36017,36019,36031,36037,36047,36049,36053,36061,36077,36083,36089,36097,36107,36109,36121,36131,36133,36137,36139,36149,36151,36157,36161,36163,36187,36193,36203,36209,36217,36221,36223,36229,36233,36241,36247,36257,36269,36287,36289,36299,36301,36307,36313,36317,36319,36329,36331,36349,36353,36359,36361,36373,36401,36409,36427,36433,36443,36457,36467,36469,36479,36481,36493,36497,36499,36509,36511,36517,36521,36523,36529,36541,36551,36553,36571,36577,36593,36601,36607,36619,36637,36641,36649,36661,36671,36683,36689,36691,36703,36721,36731,36733,36749,36751,36761,36769,36779,36781,36787,36793,36811,36817,36829,36833,36851,36853,36857,36859,36877,36881,36889,36893,36901,36913,36917,36919,36929,36941,36947,36959,36961,36979,36991,37003,37021,37063,37069,37081,37091,37097,37099,37109,37111,37117,37123,37129,37141,37151,37153,37171,37193,37201,37207,37237,37241,37249,37259,37267,37273,37277,37279,37291,37297,37309,37313,37319,37321,37333,37339,37361,37369,37393,37403,37409,37417,37427,37439,37447,37453,37477,37481,37483,37489,37493,37501,37507,37529,37537,37549,37561,37577,37591,37603,37609,37619,37621,37633,37649,37661,37699,37711,37729,37741,37757,37771,37783,37789,37801,37817,37831,37841,37867,37873,37889,37897,37913,37921,37927,37937,37969,37997,38011,38047,38077,38081,38089,38107,38113,38123,38137,38147,38149,38159,38161,38173,38177,38179,38189,38191,38203,38209,38219,38221,38233,38237,38239,38249,38251,38257,38273,38279,38281,38293,38299,38317,38321,38329,38341,38351,38363,38369,38371,38383,38401,38411,38413,38417,38419,38429,38431,38441,38443,38449,38461,38471,38473,38491,38497,38513,38527,38539,38557,38561,38569,38579,38581,38593,38603,38609,38611,38621,38623,38641,38653,38657,38663,38677,38683,38701,38711,38713,38719,38729,38737,38741,38743,38749,38761,38771,38797,38803,38809,38813,38821,38827,38833,38849,38869,38881,38893,38903,38909,38911,38917,38921,38923,38929,38933,38953,38957,38963,38977,38981,38989,38993,39001,39013,39017,39023,39037,39043,39049,39061,39073,39089,39097,39121,39149,39161,39167,39169,39173,39211,39217,39229,39233,39241,39257,39281,39283,39289,39293,39301,39307,39313,39329,39337,39353,39379,39397,39401,39409,39433,39451,39457,39481,39493,39497,39499,39511,39521,39533,39539,39551,39553,39563,39569,39577,39581,39583,39589,39593,39601,39607,39617,39629,39647,39649,39653,39659,39671,39691,39701,39703,39709,39713,39721,39761,39773,39779,39791,39793,39803,39811,39821,39827,39833,39839,39841,39857,39863,39869,39877,39881,39883,39889,39901,39913,39923,39929,39931,39937,39947,39953,39961,39979,40003,40007,40009,40013,40021,40037,40051,40057,40067,40081,40093,40109,40127,40129,40139,40141,40157,40171,40219,40241,40247,40253,40267,40273,40277,40289,40297,40301,40307,40319

65536: This makes my answer go over the character limit (32768 numbers)

105953: 1-105952

I think something is wrong here, you cannot balance one on a 100 hole centrifuge but you can balance 8,18,28,48,58,68,78,88 (this list is perhaps not complete).

I must've accidentally cut the one out, as for the other numbers,  have to look into that

Thank you very much for updating your list! If possible, you could just count the number of outputs for the cases where you get such huge lists - I did not think that throu really=)

@flawr I updated the list

Pyth - 39 37 bytes
A direct translation of @Wrzlprmft's python answer.
f.Am>.asm^.n1c*.jZyk.nZQd^10_9.cUQTSQ

Explanation and probably further golfing coming soon.
Try it online here.

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


text:
Three-pointer! But what kind?
From http://en.wikipedia.org/wiki/Triangle:

Write a program that takes three 2d coordinate tuples (Cartesian), and classifies what shape these three points describe.
In almost all cases these points will describe a triangle of varying types.  In some degenerate cases, the points will either describe a singular point or a straight line.  The program will determine which of the following tags apply to the described shape:

Point         (3 points are co-incident)
Line          (3 points lie on a straight line - no more than 2 points may be co-incident)
Equilateral   (3 sides equal, 3 angles equal)
Isosceles     (2 sides equal, 2 angles equal)
Scalene       (0 sides equal, 0 angles equal)
Right         (1 angle exactly π/2 (or 90°))
Oblique       (0 angles exactly π/2 (or 90°))
Obtuse        (1 angle > π/2 (or 90°))
Acute         (3 angles < π/2 (or 90°))

Note that for some described shapes, more than one of the above tags will apply.  For example, any right-angled will also either be isosceles or scalene.
Input

The program may read the 3 input coordinates from STDIN, command-line, environment variables or whatever method is convenient for your language of choice.
The input co-ordinates my be formatted however is convenient for your language of choice.  It can be assumed that all input numbers are well-formed with respect to the datatypes you end up using.
Nothing can be assumed about the ordering of the input coordinates.

Output

The program will output to STDOUT, dialog box or whatever display method is convenient for your language of choice.
The output will display all the tags applicable to the shape described by the input coordinates.
Tags may be output in any order.

Other Rules

Your language's trigonometric libraries/APIs are allowed, but any APIs that specifically calculate triangle types are banned.
When determining equality of angles or lengths of sides, you will likely end up comparing floating-point values.  Two such values are to be considered "equal" if one is within 1% of the other.
Standard “loopholes” which are no longer funny
This is code-golf, so the shortest answer in bytes wins.

Examples
Input                   Output
(1,2) (1,2) (1,2)       Point
(1,2) (3,4) (5,6)       Line
(0,0) (1,1) (2,0)       Isosceles Right
(0,0) (2,1) (10,1)      Scalene Oblique Obtuse

I was going to entitle this "Triangle Tag" but it fell short of the 15-character minimum.

What if two points are identical?

@Ypnypn In that case it is a line.

Triangle Tag

(Minimum character counts is for loser :v)

There is a problem with "Acute" definition ? it's impossible that all angles are greater than PI/2 ?

@SuperChafouin Oops - good catch!  I've fixed it now.

Does it matter how we treat invalid inputs? (i.e. a word, 2 or 4 coordinates, etc.)

@hsl No you don't need to worry about invalid inputs.  I think the 2nd part of the input rules explains this.

For any equilateral triangle, should it also output "isosceles"? It technically satisfies the conditions

@KyleMcCormick I'd prefer that equilateral and isosceles are mutually exclusive.  But since the original spec was a bit ambiguous in this respect, I will accept it either way.

C (451 bytes)
Uses only squared lengths and slopes.
p[2],q[2],r[2];z(c){char*y[]={"Line","Point","Isosceles ","Equilateral ","Scalene ","Right","Oblique ","Acute","Obtuse"};printf(y[c]);}d(int*a,int*b){int c=*a++-*b++,e=*a-*b;return c*c+e*e;}main(){scanf("%d%d%d%d%d%d",p,p+1,q,q+1,r,r+1);int a=d(p,q),b=d(q,r),c=d(r,p),e=!a+!b+!c,f=(a==b)+(b==c)+(c==a),g=a>b&&b>c?a:b>c?b:c,h=g^a?g^b?a+b:c+a:b+c;e?z(e/2):(1[q]-1[p])*(*r-*q)^(1[r]-1[q])*(*q-*p)?f?z(2+f/2),f-1&&z(2):z(4),h^g?z(6),z(7+(h<g)):z(5):z(0);}

Ungolfed (and ternary operator replaced with if/else):
int p[2],q[2],r[2];

void print(c){
    char *y[]={"Line","Point","Isosceles ","Equilateral ","Scalene ","Right","Oblique ","Acute","Obtuse"};
    printf(y[c]);
}
squared_distance(int *a,int *b){
    int c = *a++ - *b++, e = *a - *b;
    return c*c+e*e;
}
main(){
    scanf("%d%d%d%d%d%d",p,p+1,q,q+1,r,r+1); // read in coordinates
    int a = squared_distance(p,q),b = squared_distance(q,r),c = squared_distance(r,p),
    e=!a+!b+!c, // number of sides of length 0
    f=(a==b)+(b==c)+(c==a), // number of equal-length pairs
    g = a > b && b > c ? a : (b > c ? b : c), // longest side
    h = g != a ? g != b ? a + b : c + a : b + c; // sum of squares of length of other two sides
    if(e)
        print(e/2); // 1 side of len 0: line, 3 sides: point
    // comparing slopes PQ and QR
    else if((q[1]-p[1])*(*r-*q) != (r[1]-q[1])*(*q-*p)){ // not line
        if(f){
            print(2+f/2); // 1 pair of equal length sides: isosceles, 3: equilateral
            if(f-1) print(2); // equilateral therefore also isosceles
        }else print(4); // 0: scalene
        if(h!=g){ // a^2+b^2!=c^2: not right
            print(6); // oblique
            print(7+(h<g)); // a^2+b^2<c^2:obtuse, acute otherwise
        }else print(5); // right
    }else
        print(0); // line
}

Input (through stdin) Format: x y x y x y
ex. 0 0 1 1 2 0 for Isosceles Right

@digitaltrauma ./triangle <<< "1 2 1 2 1 2" should be used, with the quotes.

Yes, of course, sorry about that.  Nice answer.  I particularly like that you were able to avoid floats, and thus not have to worry about the within 1% equality rule thing.  +1

C,333
z,c,r,b,s,i,t[14],g[14];
main(){
  for(;i<14;i++){
    g[i]=r=t[(i+2)%6]-t[i%6];r*=r;t[i|1]+=r;
    i<6&&scanf("%d",t+i);
    i>7&&(b<t[i]&&(b=t[i]),s+=t[i],z+=!t[i],c+=t[i]==t[i-2]);
  }

  if(g[6]*g[9]==g[8]*g[7])puts(z==6?"point":"line");else
    printf(b*2==s?"right ":"oblique %s",b*2>s?"obtuse ":"acute "),puts(c>3?c>5?"equilateral":"isosceles":"scalene");
}

I left the whitespace in for the moment. This works but could probably do with some tidying up and golfing. Similar math to @es1024's answer, but uses a loop and arrays. Input format x y x y x y
Variables
t[] stores both the input and the squares of the lengths. By the end of the program it looks like the table below (increasing the number of iterations of the loop would lead to indefinite repitition of the squared lengths.) At the start of the loop squares of lengths (garbage as not all the data is available) are needlessly stored in cells 1,3 and 5, but are promptly overwritten by scanf. Useful data is written to z,b,c ahd s when i=9,11,13 (t[i] and t[i-2] are accessed.)
01 23 45 67 89 1011 1213
aa bb cc  a  b    c    a
xy xy xy  L  L    L    L

g[] was added late on to hold the dx and dy values needed for slope calculation. The only cells used are 6 through 9 (0 through 5 are unreliable as not all the data is available when they are written.) If g[6]/g[7]==g[8]/g[9] the slopes of 2 lines are equal and the triangle is just a line (or a point.) The equation is rearranged in the program to avoid division.
ris an intermediate value used for squaring
zcounts the number of sides of length zero. It has an offset of +3 because the loop reads 3 blank cells in t[].
ccounts the number of sides that are of identical length. It also has an offset of +3. Note that side a is written to t[] twice in order to be able to check a=b,b=c,c=a.
bis the biggest length of a side, squared.
sis the sum of the squares of all sides.
Note that comparing side lengths A^2+B^2+C^2 with 2*B^2 is the same as comparing A^2+C^2 with B^2 (just subtract B^2 from both sides.) Thus if B^2=A^2+C^2 it is a right triangle. if B^2 is greater it is obtuse, if smaller it is acute.

Based on the diagram in the question, an equilateral triangle should also be classified as an isosceles triangle. (On the other hand, it's impossible to create an equilateral triangle with integer coordinates.)

@es1024 the triangle (0,0) (4,7) (8,0) gets so close (squared side lengths 64,65,65). It's a handy approximation if you want to draw 60 degree angles (drawing snowflakes per one of my other answers, making your own isometric dot paper, or drawing clocks.) It's probably impossible to get a perfect match with floats too. If and when I revise this code I may add a 1% tolerance to the comparison, as described in the question.

Golfscript (175 bytes)
~..|,({.)2$([\;\]@(;]{{~}/@- 2?@@- 2?+}%$.{2-1??100*}/-+abs 1<{;"Line"}{.[]|,((["Isosceles ""Scalene "]=\~-+.!["Oblique ""Right "]=\.!\0>-)["Acute ""Obtuse "]=}if}{;"Point "}if

You can test it here (test set included).
Input format:
"[x y][x y][x y]"

Commented version:
~                       # evaluates input string
..|,(                   # pushes the number of unique coords - 1
{
  .)2$([\;\]@(;]        # makes all 3 possible pairings of coords
  {{~}/@- 2?@@- 2?+}%$  # gets all squares of side lengths
  .{2-1??100*}/-+abs 1< # 0 if triangle, 1 if line
  {;"Line"}
  {
     .[]|,((["Isosceles ""Scalene "]=\   # removes duplicate side-squares,
                                         #   and use the count to determine
                                         #   if isosceles or scalene (no
                                         #   equilaterals will exist)
     ~-+.!["Oblique ""Right "]=\         # compute a^2 + b^2 - c^2. Use to
                                         #   determine if oblique or right.
                                         #   c = max side length
     .!\0>-)["Acute ""Obtuse "]=         # use same value to determine if
                                         #   acute, obtuse, or right
  }
  if
}
{;"Point "}
if

NOTE:
The reason my code contains no "equilateral" output is because:

OP said "all input numbers are well-formed with respect to the datatypes you end up using"
Golfscript does not have floating point numbers - not inherently anyway
It's impossible (in a 2-dimensional grid) to have an equilateral triangle with integer coordinates, as proven here.

Your notes are correct - that is why I included the rule about "equality" meaning values within 1%

If I'm not mistaken, you said this for floats, not for integers: "..you will likely end up comparing floating-point values. Two such values are to be considered 'equal' if one is within 1% of the other."

Mathematica (313 307 characters)
Golfed:
f@p_:=(P=Print;R=RotateLeft;L=Length;U=Union;If[L@U@p==1,P@"Point",If[Det[Join[#,{1}]&/@p]==0,P@"Line",v=p-R@p;a=MapThread[VectorAngle[#,#2]&,{-v,R@v}];u=L@U[Norm/@v];If[u==1,P@"Equilateral",If[u==2,P@"Isosceles",P@"Scalene"]];If[MemberQ[a,Pi/2],P@"Right",P@"Oblique";If[Max@a>Pi/2,P@"Obtuse",P@"Acute"]]]])

Ungolfed:
f@p_ := (
  P = Print;    (* make aliases for functions used more than once *)
  R = RotateLeft;
  L = Length;
  U = Union;
  If[L@U@p == 1,    (* if all points identical *)
   P@"Point",
   If[Det[Join[#, {1}] & /@ p] == 0,    (* if area is zero *)
    P@"Line",
    v = p - R@p;    (* cyclic vectors *)
    a = MapThread[VectorAngle[#, #2] &, {-v, R@v}];    (* interior angles *)
    u = L@U[Norm /@ v];    (* number of unique side lengths *)
    If[u == 1,
     P@"Equilateral",
     If[u == 2,
      P@"Isosceles",
      P@"Scalene"
      ]
     ];
    If[MemberQ[a, Pi/2],
     P@"Right",
     P@"Oblique";
     If[Max@a > Pi/2,
      P@"Obtuse",
      P@"Acute"
      ]
     ]
    ]
   ]
  )

The input format is a list of points, upon which the function is called:
points = {{x1,y1},{x2,y2},{x3,y3}};
f@points

I'm a mathematica rookie.  Where can I download an interpreter/compiler, or try this online (for free, of course ;-))?

I've never used it, but Wolfram has a 'CDF Player' browser application which claims to run Mathematica files stored in the CDF format, but not regular notebooks.  Found here:  http://www.wolfram.com/cdf-player/  Beyond that, there's the main program, which I believe is free for 30 days.