As a child circa the late 1970s, I read a poignant science fiction story that I would love to be able to identify. As best I can recall after all these years, the story went something like this:
A planet is inhabited by intelligent slugs that live in the oceans that cover much of the planet. An alien force (possibly humans from earth?) land on the planet and are going to do something that will exterminate the slugs. They are aware that the slugs are a life form on the planet, but assume they have no intelligence or consciousness and thus have no qualms about their demise. One slug attempts to save his species from extinction by communicating with the alien force and convincing them of the slugs' intelligence. Although he cannot live long outside the oceans of the planet, he comes up onto the land and arranges stones on the shore in some mathematical pattern (perhaps in groups of prime numbers?) -- with some emphasis in the story on the theme of mathematics as a universal language. The story describes the slug's physical suffering on land as he races against time to communicate to the alien force. I believe the story ends with the slug dying from exposure to the toxic land environment, whereupon the alien force discovers his corpse and the stones he arranged, realizes that the species exhibits both intelligence and gallantry, and spares the species from destruction.
I think the title of the story might have been the name of the slug who was the story's protagonist, possibly "Flan" (like the dessert). I think the story might have appeared in some sort of science fiction magazine of the late 1970s.