here are some procedures to do so:
#all-bar-numbers-visible
#(every-nth-bar-number-visible n)
#(modulo-bar-number-visible n m)
(needs version 2.16 or higher:)
#first-bar-number-invisible-save-broken-bars
#first-bar-number-invisible-and-no-parenthesized-bar-numbers