text:
Every word from babab to zyzyz
Your task is to write a program that will output a readable list of every five letter words with the structure:
consonant - vowel - consonant - vowel - consonant
The output should be sorted alphabetically with one word per line and no words repeated twice. It can be lowercase or uppercase but not mixed. So the list could start and end like this:
babab
babac
babad
...
zyzyw
zyzyx
zyzyz

Vowels are a-e-i-o-u-y, the other 20 English-alphabet letters are consonants.
Words don't have to be actual dictionary words.
Shortest code wins.
Note: A few years ago I stumbled upon a program on a university website that did exactly that. Turns out my first and last name fit the c-v-c-v-c constraint, and i'd been googling myself.

I see two things here. First, there are a ridiculous amount of words like this. How do you expect to test the entries? Also, there are many names that fit that constraint. The first that comes to mind is Jacob, although others like Lucas also fit

@TrojanByAccident I believe the challenge requires all possible matching letter combinations, regardless of whether they are names/English words. "Words don't have to be actual dictionary words."

@trichoplax if you mean my second point, I was referring to the OP's Note at the bottom

@TrojanByAccident My apologies - I didn't realise they were separate points. In that case, I guess a program to test the outputs would be helpful. I make it 20620620=288,000 words in total, around 1,728,000 characters including delimiters. I'm not sure if a Stack Snippet can handle strings that long.

@TrojanByAccident The note was just to point out how I had the idea for the question, not an extra challenge. Also, my first name is Kevin :)

Does the order in which the names are output, matter? If so, can you please explain that order in more detail?

@smls By incremental I mean that after babaz comes babeb, not babob or babib. So we work our way through vowels and consonants in the order they come in the alphabet.

Can we use uppercase instead of lowercase?

Can we return a list of strings instead?

@Adám The output should be formatted like in the example, lowercase, each word to its line, no repeats.

@wilks Relevant meta post -- Strict i/o formats aren't appreciated in this SE community. This challenge is focusing on generating c-v-c-v-c words, not inserting newlines between words, no?

@JungHwanMin Thanks for the link, first time here and I didn't know about this. I saw it as a readable and alphabetical list of all the c-v-c-v-c words. So I agree that upper or lowercase really doesn't matter, but I also think that one very long string or, say some nested arrays, whilst technically valid wouldn't be a great answer.

Having run a few of the upvoted answers to this question, they obviously do not comply with "The output should be incremental with each word on its own line". Has this requirement been relaxed and if so can you edit the question to reflect this? I reckon I could lose quite a few bytes if my answer wasn't restricted by the format.

Mathematica, 72 65 61 bytes
Print@@@Tuples@{a=##/(b=#5#9#15#21#25#)&@@Alphabet[],b,a,b,a}

For testing, I recommend replacing Print@@@ with ""<>#&/@. Mathematica will then display a truncated form showing the first few and last few words, instead of taking forever to print 288,000 lines.
Explanation
I finally found a use for dividing strings. :)
I've been intrigued by the possibility of adding or multiplying strings for a while, but the actual use cases are fairly limited. The main point is that something like "foo"+"bar" or "foo"*"bar" (and consequently, the short form "foo""bar") is completely valid in Mathematica. However, it doesn't really know what to do with the strings in arithmetic expressions, so these things remain unevaluated. Mathematica does apply generally applicable simplifications though. In particular, the strings will be sorted into canonical order (which is fairly messed up in Mathematica, once you start sorting strings containing letters of various cases, digits and non-letters), which is often a dealbreaker, but doesn't matter here. Furthermore, "abc""abc" will be simplified to "abc"^2 (which is a problem when you have repeated strings, but we don't have that either), and something like "abc"/"abc" will actually cancel (which we'll be even making use of).
So what are we trying to golf here. We need a list of vowels and a list of consonants, so we can feed them to Tuples to generate all possible combinations. My first approach was the naive solution:
Characters@{a="bcdfghjklmnpqrstvwxz",b="aeiouy",a,b,a}

That hardcoded list of consonants does hurt a bit. Mathematica does have an Alphabet built-in which would allow me to avoid it, if I were able to remove the vowels in a cheap way. This is where it gets tricky though. The simplest way to remove elements is Complement, but that ends up being longer, using one of the following options:
{a=Complement[Alphabet[],b=Characters@"aeiouy"],b,a,b,a}
{a=Complement[x=Alphabet[],b=x[[{1,5,9,15,21,25}]]],b,a,b,a}

(Note that we don't need to apply Characters to the whole thing any more, because Alphabet[] gives a list of letters, not a string.)
So let's try that arithmetic business. If we represent the entire alphabet as a product of letters instead of a list, then we can remove letters by simple division, due to the cancelling rule. That saves a lot of bytes because we won't need Complement. Furthermore, "a""e""i""o""u""y" is actually a byte shorter than Characters@"aeiouy". So we do this with:
a=##/(b="a""e""i""o""u""y")&@@Alphabet[]

Where we're storing the consonant and vowel products in a and b, respectively. This works by writing a function which multiplies all its arguments with ## and divides them by the product of vowels. This function is applied to the alphabet list, which passes each letter in as a separate argument.
So far so good, but now we have
{a=##/(b="a""e""i""o""u""y")&@@Alphabet[],b,a,b,a}

as the argument to Tuples, and those things are still products, not lists. Normally, the shortest way to fix that is putting a List@@@ at the front, which turns the products into lists again. Unfortunately, adding those 7 bytes makes it longer than the naive approach.
However, it turns out that Tuples doesn't care about the heads of the inner lists at all. If you do
Tuples[{f[1, 2], f[3, 4]}]

(Yes, for an undefined f.) You'll get:
{{1, 3}, {1, 4}, {2, 3}, {2, 4}}

Just as if you had used a List instead of f. So we can actually pass those products straight to Tuples and still get the right result. This saves 5 bytes over the naive approach using two hardcoded strings.
Now the "a""e""i""o""u""y" is still fairly annoying. But wait, we can save a few bytes here as well! The arguments of our function are the individual letters. So if we just pick out the right arguments, we can reuse those instead of the string literals, which is shorter for three of them. We want arguments # (short for #1), #5, #9, #15, #21 and #25. If we put # at the end, then we also don't need to add any * to multiply them together, because (regex) #\d+ is a complete token that can't have any non-digit appended to it. Hence we end up with #5#9#15#21#25#, saving another 4 bytes.

Reads explanation. So... basically magic.

I'm surprised and impressed by your Tuples trick. That's entirely undocumented, right? And unexpected given how the two-input form Tuples[list,n] deals with list not having the List head (to me at least)!

@ASimmons The object list need not have head List. The head at each level in the arrays generated by Tuples will be the same as the head of list.

@ngenisis I find that wording very confusing. Because it's not clear that this refers to the outer list when using multiple lists. Indeed Tuples[f[{1,2}, {3,4}]] gives {f[1, 3], f[1, 4], f[2, 3], f[2, 4]} instead. It's not documented that the inner head is completely ignored.

@ASimmons cc. ^

Ah, I misunderstood

Possibly the one-argument form of Tuples was added later than the two-argument form? That would explain the confusing documentation.

Perl, 47 bytes
#!perl -l
/((^|[aeiouy])[^aeiouy]){3}/&&print for a..1x5

Counting the shebang as one.
Try it online!

This is nice, well done! Any reasons you're not using say ?

Thanks. I disagree that -M5.01 should be 'free'.

I like your opinion on -M5.010. And the intersting part in the golfing isn't to replace print with say...

Isn't -E (and subsequently say) a freebie?

@Zaid See Primo's first comment

Python 3 - 110 bytes
a,b="bcdfghjklmnpqrstvwxz","aeiouy";print(*(c+d+e+f+g for c in a for d in b for e in a for f in b for g in a))

Straightforward looping fun :)

Think our ideas are the same but you beat me by 10 with Python 3!

I was just about to post a python2 equivalent using this approach.  Too slow, a vote for you instead.

Ruby, 72 71 52 bytes
puts (?z..?z*5).grep /#{["[^aeiouy]"]*3*"[aeiouy]"}/

Thanks to Value Ink for the basic idea, which brought that down to 60 bytes.

It's shorter to generate a list of 5-letter words and using grep. If you generate a range that uses lower-case strings, you get a sequence of the lower-case words only. puts ("babab".."zyzyz").grep /#{["[^aeiouy]"]*3*"[aeiouy]"}/ for 60 bytes

05AB1E, 18 16 bytes
05AB1E uses CP-1252 encoding.
žP3ãžO3ãâ€øJ€¨ê»

Explanation
žP3ã                # push all combinations of 3 consonants
    žO3ã            # push all combinations of 3 vowels
        â           # cartesian product
         €ø         # zip each pair of [ccc,vvv] (c=consonant,v=vowel)
           J        # join to list of strings ['cvcvcv','cvcvcv' ...]
            €¨      # remove last vowel from each
              ê     # sort and remove duplicates
              »     # join on newlines

For testing purposes I recommend replacing žP with a few consonants and žO with a few vowels.
Example using 5 consonants and 3 vowels

nice use of Cartesian product. Wouldn't've thought of that.

Python 2, 120 102 94 bytes
from itertools import*
lambda:map(''.join,product(*(('AEIOUY','BCDFGHJKLMNPQRSTVWXZ')*3)[1:]))

Try it online!

Pure Bash, 74
v={a,e,i,o,u,y}
c={b,c,d,f,g,h,{j..n},{p..t},v,w,x,z}
eval echo $c$v$c$v$c

Straightforward brace expansion.
Try it online.

If each item must be on its own line, then we have:
Pure Bash, 84
v={a,e,i,o,u,y}
c={b,c,d,f,g,h,{j..n},{p..t},v,w,x,z}
eval printf '%s\\n' $c$v$c$v$c

PHP, 88 86  84 80 bytes
pretty string increment :)
6 bytes saved by @Christoph
for($s=$v=aeiouy;++$s<zyzza;preg_match("#[^$v]([$v][^$v]){2}#",$s)&&print"$s
");

loops through all strings from bababa to zyzyz and tests if they match the pattern. Run with -nr.

Lol, golfing with a buggy language spec, I like it

@PatrickRoberts It´s not a bug. It´s a feature. :D I am sad they embedded an implicit cast to integer into $a="001";$a++; some day. That was a very unconvenient change.

I didn't say the "feature" was a bug, I said the specification was a bug. Sort of like how in JavaScript, typeof null == "object"

for($s=$v=aeiouy;++$s<zyzza;)preg_match("#[^$v][$v][^$v][$v][^$v]#",$s)&&print"$s\n"; saves you 1 char. Sadly you have to change echo to print to use &&. Replacing \n with a real line break saves another.

you might save some chars using "#([^$v][$v]){2}[^$v]#" but I haven't tested it.

@Christoph: Idk why, but ([^$v][$v]){2}[^$v] does not work in the loop, while [^$v]([$v][^$v]){2} does. Both work standalone (even with the variable) though.

Haskell, 54 51 bytes
l="bcdfghjklmnpqrstvwxz":"aeiouy":l
mapM(l!!)[0..4]

mapM func list builds all words by taking the possible characters for index i from the list returned by func (list!!i).
Edit: @xnor found 2 bytes to save and looking at his solution, I found another one.

mapM id$take 5$cycle["bcdfghjklmnpqrstvwxz","aeiouy"] saves a byte.

Better yet, mapM(cycle["bcdfghjklmnpqrstvwxz","aeiouy"]!!)[0..4] or mapM(["bcdfghjklmnpqrstvwxz","aeiouy"]!!)[0,1,0,1,0]. It would be nice not to hardcode the vowels and consonants, but mapM(\n->[x|x<-['a'..'z'],elem x"aeiou"==odd n])[0..4] doesn't quite make it.

@xnor: Thanks! Replacing cycle from your first variant with explicit recursion saves an additional byte.

Python 2, 85 bytes
W='BCDFGHJKLMNPQRSTVWXZ'
for s in['AEIOUY',W]*2:W=[w+c for w in W for c in s]
print W

Try it online!
I'm back six years later with a golf. The string W of consonants can also be used as the result of the first loop which gives all first-letter options. The fact that it's a string rather than a list is harmless because we just need to iterate over it. We can then write the other four letter sets cleanly as ['AEIOUY',W]*2.
Python, 92 bytes
f=lambda i=-4,s='':i*[s]or sum([f(i+1,s+c)for c in i%2*'AEIOUY'or'BCDFGHJKLMNPQRSTVWXZ'],[])

Try it online!
Can't let itertools win out. Iterative is 1 byte longer in Python 2.
W='',
for s in(['AEIOUY','BCDFGHJKLMNPQRSTVWXZ']*3)[1:]:W=[w+c for w in W for c in s]
print W

This is awesome ^_^

MATL, 21 bytes
11Y2'y'h2Y2X~6Myyy&Z*

Try it online! (but output is truncated).
11Y2   % Push 'aeiou' (predefined literal)
'y'    % Push 'y'
h      % Concatenate: gives 'aeiouy'
2Y2    % Push 'abcdefghijklmnopqrstuvwxyz' (predefined literal)
X~     % Set symmetric difference: gives 'bcdfghjklmnpqrstvwxz'
6M     % Push 'aeiouy' again
yyy    % Duplicate the second-top element three times onto the top. The stack now
       % contains 'bcdfghjklmnpqrstvwxz', 'aeiouy', 'bcdfghjklmnpqrstvwxz',
       % 'aeiouy', 'bcdfghjklmnpqrstvwxz'
&Z*    % Cartesian product of all arrays present in the stack. Implicity display

I think this should work, shaving a byte: 11Y2'y'h2Y2yX~yyy&Z* (Try it online!)

@ConorO'Brien Unfortunately, that creates the vcvcv pattern, not cvcvc as required. Thanks though!

JavaScript (ES6), 91 90 bytes
f=(s='',i=4)=>{for(c of i%2?'aeiouy':'bcdfghjklmnpqrstvwxz')i?f(s+c,i-1):console.log(s+c)}

Edits

ETHproductions: -1 byte by removing extraneous group around ternary operator in for statement

Explanation
This defines a 5-deep recursive function that uses the parity of its depth of call to determine whether to iterate vowels or consonants. On each iteration, it checks to see whether to recurse or print by checking the amount of recursions left, and concatenates the letter of its current iteration to the end of the 5 character string that is currently being built depth-first.
Alternative 89 byte solution assuming ISO8859-1 encoding:
f=(s='',i=4)=>{for(c of i%2?'aeiouy':btoa`mÇ_äiéª»-¿s`)i?f(s+c,i-1):console.log(s+c)}

Alternative 96 byte solution that returns entire output as single string:
f=(s='',i=4,o='')=>eval("for(c of i%2?'aeiouy':'bcdfghjklmnpqrstvwxz')o+=i?f(s+c,i-1):s+c+`\n`")

Run at your own risk. For the 91 byte solution, just use f() and for the 97 byte alternative, use console.log(f()).

I tried turning the solution into a generator in two different ways. Using the shorthand form supported only by Firefox is the same length: f=(s='',i=2)=>(for(c of(i%2?'aeiouy':'bcdfghjklmnpqrstvwxz'))for(q of i?f(s+c,i-1):[s+c])q) Using the standard form is unfortunately a byte longer: function*f(s='',i=2){for(c of(i%2?'aeiouy':'bcdfghjklmnpqrstvwxz'))yield*i?f(s+c,i-1):[s+c]} Still waiting for the day when a generator is the shortest option...

btw, you can remove the inner parens in the for...of statement to save a byte

Brachylog, 18 bytes
@W:@Dg:2jcb:eac@w\

Try it online!
Explanation
@W:@D                 The list ["aeiouy", "bcdfghjklmnpqrstvwxz"]
     g:2jcb           The list ["bcdfghjklmnpqrstvwxz", "aeiouy", "bcdfghjklmnpqrstvwxz", "aeiouy", "bcdfghjklmnpqrstvwxz"]
           :ea        Take one character of each string
              c       Concatenate into a single string
               @w     Write to STDOUT followed by a newline
                 \    Backtrack: try other characters of the string

I was surprised at the need for the g and b, but testing it, this is because j seems to refuse to take a list of strings as input? :ea really shows off the strengths of Prolog/Brachylog, though, and is a step that most other languages find much more difficult.

@ais523 Yes, I was also suprised that the g and b were needed. j seems to be bugged and this is due once again to the difficulty of distinguishing a list of arguments from just a list. I might fix this though this will once again complexify the implementation. I might as well just not fix it and invest my time on fixing the core problem in a new version of Brachylog.

C, 201 199 186 184 183 169 163 bytes
Doing it a bit differently than with the previous basic counting method:
f(){for(char*c="bcdfghjklmnpqrstvwxz",*v="aeiouy",i[5]={0},*s[]={c,v,c,v,c},j=0;j<5;puts("")){for(j=5;j--;putchar(s[j][i[j]]));for(;j++<5&&!s[j][++i[j]];i[j]=0);}}

Ungolfed:
f() {
    for(char *c="bcdfghjklmnpqrstvwxz", *v="aeiouy", i[5]={0}, *s[]={c,v,c,v,c}, j=0; j<5; puts("")) {
        for (j=5; j--; putchar(s[j][i[j]])) ;
        for (; j++ < 5 && !s[j][++i[j]]; i[j]=0) ;
    }
}

And written in a bit more conventional way:
f() {
    char *c="bcdfghjklmnpqrstvwxz", *v="aeiouy", i[]={0,0,0,0,0}, *s[]={c,v,c,v,c}, j=0;
    while (j>=0) {
        for (j=0; j<5; j++) putchar(s[j][i[j]]); // output the word
        while (--j>=0 && !s[j][++i[j]]) i[j]=0; // increment the counters
        puts("");
    }
}

Basically, i are the counters, and s the array of strings containing all the chars over which we should iterate, for each counter. The trick is the inner while loop: it is used to increment the counters, starting from the rightmost one. If we see that the next character we should display is the ending null char, we restart the counter to zero and the "carry" will be propagated to the next counter.
Thanks Cristoph!

Welcome to PPCG!

char *c I think the space is unnecessary.

@Christoph You're right, thanks.

f(){char*c="bcdfghjklmnpqrstvwxz",*v="aeiouy",i[]={0,0,0,0,0},*s[]={c,v,c,v,c},j=0;while(j>=0){for(j=0;j<5;++j)putchar(s[j][i[j]]);for(;--j>=0&&!s[j][++i[j]];)i[j]=0;puts("");}} gets you to 177. Come on you can do even better ;).

Using i[5]={0} instead of i[]={0,0,0,0,0} saves 7 bytes.

char*c="bcdfghjklmnpqrstvwxz",*v="aeiouy",i[5]={0},*s[]={c,v,c,v,c};f(int j=0){for(;j<5;)putchar(s[j][i[j++]]);for(;j-->0&&!s[j][++i[j]];)i[j]=0;puts("");j<0||f();} 164. Note that in general to get those versions compile I need int f() not sure if some compilers allow it without.

@Christoph All right, let's invite recursivity in... I thought that was already pretty twisted, but it seems there are no limits. I'm not sure about the s[j][i[j++]], though. Isn't that undefined, per the C specifications? I thought the order of evaluation (j being used twice and with a postincrement) wasn't guaranteed.

If that bothers you it only saves 1 char: f(){for(char*c="bcdfghjklmnpqrstvwxz",*v="aeiouy",i[5]={0},*s[]={c,v,c,v,c},j;j>=0;puts("")){for(j=-1;++j<5;)putchar(s[j][i[j]]);for(;j-->0&&!s[j][++i[j]];)i[j]=0;}} 165 nonrecursive.

@Christoph Thanks. There is another thing that bothers me: j isn't actually initialized when declared, and you're testing it right away. Did I miss something?

Your making this quite hard: f(){for(char*c="bcdfghjklmnpqrstvwxz",*v="aeiouy",i[5]={0},*s[]={c,v,c,v,c},j=0;j<5;puts("")){for(j=5;j--;putchar(s[j][i[j]]));for(;j++<5&&!s[j][++i[j]];i[j]=0);}} 163 nonrecursive without undefined behavior (as far as I can still tell at this point)

@Christoph Aha, thanks. Good job. But you seemed to enjoy it, that's why I was pushing the challenge (no, I'm kidding: I did that just because I'm a pain in the ass). Seriously, thanks for the enlightenments.

Befunge, 95 bytes
::45*%\45*/:6%\6/:45*%\45*/:6%\6/1g,2g,1g,2g,1g,55+,1+:"}0":**-!#@_
bcdfghjklmnpqrstvwxz
aeiouy

Try it online!, although note that the output will be truncated.
This is just a loop over the range 0 to 287999, outputting the index as a mixed based number 20-6-20-6-20, with the "digits" of the number retrieved from the tables on the last two lines.

Perl 6, 70 bytes
$_=<a e i o u y>;my \c=[grep .none,"a".."z"];.say for [X~] c,$_,c,$_,c

Explanation of the interesting part:
.say for [X~] c, $_, c, $_, c

              c, $_, c, $_, c  # list of five lists
         [X ]                  # lazily generate their Cartesian product
           ~                   # and string-concatenate each result
.say for                       # iterate to print each result

The code before that just generates the list of vowels ($_) and the list of consonants (c), which is regrettably verbose.

Python 2, 120 117 bytes
Thanks to @WheatWizard for the tabs tip.
x,y='aeiouy','bcdfghjklmnpqrstvwxz'
for a in x:
 for e in x:
	for b in y:
		for c in y:
			for d in y:print b+a+c+e+d

Try it online!
Not sure that this can be golfed much. Try it online truncates at 128KB but shows enough to give an idea. A local run with debug code to count the words gave a total of 288000. Runs in about 45 seconds if anyone wants to test.
zyzyv
zyzyw
zyzyx
zyzyz
Total word count: 288000

Non-compliant and therefore non-competing version (prints out nested arrays instead of the specified format) for 110 bytes:
x,y='aeiouy','bcdfghjklmnpqrstvwxz'
print[[[[c+a+d+b+e for e in y]for d in y]for c in y]for b in x]for a in x]

Was my first implemenation :)

Instead of using spaces for all your indentation you can use spaces for the single indent and tabs for double.

JavaScript (Firefox 30-57), 82 bytes
f=(i=5)=>i?[for(s of f(i-1))for(c of i%2?'bcdfghjklmnpqrstvwxz':'aeiouy')s+c]:['']

Returns an array of strings. Very fast version for 102 101 (1 byte thanks to @ETHproductions) bytes:
_=>[for(i of c='bcdfghjklmnpqrstvwxz')for(j of v='aeiouy')for(k of c)for(l of v)for(m of c)i+j+k+l+m]

Nice. There's an extraneous space in the fast version which can be removed for 101 bytes

Perl 6, 53 Bytes
/<-[aeiouy]>**3%<[aeiouy]>/&&.say for [...] <a z>Xx 5

Takes a little time to have any output. Very inefficient.  Does the job.

Welcome to PPCG!

Perl, 71 bytes
map{push@{1+/[aeiouy]/},$_}a..z;$"=",";say for glob"{@1}{@2}"x2 ."{@1}"

Try it online!
Explanation
I'll add more explanations later.
map{push@{1+/[aeiouy]/},$_}a..z; creates two arrays: @1 contains the consonants, and @2 contains the vowels.
glob when call with arguments like {a,b}{c,d} returns all permutations of the elements in the braces.

CJam, 32 31 29 28 bytes
Saved 2 bytes thanks to Martin Ender and 1 byte thanks to kaine
"aeiouy"_'{,97>^\1$1$1$N]:m*

Try it online! (Note that the output gets cut off on TIO)
Explanation
"aeiouy"_ e# Push the six vowels and duplicate
'{,97>    e# Push the whole alphabet
^         e# Symmetric set difference of the alphabet with the vowels, yields the consonants only
\         e# Swap top two elements
1$1$1$    e# Copy the second-from-the-top string to the top three times
          e# This results in the array being consonants-vowels-consonants-vowels-consonants
N         e# Add a newline character to the end of the list
]         e# End an array. Puts everything done so far in an array
          e# since there was no explicit start of the array.
:m*       e# Reduce the array using Cartesian products

'{,97> to get the alphabet. And then "aeiouy"_'{,97>^ to save another byte on 1$.

you don't need the very first character. It is assumed if it gets to start of the stack.

@kaine Interesting, didn't know that. Thanks.

$"aeiouy"_'{,97>^]3*(;:mN$  ignore the $ signs. Idk how to put code in comments.

@kaine Use backticks, like "`".

Scala, 87 86 bytes
val a="aeiouy"
val b='a'to'z'diff a
for(c<-b;d<-a;e<-b;f<-a;g<-b)println(""+c+d+e+f+g)

You can replace f"$c$d$e$f$g" with ""+c+d+e+f+g to save a byte.

Stacked, noncompeting, 51 bytes
(consonants:@c vowels:@v c v c)multicartprod$outmap

Pretty simple. Try it here!

R, 111 98 bytes
Added y as a vowel, and golfed off 13 bytes, thanks to @Patrick B.
l=letters
v=c(1,5,9,15,21,25)
apply(expand.grid(C<-l[-v],V<-l[v],C,V,C)[,5:1],1,cat,fill=T,sep="")

We use expand.grid to generate all possible combinations of V and C in a matrix, which we define from the preset variable letters (the alphabet). We reverse the combinations (as the default is for the first variable to rotate the fastest) to ensure alphabetical order. Then we iterate through each row of the matrix, printing each letter to stdout. We use the fill argument to cat to ensure that each word begins on a new line.

Nice! You can chop this down further to 98 characters (adding 'y' as a vowel, or 95 if not) by using some options in cat and by renaming "letters": l=letters;v=c(1,5,9,15,21,25);apply(expand.grid(C<-l[-v],V<-l[v],C,V,C)[,5:1],1,cat,fill=T,sep="")

@PatrickB. Thanks! I've incorporated your suggestions.

86 bytes

R, 143 132 bytes

q=letters;v=c(1,5,9,15,21,25);x=list(q[-v],q[v],q[-v],q[v],q[-v]);Reduce(paste0,mapply(function(a,b)rep(a,e=b/20),x,cumprod(sapply(x,length))))

q=letters;v=c(1,5,9,15,21,25);x=list(a<-q[-v],b<-q[v],a,b,a);Reduce(paste0,mapply(function(a,b)rep(a,e=b/20),x,cumprod(lengths(x))))

This is my first go at code golf so I'd welcome any suggestions to chop it down further. So far it's all pretty standard R; the only possibly tricky thing here is that paste0 recycles its arguments to the length of the longest one.
Edit: used assignment trick from rturnbull, replaced sapply(x,length) with lengths.

Welcome to the site!  This looks quite good (I have only programmed a bit in R myself) I would just recommend not including old code in your answer.  The edit history is always available so anyone that wishes to can always view it.  This is more of a personal stylistic thing so feel free to ignore my opinion.

You can brute-force it with function assignments for 114 bytes!

Perl, 63 59 54 bytes

$a="aeiouy";$b="[^$a][$a]"x2;for("a"x5.."z"x5){say if/$b[^$a]/}

$a="aeiouy";$b="[^$a][$a]"x2;/$b[^$a]/&&say for"a"x5.."z"x5

$a=aeiouy;$b="[^$a][$a]"x2;/$b[^$a]/&&say for a.."z"x5

Trying Perl golf for a change.
EDIT: Looks like I've still got much to learn... :)

Nice one (even if Primo's answer is shorter). You can write the end as /$b[^$a]/&&say for"a"x5.."z"x5 to save a few bytes. Edit: and you can drop the $b and do $a="aeiouy";/([^$a][$a]){2}[^$a]/&&say for"a"x5.."z"x5.

Also, you don't need the quotes around aeiouy. Also, since your regex checks for 5 characters, you can do a.."z"x5.

@Dada: Thanks. As someone who uses Perl for normal programming but until now not for golfing, I didn't even think to exploit non-strict mode. That's why I chose $a and $b as variable names, because those don't need to be declared even in strict mode... :) I also use Perl 6 a lot these days, which doesn't even have a non-strict mode.

C 361 bytes
f(){i,j,k,l,m;v[6]={97,101,105,111,117,121};c[25];s=26;for(i=0;i<26;i++)c[i]=97+i;for(i=0;i<26;i++){for(j=0;j<6;j++)if(c[i]==v[j])c[i]+=1;}for(i=0;i<s;i++)for(j=i+1;j<s;){ if(c[i]==c[j]){for(k=j;k<s-1;++k)c[k]=c[k+1];--s;}else ++j;}for(i=0;i<s;i++)for(j=0;j<6;j++)for(k=0;k<s;k++)for(l=0;l<6;l++)for(m=0;m<s;m++)printf("%c%c%c%c%c\n",c[i],v[j],c[k],v[l],c[m]);}

Ungolfed version:
void f()
{
int i,j, k,l,m;
int s=26;
int v[6]={97,101,105,111,117,121};
int c[s];

for(i=0;i<s;i++)
 c[i]=97+i;
for(i=0;i<s;i++)
{
  for(j=0;j<6;j++)
    if(c[i]==v[j])
      c[i]+=1;
     }
for(i=0;i<s;i++)
 for(j=i+1;j<s;)
 { if(c[i]==c[j])
  {
    for(k=j;k<s-1;++k)
      c[k]=c[k+1];
      --s;
  }else
   ++j;
  }
for(i=0;i<s;i++)
  for(j=0;j<6;j++)
       for(k=0;k<s;k++)
        for(l=0;l<6;l++)
         for(m=0;m<s;m++)
      printf("%c%c%c%c%c\n",c[i],v[j],c[k],v[l],c[m]);
}

There must be some way to shorten this definitely.
Explanation

Stored the integer values of a,e,i,o,u,y in a numerical array,
Stored all alphabets in array, if it was a vowel, replaced it with a consonant, so there were duplicate consonant values in the array,
Removed duplicate consonant values,
Printed all combinations c-v-c-v-c.

If you could put an ungolfed version that would help immensely.

Clojure, 101 bytes
(print(apply str(for[V["aeiouy"]C["bcdfghjklmnpqrstvwxz"]a C b V c C d V e C](str a b c d e "\n")))))

Not that exciting...

Ruby, 65 61 bytes
Completely different approach:
(b=[*?a..?z]-a="aeiouy".chars).product(a,b,a,b){|x|puts x*""}

New things I learned today: the Array#product function

Pyth, 25 23 bytes
s.n*F[K-GJ"aeiouy"JKJKb

In pseudocode:
'                       ' G, b = "abcdefghijklmnopqrstuvwxyz", "\n"
'         J"aeiouy"     ' J = "aeiouy"
'      K-GJ             ' K = "bcdfghjklmnpqrstvwxz"
's.n                    ' "".join( flatten(
'   *F                  '   reduce(cartesian_product,
'     [K           JKJKb'     [K,J,K,J,K,b]
'                       ' # b makes it so that every word ends with \n so that
'                       ' # flattening and concatenating automatically deals with
'                       ' # newlines

Try it online!

C#, 244 242 234 219 bytes
class P{static void Main(){string v="aeiouy",c="bcdfghjklmnpqrstvwxz";int i=0,j,k,l,m;for(;i<20;i++)for(j=0;j<6;j++)for(k=0;k<20;k++)for(l=0;l<6;l++)for(m=0;m<20;)System.Console.Write("\n"+c[i]+v[j]+c[k]+v[l]+c[m++]);}}

Ungolfed:
class P
{
    static void Main()
    {
        string v = "aeiouy", c = "bcdfghjklmnpqrstvwxz";
        int i=0, j, k, l, m;
        for (; i < 20; i++)
            for (j=0; j < 6; j++)
                for (k=0; k < 20; k++)
                    for (l=0; l < 6; l++)
                        for (m=0; m < 20; )
                            System.Console.Write("\n"+c[i]+v[j]+c[k]+v[l]+c[m++]);
    }
}

I doubt I can trim it any further.
Done on C# 5, so no {c[i]}

@dim damn, you are right. Let me rewrite this...

Are you sure this can't be shortened with Linq?

Batch, 185 bytes
@set c=b c d f g h j k l m n p q r s t v w x z
@for %%i in (%c%)do @for %%j in (a e i o u y)do @for %%k in (%c%)do @for %%l in (a e i o u y)do @for %%m in (%c%)do @echo %%i%%j%%k%%l%%m

Batch is so verbose that it costs 4 bytes to put the vowels into a variable.

T-SQL, 276
This answer assumes a query's result set is valid output.
WITH c AS(SELECT*FROM(VALUES('b'),('c'),('d'),('f'),('g'),('h'),('j'),('k'),('l'),('m'),('n'),('p'),('q'),('r'),('s'),('t'),('v'),('w'),('x'),('z'))c(_)),v AS(SELECT*FROM(VALUES('a'),('e'),('i'),('o'),('u'),('y'))v(_))SELECT c._+v._+b._+a._+d._ FROM c,v,c b,v a,c d ORDER BY 1

It works in SQL Server 2008 R2.  I'm not sure currently where you'd be able to run it online given the number of rows returned, though.
One CTE definition holds the consonants from a derived table.  The other holds the vowels from another derived table.  Take the Cartesian product of three consonant CTEs and two vowel CTEs, and you can get an alphabetized list of the appropriately concatenated values.

Nice, just what I was thinking. If you restrict it to SQL 2016 or higher, you can save ~70 bytes by using STRING_SPLIT instead of VALUES.

Jelly, 10 bytes
ØỴ,Øỵṁ5ŒpY

Try it online!

Haskell, 93 bytes
c="bcdfghjklmnpqrstvwxz"
t=[[a,b]|a<-"aeiuoy",b<-c]
main=putStr$unlines[b:y++z|b<-c,y<-t,z<-t]

I have tried to slim the hardcoded lists of consonants and vowels down, but haven't been able to find something that saves bytes. This will output all possible five letter words in the order as stated in the post to stdout, being generated via list comprehensions.

Java, 347 bytes -.-
public class N{public static void main(String[]a){String c="bcdfghjklmnpqrstvwxz";String v="aeiouy";int[]i=new int[5],e=new int[5];e[0]=e[2]=e[4]=20;e[1]=e[3]=6;m:while(true){System.out.println(c.charAt(i[0])+v.charAt(i[1])+c.charAt(i[2])+v.charAt(i[3])+c.charAt(i[4]));int p=4;while(true){++i[p];if(i[p]<e[p])break;i[p]=0;if(p==0)break m;--p;}}}}

Informix-SQL, 254 bytes
an SQL version  (IBM Informix dialect)
select x from table(list{'a','e','i','o','u','y'})(x)
into temp v;
select x from table(list{'b','c','d','f','g','h','j','k',
'l','m','n','p','q','r','s','t','v','w','x','z'})(x)
into temp c;
select k.x||j.x||i.x||v.x||c.x
from c,v,c i,v j,c k
order by 1

J, 52 37 34 33 bytes
echo>,{5$'aeiouy'(-.~;[)u:97+i.26

Try it online!
-1 thanks to Adam's suggestion of u:97+i.26 to replace 26{.97|.a.

u:97+i.26 extract letters a..z from ascii alphabet a.
'aeiouy'(-.~;[) subtract the vowels from a..z, and link ; that (the consonants) to the vowels, creating a boxed list consonants ; vowels.
5$ extent that boxed list cyclically to 5 elements, yielding consonants ; vowels ; consonants ; vowels ; consonants.
{ create the cross product
, flatten
> open the boxes to create regular strings
echo print the results

Brachylog v2, 11 bytes
Ḍ;Ẉj,Ḍ∋ᵐcẉ⊥

Try it online!
Pretty much the same as Fatalize's Brachylog v1 answer.

Shell, 72 64
Try it online! (Thanks @Grimy)
echo {g..z}{a..f}{g..z}{a..f}{g..z}|tr b-z eiouybcdfghj-np-tvwxz

If it must be delimited by newlines (beware of the spaces) 69 bytes Try it online!:
echo {g..z}{a..f}{g..z}{a..f}{g..z}|tr \ b-z \\neiouybcdfghj-np-tvwxz

Original shell, 72 bytes (bash, ksh, zsh, a simple sh may not expand {..}) Try it online!
echo {a..t}{1..6}{a..t}{1..6}{a..t}|tr a-t1-6 bcdfghjklmnpqrstvwxzaeiouy
Less than half a second. Considering that a C equivalent runs in 0.228sec and a perl equivalent takes 2.1 seconds, this is Not slow (times reported as TiO measured them).

64: echo {g..z}{a..f}{g..z}{a..f}{g..z}|tr b-z eiouybcdfghj-np-tvwxz

Zsh, 58 bytes
v=(a e i o u y)
c=(${${:-{b..z}}:|v})
echo $^c$^v$^c$^v$^c

Try it online!
${   :|foo} is set difference, and ${^foo} enables brace expansion over the contents of the array foo.

If newline-delimited is required, 64 bytes:
v=(a e i o u y)
c=(${${:-{b..z}}:|v})
<<<${(F):-$^c$^v$^c$^v$^c}

Try it online!

Vyxal, 8 bytes
k¹k∪"5ẎΠ

Try it Online!
    "    # Pair
k¹       # Consonants
  k∪     # and vowels
     5Ẏ  # Extend to length 5
       Π # Take the cartesian product

K (ngn/k), 40 35 bytes
+x@'!#'x:1_5^[`c$97+!26;]\"aeiouy"

Try it online!
-5 : clever shuffling from @ngn.  Constant alphabet, alternating set differences.

Zsh -P, 54 bytes
v=(a e i o u y)
c=({a..z})
c=(${c:|v})
echo $c$v$c$v$c

Attempt This Online!

Perl 5, 40 bytes
y/aeiouy/1/r=~/\D1\D1\D/&&say for a..1x5

Try it online!

C (gcc), 123 120 117 bytes
-6 bytes thanks to ceilingcat
char w[6];f(n,m,c,p){for(n=457653;c=p=n<1<<24;p&&puts(w))for(m=n++;m;m/=26)p*=!index("aeiouy",w[5-c]=m%26+97)^++c%2;}

Try it online!

MathGolf, 25 16 bytes
╩æ╩¼`┼]m▒ε*mÅ─yn

Try it online!
Definitely not optimal, but this challenge got me to actually implement some features of MathGolf that have been in TODO since forever, mainly string subtraction and vowels/consonants. Once it's up on TIO I'll update this answer. MathGolf has been updated, and I'll add this as a disclaimer that some features used in this answer are newer than the challenge itself.
To fetch consonants and vowels from the dictionary, I filtered out words in the dictionary files which were duplicates, and found that I had 3 duplicates within the top 256 words of the dictionary. I decided that that 2 of these slots should be replaced by the string of consonants and the string of vowels. I was unsure of where "y" should be placed, but decided to place it among the vowels.
The one thing that is not in place is cartesian product for strings. Since I have not defined the output format yet, this feature did not make it into the latest version of MathGolf.
Explanation
╩æ                 fetch dictionary word 145 ("bcdfghjklmnpqrstvwxz")
  ╩¼               fetch dictionary word 172 ("aeiouy")
    `              duplicate the top two items
     ┼             duplicate second item from top and push to top
      ]            end array / wrap stack in array
                   stack is now ["<cons>", "<vow>", "<cons>", "<vow>", "<cons>"]
       m▒          map each element to a list of chars
         ε*        reduce list by multiplication (cartesian product)
           mÅ      explicit map using next 2 operators
             ─     flatten array
              y    join array without separator to string or number
               n   join array with newlines to a string

ink, 224 bytes
LIST V=(a),e,i,o,u,y
LIST C=(b),c,d,f,g,h,j,k,l,m,n,p,q,r,s,t,v,w,x,z
~temp D=C
~temp E=V
~temp F=C
~temp G=V
~temp H=C
-(L){D}{E}{F}{G}{H}
~H++
{H:->L}
~H=C
~G++
{G:->L}
~G=V
~F++
{F:->L}
~F=C
~E++
{E:->L}
~E=V
~D++
{D:->L}

Try it online!

Curry (PAKCS), 57 bytes
v=anyOf"aeiouy"
c=anyOf"bcdfghjklmnpqrstvwxz"
[c,v,c,v,c]

Attempt This Online!

JavaScript (Node.js), 80 bytes
f=(i=5,s)=>i?[...i%2?'bcdfghjklmnpqrstvwxz':'aeiouy'].flatMap(e=>f(i-1,[s]+e)):s

Try it online!
JavaScript (Node.js), 99 bytes
f=(i=5,s='',j=35,c=j.toString(36))=>+c?'':i?f(i,s,j-1)+(i%2^/[aeiouy]/.test(c)?f(i-1,s+c):''):s+' '

Try it online!

Regenerate -a, 82 bytes
[bcdfghjklmnpqrstvwxz][aeiouy][bcdfghjklmnpqrstvwxz][aeiouy][bcdfghjklmnpqrstvwxz]

Attempt This Online!
Unfortunately, there's no clever way to do this in Regenerate--just gotta list all the options.


text:
Symbolic matrix multiplication
There are lots of different ways to explain matrix multiplication. I'll stick with a single figure since I believe most people here are familiar with it (and the figure is very descriptive). If you want more detailed information, I suggest you visit the Wikipedia-article, or the explanation on WolframMathWorld.
Simple explanation:
Suppose you have two matrices, A and B, where A is 3-by-2, and B is 2-by-3. If you perform matrix multiplication on these to matrices, either AB, or BA you'll get the results below:

Challenge:
Implement symbolic matrix multiplication in you language. You shall take two matrices as input, where each element in the matrices are represented by an non-whitespace ASCII-character (code points 33-126). You must output the product of these matrices.
Rules regarding output:
A product of two entries shall not have any symbols in between. It's ab, not a*b, a·b, times(a,b) or something similar. It's aa, not a^2.
The sum of terms should have a space (ASCII code point 32) in between. It's a b, not a+b, plus(a,b) or something similar.
The rationale for those two rules is: All non white space characters are allowed as symbols in the matrices, thus using them as mathematical symbols would be messy. So, what you could normally write as a*b+c*d will be ab cd.
You may choose the order of the terms. ab cd, dc ab and cd ba are mathematically speaking the same, so you can choose the order here too. The order need not be consistent as long as it's mathematically correct.
Rules regarding matrix formatting:
A matrix can be entered in whatever format you like, except a single string with no delimiters between rows (this is because the output would be completely messed up). Both matrices must be inputted on the same format. All the examples below are valid ways of entering and outputting a matrix.
"ab;cd"     <- This will look awful, but it's still accepted.

"a,b\nc,d"

[[a,b],[c,d]]

[a, b]
[c, d]

I'm aware that this allows a lot of formats that will look messy, but the challenge is about multiplying matrices, not formatting the output.
General rules:

You may assume valid input. Matrix multiplication will always be possible with the given dimensions.
There will only be two matrices.
You may assume that the matrices are non-empty
Built-in functions are accepted (but probably a bit cumbersome due to the formatting requirements).
You may of course use escape characters in the input if necessary (\' instead of ').
Any standard input and output method is OK.

Test cases:
The two input matrices are shown with an empty line in between. The output is shown after Output:. When there are two output matrices then it's just to show other outputs that would be accepted.
Test case #1
Inputs:
[a]

[b]

Output:
[ab]
[ba]      <- Also OK

Test case #2
Inputs:
[a, b]
[1, 4]
[y, {]

[%, 4, 1]
[a, b, c]

Output:
[a% ba, a4 bb, a1 bc]
[1% 4a, 14 4b, 11 4c]
[y% {a, y4 {b, y1 {c]

Test case #3:
Inputs:
[1, 2, 3, 4]
[5, 6, 7, 8]
[9, 1, 2, 3]
[4, 5, 6, 7]

[a]
[b]
[c]
[d]

Output:
[1a 2b 3c 4d]
[5a 6b 7c 8d]
[9a 1b 2c 3d]
[4a 5b 6c 7d]

[d4 c3 b2 a1]      <-- Also OK
[d8 c7 b6 a5]
[1b 9a c2 3d]
[a4 b5 d7 6c]

If your response to the rules about requiring ab cd instead of a*b+c*d is: you should avoid cumbersome input/output formats, then I'd like note that the input and output formats are very flexible. The fact that you can't use * and + for products and sums might make it harder to use a simple built-in, but I don't consider that negative thing.

For a function, is taking two 2D arrays of strings and returning a 2D array of strings acceptable?

Yes, no problem. But the dimensions must match, you can't have the second input be transposed. Did that make sense?

It did, thanks for clarifying. One last question: Could I also take a 2D array of characters as input and return a 2D array of strings?

@Dennis, I wrote: "Both matrices must be inputted on the same format." I forgot to mention the output matrix there, so I'll just keep it like this. The inputs must be on the same format but you may have a different output format. (I don't really like that solution, but I don't want to change stuff now, I think there's one answer already that has different input and output formats)

If you mean the Ruby answer, I checked and that one works just as well with strings instead of characters.

If it's ok with you and no one has used different formats yet, then I'd like to say the format must be the same. I'm on my phone and a bit busy so I can't go through and check the solutions now.

I'm OK with that, but I'm not sure about the Mathematica, APL, and Clojure answers.

@Dennis Not sure about what?

@Adám Not sure if inputs and output use the exact same format.

@Dennis Of course they don't. That would be impossible in any language.

@Adám Well, one has strings/character arrays of length 1 and the other strings of length 2, but apart from that.

@Dennis My solution can take either matrices of scalars or matrices of vectors.

Haskell, 62 61 59 bytes
e=[]:e
z=zipWith
a!b=[unwords.z(++)r<$>foldr(z(:))e b|r<-a]

Try it online!
Example usage:
Prelude> [["a","b"],["c","e"]] ! [["f","g"],["h","i"]]
[["af bh","ag bi"],["cf eh","cg ei"]]

I found a way to get a transpose function in one byte shorter than using the import.
import Data.List;transpose
e=[]:e;foldr(zipWith(:))e

As the code then uses zipWith twice, two more bytes can be saved with the abbreviation z=zipWith.

Old version with import: (62 bytes)
import Data.List
a!b=[unwords.zipWith(++)r<$>transpose b|r<-a]

Try it online!
This is quite similar to my answer to non-symbolic matrix multiplication: a!b=[sum.zipWith(*)r<$>transpose b|r<-a], substituting the multiplication (*) with string concatenation (++) and sum with unwords which concatenates a list of strings with a space in between. The import is needed for the transpose function, so all in all the transposition of the second matrix uses up half of the bytes ...

Old version without import: (64 bytes)
a![]=[];a!b=(unwords.zipWith(++)[h|h:_<-b]<$>a):a![s:t|_:s:t<-b]

Try it online!
With the import and transpose function taking up so much bytes, I tried solving the task without import. So far this approach turned out being two bytes longer, but it might be more golfable. Edit: The other approach at the top now beats the import!
The list comprehension [s:t|_:s:t<-b] gets the non-empty tails of the lists in b, using just [t|_:t<-b] to get the tails would be 4 bytes shorter (even beating the import version) but append an empty row like ["","",""] to the matrix which I suppose is not allowed.

Ruby, 61 bytes
->a,b{a.map{|x|b.transpose.map{|y|x.zip(y).map(&:join)*' '}}}

Sample run:
main(0):007> ->a,b{a.map{|x|b.transpose.map{|y|x.zip(y).map(&:join)*' '}}}[[[?a, ?b], [?1, ?4], [?y, ?{]], [[?%, ?4, ?1], [?a, ?b, ?c]]]
=> [["a% ba", "a4 bb", "a1 bc"], ["1% 4a", "14 4b", "11 4c"], ["y% {a", "y4 {b", "y1 {c"]]

->a,b{
a.map{|x|            # for each row of a
b.transpose.map{|y|  # and for each column of b
x.zip(y)             # match up corresponding elements
.map(&:join)         # join each pair together
*' '                 # join the entire thing on space
}}}

Mathematica, 36 bytes
Inner[#<>#2&,##,StringRiffle@*List]&

Inner is a generalisation of Mathematica's Dot (i.e. the usual matrix/vector product). It generalises the dot product by letting you provide two function f and g, which will be used in place of the usual multiplication and addition, respectively. We're replacing the multiplication with #<>#2& (which joins the the two characters into a single string) and the addition with StringRiffle@*List, which first wraps all the summands in a list, and then StringRiffle joins them together with spaces.
One could potentially use the Dot operator . and then transform the result, but the trouble is that things like "a"*"a" would immediately get transformed into "a"^2 (same for sums), which would be annoying to pick apart again.

Clojure, 53 bytes
#(for[a %](for[b(apply map vector %2)](map str a b)))

Running with arguments [["a" "b"]["c" "e"]] and [["f" "g"]["h" "i"]] returns ((("af" "bh") ("ag" "bi")) (("cf" "eh") ("cg" "ei"))). This is actually shorter than the numeric version.

Jelly, 7 bytes
Z;"þK€€

This is a dyadic link that takes B and A as arguments (in that order) and returns AB. Input and output are in the form of 2D arrays of strings, which are actually 3D arrays of characters. A further byte could be saved by taking 2D arrays of characters as input. I'm not sure if that's allowed.
Try it online!
It's a bit hard to determine what Jelly does under the hood when strings are involved, since it does a lot of splattening before printing. This is how Jelly represents input and output internally.
How it works
Z;"þK€€  Dyadic link. Left argument: B. Right argument: A

Z        Zip/transpose B.
 ;"þ     Table vectorized concatenation; for each row in B' and each row in A,
         concatenate the corresponding strings.
    K€€  Join the arrays that correspond to the rows of A by spaces.

Dyalog APL, 10 bytes
Takes matrices of characters as left and right arguments. Returns matrix of lists of characters. (APL represents strings as lists of characters.)
{∊⍺' '⍵}.,

TryAPL online!
Normal inner product is in APL +.×, but the addition and multiplication can be any functions, in particular:
Addition has been replaced by
{ an anonymous function:
 ∊ the flattened
 ⍺ ' ' ⍵ list consisting of the left argument, a space, and the right argument ⍵
}
Multiplication has been replaced by concatenation, ,

Prolog, >256 Bytes
I am using { _ | _ } which is a findall/3, _ [ _ , _ ] which is some arg/3, and sum(_) which is some aggregate. They can all be used inside is/2:
*(X, Y, Z) :- functor(Y, matrice, _), L is len(X[1]), L =:= len(Y), !,
   M is len(X), N is len(Y[1]),
   Z is { { sum({ X[J,K] * Y[K,I] | between(1,L,K) })
                                  | between(1,N,I) }
                                  | between(1,M,J) }.

Together with the extra definitions for the aforementioned predicates and the non-standard is/2 that can return more than numbers, its sure >256 bytes.

JavaScript (ES6), 65 bytes
(a,b)=>a.map(c=>b[0].map((_,j)=>c.map((e,i)=>e+b[i][j]).join` `))

Takes input as two 2D arrays of characters and returns a 2D array of strings. Add 10 bytes to support input as two 1D arrays of strings.

Pyth, 14 bytes
clQmj;sMCd*QCE

A program that takes input of two newline-separated two-dimensional lists of characters and prints a two dimensional list of strings.
Test suite
How it works
[Explanation coming later]

Pip, 17 bytes
{Y Zb{a._JsMy}Ma}

This is a function that takes two nested lists of (single-character) strings and returns a nested list of strings. Try it online! (with two test cases).
Explanation
Arguments to a {}-delimited function are assigned to the local variables a to e. The first argument of a lambda function is represented by _.
{               }  Define a function:
   Zb              Zip rows of b, transposing it
 Y                 Yank into global variable y for access in nested function
     {       }Ma   To the rows of a, map this function:
           My       To the rows of y (i.e. columns of b), map this function:
      a._           Concatenate, itemwise, the current row of a and row of y
         Js         Join the resulting list on space
                   The result of the outer map operation is returned

source: Stack Exchange

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

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

sort: votes


text:
Arranging Bubbles
Note, challenge copied from question asked at math.stackexchange.
Recently, I attained quite some skill at blowing bubbles. At first I would blow bubbles like this:

But then things started getting strange:

After a while, I was blowing some pretty weird bubbles:

After blowing hundreds, maybe even thousands of such bubbles, my forehead suddenly wrinkled with the question: Given n bubbles, how many different ways can you arrange them? For example if n = 1, there is only 1 arrangement. If n = 2, there are 2 arrangements. If n = 3, there are 4 arrangements. If n = 4, there are 9 arrangements.
Here are the 9 arrangements of 4 bubbles:

After blowing all of these marvelous bubbles, I decided that I should share the delight of counting their arrangements with you. So here is your task:

Goal
Write a program, function, or similar that counts the number of ways you can arrange n bubbles.

Input
n, the number of bubbles. n > 0

Output
The number of ways you can arrange these bubbles.

Winning Criteria
It would be really cool if we can blow a bubble around your code. The smaller you make your code, the easier it will be to do so. So the person who makes the code with the least number of bytes will win the contest.

Extra information
OEIS

If the bubbles may intersect it is an open problem, with 173 solutions for n=4.

@orlp Fortunately, these bubbles do not intersect.

Is 0 a valid input?

@KenY-N Yes. There is already an OEIS link at the bottom

Oops! Delete stupid comment time...

@MartinEnder No

This reminds me of the Numberphile video How many ways can circles overlap?

Python 2, 92 87 bytes
a=lambda n:n<2or sum((k%d<1)*d*a(d)*a(n-k)for k in range(1,n)for d in range(1,1+k))/~-n

In plain english: to compute a(n) we calculate d*a(d)*a(n-k) for every divisor d of every positive integer k smaller than or equal to n, sum all these, and divide by n-1.
To make it run faster, run in Python 3 (replacing / with // in the above function) and memoize:
import functools
a = functools.lru_cache(None)(a)

If you do this it computes a(50) = 425976989835141038353 instantly.

Wow, that's cool. I assume that lru_cache() memoizes the function?

@PatrickRoberts Yep, usually it's used as a function decorator, but you can also apply it manually to a function.

@PatrickRoberts Here are the docs for lru_cache.

This function returns True for n<2. I guess that's ok for n=1, since in Python True evaluates to 1 in numeric contexts, but a(0) should return 0. You could fix that with n<2 and n or sum... but there may be a more compact way.

I guess an argument can be made that there's one way to arrange zero bubbles, but that's not consistent with A000081. OTOH, if we only need to solve for positive n then we can safely ignore this corner case, since it doesn't impact the recursive calls for higher n.

a(0) should most definitely not return 0. There is exactly one way of arranging zero bubbles. This is consistent with for example 0! = 1.

GNU Prolog, 98 bytes
b(x,0,x).
b(T/H,N,H):-N#=A+B+1,b(H,A,_),b(T,B,J),H@>=J.
c(X,Y):-findall(A,b(A,X,_),L),length(L,Y).

This answer is a great example of how Prolog can struggle with even the simplest I/O formats. It works in true Prolog style via describing the problem, rather than the algorithm to solve it: it specifies what counts as a legal bubble arrangement, asks Prolog to generate all those bubble arrangements, and then counts them. The generation takes 55 characters (the first two lines of the program). The counting and I/O takes the other 43 (the third line, and the newline that separates the two parts). I bet this isn't a problem that the OP expected to cause languages to struggle with I/O! (Note: Stack Exchange's syntax highlighting makes this harder to read, not easier, so I turned it off).
Explanation
Let's start with a pseudocode version of a similar program that doesn't actually work:
b(Bubbles,Count) if map(b,Bubbles,BubbleCounts)
                and sum(BubbleCounts,InteriorCount)
                and Count is InteriorCount + 1
                and is_sorted(Bubbles).
c(Count,NPossibilities) if listof(Bubbles,b(Bubbles,Count),List)
                       and length(List,NPossibilities).

It should be fairly clear how b works: we're representing bubbles via sorted lists (which are a simple implementation of multisets that causes equal multisets to compare equal), and a single bubble [] has a count of 1, with a larger bubble having a count equal to the total count of the bubbles inside plus 1. For a count of 4, this program would (if it worked) generate the following lists:
[[],[],[],[]]
[[],[],[[]]]
[[],[[],[]]]
[[],[[[]]]]
[[[]],[[]]]
[[[],[],[]]]
[[[],[[]]]]
[[[[],[]]]]
[[[[[]]]]]

This program is unsuitable as an answer for several reasons, but the most pressing is that Prolog doesn't actually have a map predicate (and writing it would take too many bytes). So instead, we write the program more like this:
b([], 0).
b([Head|Tail],Count) if b(Head,HeadCount)
                    and b(Tail,TailCount)
                    and Count is HeadCount + TailCount + 1
                    and is_sorted([Head|Tail]).
c(Count,NPossibilities) if listof(Bubbles,b(Bubbles,Count),List)
                       and length(List,NPossibilities).

The other major problem here is that it'll go into an infinite loop when run, because of the way Prolog's evaluation order works. However, we can solve the infinite loop by rearranging the program slightly:
b([], 0).
b([Head|Tail],Count) if Count #= HeadCount + TailCount + 1
                    and b(Head,HeadCount)
                    and b(Tail,TailCount)
                    and is_sorted([Head|Tail]).
c(Count,NPossibilities) if listof(Bubbles,b(Bubbles,Count),List)
                       and length(List,NPossibilities).

This might look fairly weird – we're adding together the counts before we know what they are – but GNU Prolog's #= is capable of handling that sort of noncausal arithmetic, and because it's the very first line of b, and the HeadCount and TailCount must both be less than Count (which is known), it serves as a method of naturally limiting how many times the recursive term can match, and thus causes the program to always terminate.
The next step is to golf this down a bit. Removing whitespace, using single-character variable names, using abbreviations like :- for if and , for and, using setof rather than listof (it has a shorter name and produces the same results in this case), and using sort0(X,X) rather than is_sorted(X) (because is_sorted isn't actually a real function, I made it up):
b([],0).
b([H|T],N):-N#=A+B+1,b(H,A),b(T,B),sort0([H|T],[H|T]).
c(X,Y):-setof(A,b(A,X),L),length(L,Y).

This is fairly short, but it's possible to do better. The key insight is that [H|T] is really verbose as list syntaxes go. As Lisp programmers will know, a list is basically just made of cons cells, which are basically just tuples, and hardly any part of this program is using list builtins. Prolog has several very short tuple syntaxes (my favourite is A-B, but my second favourite is A/B, which I'm using here because it produces easier-to-read debug output in this case); and we can also choose our own single-character nil for the end of the list, rather than being stuck with the two-character [] (I chose x, but basically anything works). So instead of [H|T], we can use T/H, and get output from b that looks like this (note that the sort order on tuples is a little different from that on lists, so these aren't in the same order as above):
x/x/x/x/x
x/x/x/(x/x)
x/(x/x)/(x/x)
x/x/(x/x/x)
x/(x/x/x/x)
x/x/(x/(x/x))
x/(x/x/(x/x))
x/(x/(x/x/x))
x/(x/(x/(x/x)))

This is rather harder to read than the nested lists above, but it's possible; mentally skip the xs, and interpret /() as a bubble (or just plain / as a degenerate bubble with no contents, if there's no () after it), and the elements have a 1-to-1 (if disordered) correspondence with the list version shown above.
Of course, this list representation, despite being much shorter, has a major drawback; it's not built into the language, so we can't use sort0 to check if our list is sorted. sort0 is fairly verbose anyway, though, so doing it by hand isn't a huge loss (in fact, doing it by hand on the [H|T] list representation comes to exactly the same number of bytes). The key insight here is that the program as written checks to see if the list is sorted, if its tail is sorted, if its tail is sorted, and so on; there are a lot of redundant checks, and we can exploit that. Instead, we'll just check to ensure that the first two elements are in order (which ensures that the list will end up sorted once the list itself and all its suffixes are checked).
The first element is easily accessible; that's just the head of the list H. The second element is rather harder to access, though, and may not exist. Luckily, x is less than all the tuples we're considering (via Prolog's generalized comparison operator @>=), so we can consider the "second element" of a singleton list to be x and the program will work fine. As for actually accessing the second element, the tersest method is to add a third argument (an out argument) to b, that returns x in the base case and H in the recursive case; this means that we can grab the head of the tail as an output from the second recursive call to B, and of course the head of the tail is the list's second element. So b looks like this now:
b(x,0,x).
b(T/H,N,H):-N#=A+B+1,b(H,A,_),b(T,B,J),H@>=J.

The base case is simple enough (empty list, return a count of 0, the empty list's "first element" is x). The recursive case starts out the same way as before (just with the T/H notation rather than [H|T], and H as an extra out argument); we disregard the extra argument from the recursive call on the head, but store it in J in the recursive call on the tail. Then all we have to do is ensure that H is greater than or equal to J (i.e. "if the list has at least two elements, the first is greater than or equal to the second) in order to ensure that the list ends up sorted.
Unfortunately, setof throws a fit if we try to use the previous definition of c together with this new definition of b, because it treats unused out parameters in more or less the same way as an SQL GROUP BY, which is completely not what we want. It's possible to reconfigure it to do what we want, but that reconfiguration costs characters. Instead, we use findall, which has a more convenient default behaviour and is only two characters longer, giving us this definition of c:
c(X,Y):-findall(A,b(A,X,_),L),length(L,Y).

And that's the complete program; tersely generate bubble patterns, then spend a whole load of bytes counting them (we need a rather long findall to convert the generator to a list, then an unfortunately verbosely named length to check the length of that list, plus the boilerplate for a function declaration).

"Prolog doesn't actually have a map predicate ": Prolog does have the maplist/2-8predicate, though I'm not sure this will makes things shorter here.

@Fatalize: Huh, looks like that was added in a newer version. It's not in the documentation for the install I have, and it doesn't work in practice: | ?- maplist(reverse,[A,B]). uncaught exception: error(existence_error(procedure,maplist/2),top_level/0)

That's really strange; maplist is a very commonly used predicate that is provided in the major Prolog distributions (like SWI-Prolog and SiCStus)

Mathematica, 68 bytes
I bet this can be beaten (even in Mathematica) with a from-scratch implementation, but here's the builtin version:
<<NumericalDifferentialEquationAnalysis`
Last@ButcherTreeCount[#+1]&

ButcherTreeCount is 0-indexed, hence the [#+1], and returns a list of all values up to its argument, hence the Last@. But otherwise it's just the builtin for this function. However, it requires loading a package, which is what the first line does.

"Of course Mathematica has a builtin for that."

APL (Dyalog Unicode), 40 bytes
{1≥⍵:⍵⋄w÷⍨+/∊(0=v|⊂⌽v)×v××∘⊂⍨∇¨v←⍳w←⍵-1}

Try it online!
A port of orlp's Python 2 answer, using a vector of nested vectors in place of nested for-loops.
How it works
{1≥⍵:⍵⋄w÷⍨+/∊(0=v|⊂⌽v)×v××∘⊂⍨∇¨v←⍳w←⍵-1}  ⍝ Input: n
{1≥⍵:⍵⋄                                }  ⍝ If n≤1, return n; otherwise,
                                  w←⍵-1   ⍝ w←n-1
                               v←⍳w       ⍝ v←1..n-1
                             ∇¨  ⍝ a←Recursive call on each of v; a(1), .., a(n-1)
                         ×∘⊂⍨    ⍝ Multiply each of a with a, giving nested array
                                 ⍝ where [d][n-k] will contain the desired value at each iteration in Python code
                       v×  ⍝ Multiply each of v (the value of d) with each row of the above
                      ×    ⍝ Multiply each with
             (0=v|⊂⌽v)     ⍝ 1 if n-k is divisible by d, 0 otherwise
       w÷⍨+/∊  ⍝ Flatten, sum, and divide by n-1

The right man for the job

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


text:
All squares that match a wildcard sequence
This was inspired by part of the 2016 ARML competition Team Problem #6.
Here's the challenge:
You're given a "wildcard sequence", which is a sequence of digits and another character. A string matches this wildcard sequence by the following pseudocode:
w = wildcard
s = string
# s matches w iff
for all 0 >= i > wildcard.length, w[i] == '?' or s[i] == w[i]

Where '?' is a character of your choice.
In terms of regex, just imagine the '?' to be '.'.
The challenge is to find all square numbers (the requirement is up to 1 million) whose decimal string representations match this wildcard sequence. The "wildcard character" can be any ASCII character of your choice, as long as it isn't a digit, obviously.
For example, 4096 matches 4**6 and 4*9* but 4114 does not match either.
Input
Input will be given as a sequence matching the regex [0-9?]+. This can be a string, a character array, or a byte array of the characters in ASCII.
Output
Output will be a whatever-you-want-delimited list/set/array of numbers which are perfect squares and match the wildcard sequence.
Examples of valid inputs:
1234567*90
1234567?90
1234567u90
['1', '2', '3', '4', '5', '6', '7', '*', '9', '0']
[49, 50, 51, 52, 53, 54, 55, 42, 57, 48]
[1, 2, 3, 4, 5, 6, 7, '*', 9, 0]

Examples of valid outputs:
[1, 4, 9]
1 4 9
1, 4, 9
1-4-9

etc.
Specifications

You may not use builtins for finding a list of squares in a certain range
Standard Loopholes Apply
You must be able to handle up to 1 000 000 (1 million)
If provided with the input 1******, it is correct to print [1000000]. It is also correct to print [1000000, 1002001, 1004004, 1006009, 1008016, 1010025, ...]
Wildcard sequences will never start with the wildcard character; that is, they will always match strings of the same length.

Test Cases
4**6  ->  [4096, 4356]
1**1  ->  [1521, 1681]
1**  ->  [100, 121, 144, 169, 196]
9****9  ->  [908209, 915849, 927369, 935089, 946729, 954529, 966289, 974169, 986049, 994009]
9*9***  ->  [919681, 929296]
1**0*  ->  [10000, 10201, 10404, 10609, 12100, 14400, 16900, 19600]
9***4  ->  [91204, 94864, 97344]

Winning
Shortest (valid) (working) submission by February 14th, tie-break by earliest submission winning.

I think a good start to making this clearer would be to specify that ? is to be chosen by the answerer.

Why is 25 a valid answer for *** but not for *2*?

I think this would be cleaner if the numbers never had leading zeroes, so only matched sequences of their length.

@Neil That would be a problem with my own solution. I'll take xnor's suggestion.

Can the input be an array of one-digit integers and the special character, such as {4, "w", "w", 6} (or better yet, {4, w, w, 6}), rather than an array of characters, such as {"4", "w", "w", "6"}?

@GregMartin Sure. I'll add that into the challenge.

@WheatWizard I've changed the explanation. Does it make more sense now?

@AlexL. I think figured out the challenge before the change was made but to be honest I don't know if the edit helps terribly much.  I think all that was needed was an explanation of what a wildcard sequence was and a little more clarification about the output.  Until I read it a fourth or fifth time I didn't know that "squares" meant square numbers.

@WheatWizard ohhhhhh Whoops, I made the classic mistake of reading what I thought instead of what I actually read.

"The challenge is to find all square numbers whose decimal string representations match this wildcard sequence" and "If provided with the input 1******, it is correct to print [1000000]" contradict each other.

@PeterTaylor That is a good point. I should clariy that.

05AB1E, 22 bytes
Probably plenty of room for improvement here.
Any non-digit is okay as wildcard.
3°LnvyS¹)ø€Æ0QPyg¹gQ&—

Try it online!
Explanation to come after further golfing.

This appears to work for all inputs. Good job.

Mathematica, 44 bytes
Print@@@IntegerDigits[Range@1*^3^2]~Cases~#&

The input is a list of digits with a _ (no quotes) as a wildcard. e.g. {4, _, _, 6}
Explanation
Range@1*^3

Generate list {1, 2, 3, ... , 1000}
... ^2

Square it. (list of all squares from 1 to 1,000,000)
IntegerDigits[ ... ]

Split each square into a list of digits.
... ~Cases~#

Find the ones that match the pattern specified by the input.
Print@@@ ...

Print them.

This appears to work for all test cases. Good job.

Brachylog, 23 bytes
@e:{@$|,}a#0:{c.~^#I,}f

Try it online!
Explanation
@e                        Split into a list of characters
  :{@$|,}a                Replace each digit char by the corresponding digit, and each things
                            that are ot digits into variables
          #0              All elements of the resulting list must be digits
            :{       }f   Output is the result of finding all...
              c.            ...concatenations of those digits which...
               .~^#I,       ...result in a number which is the square of an integer #I

Different input format, 13 bytes
Depending on what your consider valid as input, you could do this:
#0:{c.~^#I,}f

Try it online!
which is basically the second part of the answer above, with a list as input containing digits and variables where the wildcards are.
I don't consider this valid though because there are only 26 variable names in Brachylog (the uppercase letters), so this would not work if you had more than 26 wilcards.

This appears to work for all inputs. Good job. However, I would consider this to be 24 bytes because a 1-byte argument is required. I'm not sure how scoring for this would work though.

@AlexL. The argument is only there to tell the name of the output variable (you can use another uppercase letter if you want). This is similar to answers in Prolog/languages with functions where the predicate/function is named but you don't actually count the bytes you use when you call it.

Okay. I'm not sure if one should score it as 24 since the argument is necessary (otherwise it just returns true.), but I haven't used languages that require this before. I'll try to find some reference to determine how I should score this, but it would make sense to score it as 23, so I'll keep it at that.

Ruby, 54 bytes
Function that takes a string argument. Try it online.
->s{(0..1e3).map{|i|"#{i**2}"[/^#{s.tr ?*,?.}$/]}-[p]}

You could save a byte by using i*i instead of i**2

This doesn't appear to work because the second # is making the rest of the line a comment.

@AlexL Oh, it works all right. https://repl.it/FJCV

ohhhh okay I just didn't know how to test Ruby. My apologies. This appears to work for all input. Good job!

Perl 6, 30 26 bytes
Thanks to @b2gills for -4 bytes!

{grep /^<$_>$/,map * **2,^1e4}

{grep /^<$_>$/,(^1e4)»²}

Uses the dot as wildcard character, so that the input can be used as a regex:
{                            }   # a lambda
                         ^1e4    # range from 0 to 9999
               map * **2,        # square each value
 grep /      /,                  # filter numbers that match this regex:
        <$_>                     #   lambda argument eval'ed as sub-regex
       ^    $                    #   anchor to beginning and end

Try it online.
A variant that accepts the asterisk as wildcard (as suggested by a previous revision of the task description) would be 42 bytes:
{grep /^<{.trans("*"=>".")}>$/,(^1e4)»²}

I've restated the rules, and you can choose any wildcard character. I'm scoring this as 38 bytes.

Um, how do you use this? I don't know anything about Perl.

@AlexL.: Thanks, I've updated the answer (and added an explanation too). It's a lambda; you could call it directly (e.g. { ... }("9*9***")), or assign it to a variable/symbol for later use. Note that Perl 6 is a separate language from Perl, so it won't work with a Perl interpreter.

I used sudo apt-get install rakudo to get a supposed Perl6 interpreter... When I put perl6 as a command into my terminal, it starts what seems to be a Perl6 interpreter, but I don't know how to use it. I know it's a lambda, but I don't know how to call it.

@AlexL.: I added a "Try it online" link which shows it as a full script that you can run as perl6 foo.p6. You can also test it in a shell oneliner, like perl6 -e 'say {grep /^<$_>$/,map * **2,^1e4}( "9.9..." )'

This appears to work for all test cases. Good job.

This can be shortened to 26 bytes {grep /^<$_>$/,(^1e4)»²}

@BradGilbertb2gills: Neat, thanks!

JavaScript (ES6), 68 66 bytes
EDIT: Updated my solution below after being inspired by JungHwan Min's answer. It is now ES6 compliant.
Takes input in the format '1..4' where . is the wildcard.
Instead of iterating to 1e6 and square rooting this one iterates to 1e3 and squares.
p=>[...Array(1e3)].map((_,n)=>''+n*n).filter(n=>n.match(`^${p}$`))

F=p=>[...Array(1e3)].map((_,n)=>''+n*n).filter(n=>n.match(`^${p}$`))

const update = () => {
  console.clear();
  console.log(F(input.value));
}

submit.onclick = update;
update();
<input id="input" type="text" value="9....9" style="width: 100%; box-sizing: border-box" /><button id="submit">submit</button>

JavaScript (ES7), 71 69 bytes
p=>[...Array(1e6).keys()].filter(n=>n**.5%1?0:(''+n).match(`^${p}$`))

Creates an array of numbers from 0 to 1e6 then filters it by numbers that are square and match the pattern.
It is horrendously slow because it always iterates to 1e6.

F=p=>[...Array(1e6).keys()].filter(n=>n**.5%1?0:(''+n).match(`^${p}$`))

const update = () => {
  console.clear();
  console.log(F(input.value));
}

submit.onclick = update;
update();
<input id="input" type="text" value="9....9" style="width: 100%; box-sizing: border-box" /><button id="submit">submit</button>

I don't think ** is working, because it's giving me a "SyntaxError: expected expression, got '*'".

@AlexL. The rules seem to have changed. The previous rules suggested I could choose the wildcard character.

You only need to support up to 1e6...

Additionally, I changed the rules back; the issue isn't with the rules, it's because the ** operator doesn't exist, at least not with my system.

@AlexL. Ah sorry I thought you meant the input **. Yes it is ES7 I will update title here is a list of currently supported browsers https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Browser_compatibility

Okay. That clarifies the issue.

This appears to work for all test cases. Good job.

up to 1 million should mean managing 1 million too. It fails for 1...... (not hard to fix)

and using match instead of !search should save 2 bytes

@edc65 Thanks didn't realise that did string to regex conversion too.

Perl, 42 45 38 bytes
EDIT: clarification by Alex, we can use the period as wildcard character which shaves off the y// operation.
perl -pe 's|.*|@{[grep/^$&$/,map$_*$_,1..1e3]}|'

EDIT: solution that uses the asterisk as wildcard character and expects the wildcard sequence on STDIN
perl -pe 'y/*/./;s|.*|@{[grep/^$&$/,map$_*$_,1..1e3]}|'

This one leaves undoubtedly a lot of room for improvement, it's pretty straightforward. The wildcard expression is expected as command line argument, with the period wildcard character (what else?).
say"@{[grep/^$ARGV[0]$/,map$_*$_,1..1e3]}"

The question specifies that wildcards are given as asterisks. Did an earlier revision of the question allow choosing your own wildcard character?

@smls: The question still specifies choose your own wildcard although it is not in the rule section: The character used as the wildcard doesn't necessarily need to be an asterisk, it can be any ASCII character of your choice, as long as it isn't a digit, obviously.

Yes, I got confused by that. Later on, it clearly says the wildcard character needs to be an asterisk. I guess the definition with the regex is leading. I'll revise my solution.

Hm actually, the sentence quoted by @Emigna is pretty clear that we can choose our own wildcard character, isn't it?

To clarify, the wildcard character can be whatever you want. I accidentally messed up the rules when restating the explanation.

@Alex L: thanks for the clarification. Could you edit the rules so that it's clear? I tried to comment there but as a newbie I couldn´t.

This appears to work for all inputs. Good job.

Batch, 109 bytes
@for /l %%i in (0,1,999)do @set/aj=%%i*%%i&call copy nul %%j%%.%%j%%$>nul
@for %%s in (%1.%1$)do @echo %%~ns

Uses ? as the wildcard. Works by creating 1000 files. The name of the file is the square number, and the extension of the file is the square number with a $ suffixed. This is because Batch's pattern matching counts trailing ?s as optional, so 1? will match both 1 and 16; the $ therefore forces the match to be exact. However, we don't want to output the $, so we just output the file name only without extension.

Python 3 - 98 97 bytes
import re;print(re.findall(r"\b"+input()+r"\b",("\n".join([str(x*x) for x in range(1,1001)]))))

Requires input like '4..6'.

You can save 3 bytes by using import re and re.findall; the optimization with the from...import * doesn't actually optimize it in this case.

Provided input 1...., it gives 1 4 9 and 16 25 as valid answers, which is not correct. Please correct your program.

Fixet the case by joining on "\n".

This doesn't work for 1....... It returns [], but it should give [1000000]. This can be fixed at a cost of 0 bytes by using range(0, 1001) rather than range(0, 1000).

Good point, I just checked all the test cases from the description :)

This appears to work for all input. Good job.

k - 28 characters
{s(&:)($:s:s*s:!1001)like x}

Uses ? as the wildcard character. The like function uses ? as a wildcard, and this function makes a list of the first 1001 squares (to be inclusive to 1M), casts them all to strings, and then checks where they match the pattern.
    {s(&:)($:s:s*s:!1001)like x} "1??"
100 121 144 169 196

I'm getting this error for it: type error {s(&:)($:s:s*s:!1001)like x} "1" at execution instance 2 of ":". Could you provide a link to a working test suite or see if there's a problem?

@AlexL. It works for me in kdb+'s k mode

Hmm. I'll try testing it with different interpreters.

bash + Unix utilities, 33 bytes
dc<<<'0[2^pv1+lax]dsax'|grep ^$1$

This uses '.' as the wildcard character.
The dc program prints the square numbers in an infinite loop:
0     Push 0 on the stack.

[     Start a macro (called a).

2^    Square the number at the top of the stack.

p     Print the number at the top of the stack, followed by a newline.

v     Replace the number at the top of the stack (a square number) with its square root.

1+    Increment the number at the top of the stack.

lax   Run the macro again (looping).

]     End of the macro.

dsax  Store the macro in register a and run it.

The dc output is piped to grep, which prints just the squares that match the required pattern.
This works when I run it on an actual Linux or OS X system (but it doesn't work at TIO, probably because the dc program tries to recurse forever, and I suspect TIO runs out of stack space for the recursion and/or has a problem with the never-ending pipe).

I'm running this with Linux Mint 17.3 Rosa, and it's not terminating. I think the problem is with the never-ending dc command.

I suspect it's actually the buffering that's causing the issue. I don't have that version of Linux, but you could try replacing the grep with   grep --line-buffered    (to cause each line to be printed as it's grepped).  [Of course, that adds a number of bytes.]

I added the grep argument, but it doesn't make a difference. I tried putting the --line-buffered on either side of the ^$1$, but it doesn't work either way.

@AlexL.Thank you for trying. I don't know if the difference is in the kernel or in the bash version I'm running. I got it to work in TIO by forcing an end to grep's input using head, as follows: dc<<<'0[2^pv1+lax]dsax'|head -1sed s/./0/g<<<$1|grep ^$1$ This uses the length of the pattern to limit the numbers being tested (4-character patterns check only up to 9999, etc.).  Here's a TIO link: https://tio.run/nexus/bash#@5@SbGNjo24QbRRXUGaonZNYEZtSnFihXpORmpiioGuYUJyaolCsr6dvoJ8OVKhimFCTXpRaoBCnYqjy//9/Ez09PQA

Thank you for the fix. I don't think the current solution would actually work (though I don't have much knowledge of bash), because it appears that it needs to calculate all values before feeding that into grep. However, as it is currently not the shortest solution, I will keep it at 33 bytes for scoring. It appears to work for all inputs, so good job!

@AlexL. Count it however you're comfortable; it's just for fun, and it's not going to win anyway. It does work in my two test systems--one is OS X and the other is Linux; something must have changed in the more recent kernels, or the more recent bash or grep. The issue appears to be with I/O buffering. Programs in a pipe don't wait for earlier programs to finish (in the version that works on TIO, with the call to head, the dc program is still running forever, but output does get produced).  I/O may wait, however, for a buffer to fill up (or for the other end of the I/O operation to be closed).


text:
Converting Numbers to a "Not quite place-value system"
Lets create a system of numbers where the biggest digit in the nth place value (counting from right to left) of a number length m is always equal to m - n + 1. To give an example the largest 5 digit number expressible in this system is written 12345. Apart from the number of digits available to be used in a particular place being restricted, all other incrementation is standard. Namely when a digit is to surpass its digit limit we add one to the next digit.
Here is how counting would be represented in this system:
1; 10; 11; 12; 100; 101; 102; 103; 110; 111; 112; 113; 120; 121; 122; 123; 1000; 1001 ...

Your task is to write a function that takes a standard base 10 number and converts it to my numbering system.
Shorter code is preferable. Bonne Chance!
**If you need digits after 9 (you should) you can choose to use letters, or you can you return a 2 digit number as an element of a list.
Test Cases
10 -> 111
20 -> 1003
30 -> 1023
50 -> 1123
100 -> 10035
23116 -> 1234567
21977356 -> 123456789A

Last case may be incredibly slow to run depending on how you implemented. You don't need to run it if it takes too long or uses too much memory. However  note that there exist ways to have it run quickly and using little memory.

Given your last comment, is it okay if we always return a list with the digits?

Yes, That's a reasonable way to give output, as long as the numbers are correct

I'm getting 100 -> 10035 rather than 100 -> 10033, can you verify?

@GregMartin 10035 seems right. I did my calculations by pen and not program and hence made a computation error. I guess we have computers for a reasom

Can we assume all inputs are positive integers?

Also, you should really add a test-case that demonstrates the case of a digit greater than 9.

Maybe duplicate? http://codegolf.stackexchange.com/questions/11735/convert-to-and-from-the-factorial-number-system?rq=1

@smls That's a fair assumption

Mathematica, 64 bytes
Part[Join@@Array[Tuples@Join[{{1}},Array[Range,#-1,3]-1]&,#],#]&

Unnamed function taking a positive integer argument and returning a list of integers.
Join[{{1}},Array[Range,#-1,3]-1] returns the nested list { {1}, {0,1,2}, {0,1,2,3}, ..., {0,1,...,#} }. Then Tuples returns the (sorted) set of all tuples whose first element lies in {1}, whose second element lies in {0,1,2}, and so on; these are the #-digit numbers in this numbering system. Join@@Array[...,#] returns an array of all the numbers in this numbering system with at most # digits, and Part[...,#] extracts the #th such number.
This is hopelessly slow! It runs fine for the input up to 9. For larger input, test it by replacing the end ,#],#]& with ,Ceiling[0.9Log[#]]],#]&; this puts a more realistic cap on the number of digits necessary to go far enough in the numbering system to find the one we want.

Mathematica, 93 bytes
Nest[#/.{x___,y_}:>{x,y+1}//.x:{y___,z_:0,w_,v___}/;w>Tr[1^x]-Tr[1^{v}]:>{y,z+1,0,v}&,{0},#]&

Pure function with first argument #. If a nonnegative integer is given, it will output the correct list of digits (even handles 0 correctly!).
Explanation
Nest[f,expr,n] gives the result of applying f to expr n times. In this case, expr is the list {0} and n is the input integer #. The function f is complicated:
# (* Starting with the input # *)
 /. (* Apply the following rule *)
   {x___,y_} (* If you see a list of the form {x___,y} *)
            :> (* replace it with *)
              {x,y+1} (* this *)
                     //. (* Now apply the following rule repeatedly until nothing changes *)
                        x:{y___,z_:0,w_,v___} (* If you see a list x starting with a sequence y of 0 or more elements,
                                                 followed by an optional element z (default value of 0),
                                                 followed by an element w,
                                                 followed by a sequence v of 0 or more elements *)
                                             /; (* such that *)
                                               w>Tr[1^x]-Tr[1^{v}] (* w is greater than the length of x minus the length of {v} *)
                                                                  :> (* replace it with *)
                                                                    {y,z+1,0,v}& (* this *)

Nice use of y___,z_:0 to increase the length of the list!

@GregMartin JungHwan Min used it in a similar problem yesterday.

Perl 6, 38 bytes
{map({|[X] 1,|map ^*,3..$_},1..*)[$_]}

Takes a positive integer, and outputs a list of integers representing the digits.
Explanation:
{                                    }  # a lambda

 map({                    },1..*)       # for each number length from 0 to infinity,
                                        # offset by 1 to avoid a +1 in next step...

           1,|map ^*,3..$_              # generate the digit ranges, e.g.:
                                        #     length 0  ->  (1)  # bogus, but irrelevant
                                        #     length 1  ->  (1)
                                        #     length 2  ->  (1, 0..2)
                                        #     length 3  ->  (1, 0..2, 0..3)
                                        #     length 4  ->  (1, 0..2, 0..3, 0..4)

       [X]                              # take the cartesian product

      |                                 # slip the results into the outer sequence

                                 [$_]   # Index the sequence generated this way

Pyth - 14 bytes
Simply returns the nth value that fits the "less than place value pattern".
e.f.A.eghkbjZT

Test Suite.

Does this work on the input 2018967, where the last digit equals 10?

Haskell, 65 bytes
i(x:r)|x>length r=0:i r|1<2=1+x:r
i[]=[1]
reverse.(iterate i[]!!)

i increases numbers in the number system with the digits in reversed order. iterate creates the infinite list of all these numbers starting with zero which is represented by []. Then all that is left to do is take (!!) the demanded number and reverse it.
The last line is a function, not a function definition, so it can not appear as is in a source code file. Instead, only put the other lines in the source code and use the last line at the interpreter (or bind the function to a name by prepending f= to the last line).
Example use:
*Main> reverse.(iterate i[]!!) $ 100
[1,0,0,3,5]

(8 bytes could be saved if [5,3,0,0,1] were an allowed representation of the result.)

Haskell, 49 bytes
x=[1]:[n++[d]|n<-x,d<-[0..length n+1]]
(x!!).pred

The first line is an auxiliary definition, and the second evaluates to a function.
It takes an integer and returns a list of integers.
Try it online!
Explanation
I define x as the infinite list of representations mentioned in the challenge text; the main function just decrements its argument and indexes into x.
The first line works like this:
x=                     -- The list of lists x contains
 [1]:                  -- the list [1], followed by
 [n++[d]|              -- integer d appended to list n, where
  n<-x,                -- n is drawn from x, and
  d<-[0..length n+1]]  -- the new "digit" d is drawn from this range.

You see that x is defined in terms of itself, but Haskell is lazy, so this is not an issue.