A178156 Numbers m such that (m-1)! is not divisible by m^2.
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, 47, 53, 58, 59, 61, 62, 67, 71, 73, 74, 79, 82, 83, 86, 89, 94, 97, 101, 103, 106, 107, 109, 113, 118, 122, 127, 131, 134, 137, 139, 142, 146, 149, 151, 157, 158, 163
Offset: 1
Keywords
References
- G. Pólya and G. Szegő, Problems and Theorems in Analysis II (Springer 1924, reprinted 1972), Part Eight, Chap. 3, Sect. 1, Problem 133b.
Programs
-
Haskell
import Data.List (insert) a178156 n = a178156_list !! (n-1) a178156_list = insert 9 $ insert 8 a001751_list -- Reinhard Zumkeller, Oct 14 2014
-
Mathematica
Select[Range[200],!Divisible[(#-1)!,#^2]&] (* Harvey P. Dale, Mar 06 2016 *)
-
PARI
for(m=1,3e2,if((m-1)!%m^2,print1(m", "))) \\ Charles R Greathouse IV, Aug 21 2011
-
Python
from sympy import primepi def A178156(n): def bisection(f,kmin=0,kmax=1): while f(kmax) > kmax: kmax <<= 1 while kmax-kmin > 1: kmid = kmax+kmin>>1 if f(kmid) <= kmid: kmax = kmid else: kmin = kmid return kmax def f(x): return int(n+x-primepi(x)-primepi(x>>1)-(x>=8)-(x>=9)) return bisection(f,n,n) # Chai Wah Wu, Oct 17 2024
Extensions
Entries corrected by Charles R Greathouse IV, Aug 21 2011
Comments