cp's OEIS Frontend

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.

Showing 1-2 of 2 results.

A167184 Smallest prime power >= n that is not prime.

Original entry on oeis.org

1, 4, 4, 4, 8, 8, 8, 8, 9, 16, 16, 16, 16, 16, 16, 16, 25, 25, 25, 25, 25, 25, 25, 25, 25, 27, 27, 32, 32, 32, 32, 32, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 81, 81, 81, 81, 81, 81, 81, 81
Offset: 1

Views

Author

Michael B. Porter, Oct 29 2009

Keywords

Examples

			For a(12), 12, 14, and 15 are not prime powers, and 13 is a prime power but it is prime. Since 16 = 2^4 is a prime power, a(12) = 16.
		

Crossrefs

List of nonprime prime powers: A025475.
Previous nonprime prime power: A167185.
Next prime power including primes: A000015.

Programs

  • Mathematica
    Module[{ppwrs=Join[{1},Sort[Flatten[Table[Prime[Range[5]]^p,{p,2,10}]]]]}, Flatten[ Table[Select[ppwrs,#>=n&,1],{n,90}]]] (* Harvey P. Dale, Oct 06 2014 *)
  • PARI
    isA025475(n) = (omega(n) == 1 & !isprime(n)) || (n == 1)
    A167184(n) = {local(m);m=n;while(!isA025475(m),m++);m}
    
  • Python
    from itertools import count
    from sympy import factorint
    def A167184(n): return next(filter(lambda m:len(f:=factorint(m))<=1 and max(f.values(),default=2)>1, count(n))) # Chai Wah Wu, Oct 25 2024

A069585 a(n) = n - largest prime power <= n.

Original entry on oeis.org

0, 1, 2, 0, 1, 2, 3, 0, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0
Offset: 1

Views

Author

Amarnath Murthy, Mar 24 2002

Keywords

Comments

This sequence considers "prime powers" to be A025475 rather than A000961.
a(8)=a(9)=0. With Mihăilescu's proof of Catalan's conjecture (see A001597) there can be no further occurrence of consecutive zeros. - Robert Munafo, May 10 2024

Crossrefs

Programs

  • Mathematica
    nn = 10^4; s = {1}~Join~Select[Union@ Flatten@ Table[a^2*b^3, {b, Surd[nn, 3]}, {a, Sqrt[nn/b^3]}], PrimePowerQ]; Table[n - TakeWhile[s, # <= n &][[-1]], {n, nn}] (* Michael De Vlieger, May 11 2024 *)

Formula

a(n) = n - A167185(n). - Michel Marcus, May 10 2024

Extensions

Revised by Robert Munafo and Sean A. Irvine, May 10 2024
Showing 1-2 of 2 results.