Interesting Spectator with problem (X1) posed by 17a and subtle anagrams introduced with 23a. I also got 5d and 7a, but am having trouble with 6d (TEH?EI?G) and 31d ( ET?E?). I must have some wrong letters here. Should be able to solve 40d when once I get 35d.
Thanks to all who helped! I should really have seen 6d and 31d, but just got derailed! I like the subtle use of the mathematics which, after all, was not that difficult! Many thanks again, Graudian!