This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A178156 #25 Oct 17 2024 15:00:32 %S A178156 2,3,4,5,6,7,8,9,10,11,13,14,17,19,22,23,26,29,31,34,37,38,41,43,46, %T A178156 47,53,58,59,61,62,67,71,73,74,79,82,83,86,89,94,97,101,103,106,107, %U A178156 109,113,118,122,127,131,134,137,139,142,146,149,151,157,158,163 %N A178156 Numbers m such that (m-1)! is not divisible by m^2. %C A178156 Union of {8, 9} and A001751. %D A178156 G. Pólya and G. Szegő, Problems and Theorems in Analysis II (Springer 1924, reprinted 1972), Part Eight, Chap. 3, Sect. 1, Problem 133b. %t A178156 Select[Range[200],!Divisible[(#-1)!,#^2]&] (* _Harvey P. Dale_, Mar 06 2016 *) %o A178156 (PARI) for(m=1,3e2,if((m-1)!%m^2,print1(m", "))) \\ _Charles R Greathouse IV_, Aug 21 2011 %o A178156 (Haskell) %o A178156 import Data.List (insert) %o A178156 a178156 n = a178156_list !! (n-1) %o A178156 a178156_list = insert 9 $ insert 8 a001751_list %o A178156 -- _Reinhard Zumkeller_, Oct 14 2014 %o A178156 (Python) %o A178156 from sympy import primepi %o A178156 def A178156(n): %o A178156 def bisection(f,kmin=0,kmax=1): %o A178156 while f(kmax) > kmax: kmax <<= 1 %o A178156 while kmax-kmin > 1: %o A178156 kmid = kmax+kmin>>1 %o A178156 if f(kmid) <= kmid: %o A178156 kmax = kmid %o A178156 else: %o A178156 kmin = kmid %o A178156 return kmax %o A178156 def f(x): return int(n+x-primepi(x)-primepi(x>>1)-(x>=8)-(x>=9)) %o A178156 return bisection(f,n,n) # _Chai Wah Wu_, Oct 17 2024 %Y A178156 Cf. A046022, A000142, A174460. %Y A178156 Cf. A001751. %K A178156 nonn %O A178156 1,1 %A A178156 _Reinhard Zumkeller_, Dec 17 2010 %E A178156 Entries corrected by _Charles R Greathouse IV_, Aug 21 2011