# Quine with prime sourcecode character distribution constraints

1. Your program should take no input, and no network or other connections.
2. Your program should output it's sourcecode.
3. The sourcecode must consist of 3 types of characters: Numeric (0-9), Alpha (a-z|A-Z) and symbols !(0-9|a-z|A-Z). Constraints for the distribution of characters is:
• 3.1. Every neighbouring characters with equal character-type makes a character-group.
• 3.2. Each character-group length in bytes must be a prime-number (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, ...)
• 3.3. The total number of character-groups of each character-type must be a neighbouring (but not equal) fibonacci sequence number. For example: 3 groups of numbers, 5 groups of alpha, 8 groups of symbols.
• 3.4. A character-group of one charater-type cannot be adjacent to another character-group of the same character-type, because that will create one bigger group instead.

Example valid sourcecode (regarding character distribution, it does however not output it's sourcecode):

"."."."aa321'","/hithere' 12345678901,.,.,12345,.,


Character distribution in the example: 2 groups of Alpha. 3 group of numeric. 5 groups of other characters. The numbers 2, 3 and 5 are neighbouring numbers in the fibonacci sequence.

This is code-golf, good luck have fun!

• You might want to disallow trivial solutions like any numeric literal in golfscript before it's too late. – John Dvorak Jan 18 '14 at 10:29
• I believe the somewhat boring quine 12 would be legal in J, GolfScript, etc under these rules (2 being a prime number and 1 being a fibonacci number). – FireFly Jan 18 '14 at 10:29
• The sourcecode must consist of all 3 types of characters, so it is atleast 6 character-groups – Plarsen Jan 18 '14 at 10:31
• neighbours in the fibonacci sequence – Plarsen Jan 18 '14 at 10:33
• so, 0 doesn't count as a fibonacci number? – John Dvorak Jan 18 '14 at 10:35

# PHP, some other languages - 12 bytes

22ab,,22,,22


PHP will print out the source code if it is not wrapped in some tag.

This is actually the smallest possible answer to the question. The smallest prime number is 2, and the smallest distinct fibonacci numbers are 1, 2, and 3. 3 + 2 + 1 = 6. 6 * 2 = 12

See a run here: http://ideone.com/0NDA8A

# Golfscript, 21 15 characters

11{'aa.~' }aa.~


After removing all NOPs, their images, and the leading 11, this becomes the quine

{'.~'}.~


reading: block(string(dup, eval)); dup; eval.

Now to shoot for the stars (20 characters - the minimum for 2-3-5) or even galaxies (12 characters - the absolute minimum) I've taken a short stop at Alpha Centauri B to refuel, now I'm drifting through intergalactic medium. Thanks, Goldbach's conjecture.

• @Plarsen shaved off six characters. One more to go, then I believe I'll hit the rock bottom for golfscript. – John Dvorak Jan 18 '14 at 13:48
• oh man! I could never imagine that was even possible! – Plarsen Jan 18 '14 at 14:12

# Befunge 98 - 16 bytes

<@,*+982aa,,kd$"  This works only if your interpreter interprets line-wrap as adding a single space. This one works otherwise: <@,*+982aa,,kd "  Character groups: <@,*+ 5 chars, symbols 982 3 chars, numbers aa 2 chars, alpha ,, 2 chars, symbols kd 2 chars, alpha$"    2 chars, symbols


So the fibonacci numbers are 1 (numbers), 2 (alpha), and 3 (symbols)

## Windows Command Script - 12 bytes (+ free folder bonus)

md  12##56##
`

Since every command is echoed by default, it's just a matter of finding the shortest command.