OFFSET
1,2
COMMENTS
The length of the m-th run of {a(n)} is the length of the (m+1)-st run of A000015 for m > 1. - Colin Linzer, Mar 08 2024
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
B. Dearden, J. Iiams, and J. Metzger, Rumor Arrays, Journal of Integer Sequences, 16 (2013), #13.9.3.
Eric Weisstein's World of Mathematics, Prime Power
PROG
(PARI) a(n)=if(n<1, 0, while(matsize(factor(n))[1]>1, n--); n)
(Haskell)
a031218 n = last $ takeWhile (<= n) a000961_list
-- Reinhard Zumkeller, Apr 25 2011
(Python)
from sympy import factorint
def A031218(n): return next(filter(lambda m:len(factorint(m))<=1, range(n, 0, -1))) # Chai Wah Wu, Oct 25 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from Erich Friedman
STATUS
approved