# census1948.py -- arithmetic check for job #1948: the three censuses of return #162 equal OEIS A059861(10..12) = # prod_{2=1 else m), (n,T(m),A059861(n)) print('brute force: |T(p#)| = A059861(n) = phi_2(p#/2) for n = 1..5 (primorials 2..2310)') assert all(T(m)==phi2(m) for m in range(1,400,2)), 'odd m: twin-admissible count equals Schemmel phi_2 (bijection r -> r/2 mod m)' print('brute force: for odd m < 400, #{r mod m: gcd(r,m)=gcd(r+2,m)=1} = phi_2(m) (Schemmel), via r = 2k') print('ALL CHECKS PASS')