I'm looking to identify a science fiction short story I must have read, maybe ten years ago or a bit less. It must have been in an anthology, though I don't recall what other kinds of stories were there. This one was a first contact story, about a meeting between a human spaceship and an alien one, and trying to figure out basic communication.
I think there may have been a crash or some other emergency, there was a reason why communication between the ships was urgent. Perhaps a crash followed by some local emergency they were trying to warn the other ship from, or get help with (for some reason I'm thinking 'falling towards the local star', but that might be a different story)? As I recall, the attempts were to send some kind of patterns or logical sequences, to try and start communication - beaming or broadcasting taps, some kind of rhythm, something to show they're sentient and trying to communicate, and determine what kinds of things are being 'heard' or can be used as signals (like vibration, light, radio, whatever).
The breakthrough comes when one of the crew suggests they move away from logical patterns, noting that unvarying patterns don't tend to signal communication (he makes some analogy like the ticking of a clock or the beating of a heart, for repeated patterns that don't mean speech), so the aliens might think the repeating signal is unintentional, some part knocking against another. It takes a living being (as opposed to machine) to be illogical, or to break patterns, to show intention. I think what works is varying the signal, and maybe they end up doing Morse code math problems or something, to establish intent-to-communicate, and from there figure out some kind of limited yes-no code, that will let them cooperate or warn the other ship of whatever the original problem was.
I am not certain, but I think whoever figured it out might have changed the pattern on their own, gotten communication started, and explained themselves after the fact? Or perhaps it's only a familiar pattern.
I've been through most of my anthologies recently, and haven't been able to find this one. I would appreciate any help in locating it.