OFFSET
1,1
COMMENTS
Union of {8, 9} and A001751.
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.
MATHEMATICA
Select[Range[200], !Divisible[(#-1)!, #^2]&] (* Harvey P. Dale, Mar 06 2016 *)
PROG
(PARI) for(m=1, 3e2, if((m-1)!%m^2, print1(m", "))) \\ Charles R Greathouse IV, Aug 21 2011
(Haskell)
import Data.List (insert)
a178156 n = a178156_list !! (n-1)
a178156_list = insert 9 $ insert 8 a001751_list
-- Reinhard Zumkeller, Oct 14 2014
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Dec 17 2010
EXTENSIONS
Entries corrected by Charles R Greathouse IV, Aug 21 2011
STATUS
approved