It'd be pretty cool if CSS could define new rules based on counters and calculated properties. Then you might be able to bootstrap from something small like "2 is prime" and discover the rest of the primes up to n. Is this sort of wizardry possible?
It'd be pretty cool if CSS could define new rules based on counters and calculated properties. Then you might be able to bootstrap from something small like "2 is prime" and discover the rest of the primes up to n. Is this sort of wizardry possible?
You can replace
li:first-child,
li:nth-child(2n + 4),
li:nth-child(3n + 6),
li:nth-child(5n + 10),
li:nth-child(7n + 14) {
color: grey;
counter-increment: nature-count nonprime-count;
}
with li:first-child,
li:nth-child(2n + 4),
li:nth-child(3n + 6),
li:nth-child(4n + 8),
li:nth-child(5n + 10),
li:nth-child(6n + 12),
li:nth-child(7n + 14)
li:nth-child(8n + 16)
li:nth-child(9n + 18)
li:nth-child(10n + 20) {
color: grey;
counter-increment: nature-count nonprime-count;
}CSS4, let's do it.
[0]: https://en.wikipedia.org/wiki/Primitive_recursive_function#C...
Rule110 (After setting first row requires alternation of tab/space to run): https://codepen.io/elrumordelaluz/pen/wqLyH?editors=010
stackoverflow discussion: https://stackoverflow.com/questions/2497146/is-css-turing-co...
[1]https://en.wikipedia.org/wiki/AKS_primality_test
[2]https://en.wikipedia.org/wiki/Elliptic_curve_primality_provi...
[3]https://en.wikipedia.org/wiki/Adleman%E2%80%93Pomerance%E2%8...