The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A167185 Largest prime power <= n that is not prime. 2

%I #29 Sep 22 2023 02:11:17

%S 1,1,1,4,4,4,4,8,9,9,9,9,9,9,9,16,16,16,16,16,16,16,16,16,25,25,27,27,

%T 27,27,27,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,49,49,49,

%U 49,49,49,49,49,49,49,49,49,49,49,49,64,64,64,64,64,64,64,64,64,64,64

%N Largest prime power <= n that is not prime.

%H Robert Price, <a href="/A167185/b167185.txt">Table of n, a(n) for n = 1..2000</a>

%e For a(14), 10, 12, and 14 are not prime powers, and 11 and 13 are prime powers but they are prime. Since 9 = 3^3 is a prime power, a(14) = 9.

%t Array[SelectFirst[Range[#, 1, -1], Or[And[! PrimeQ@ #, PrimePowerQ@ #], # == 1] &] &, 74] (* _Michael De Vlieger_, Jun 14 2017 *)

%o (PARI) isA025475(n) = (omega(n) == 1 & !isprime(n)) || (n == 1)

%o A167185(n) = {local(m);m=n;while(!isA025475(m),m--);m}

%o (Sage)

%o p = [n for n in (1..81) if (is_prime_power(n) or n == 1) and not is_prime(n)]

%o r = [[p[i]]*(p[i+1] - p[i]) for i in (0..9)]

%o print([y for x in r for y in x]) # _Peter Luschny_, Jun 14 2017

%Y List of nonprime prime powers: A025475.

%Y Next nonprime prime power: A167184.

%Y Previous prime power including primes: A031218.

%K nonn,easy

%O 1,4

%A _Michael B. Porter_, Oct 29 2009

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 19 13:25 EDT 2024. Contains 372694 sequences. (Running on oeis4.)