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.
%I A000015 #78 Feb 16 2025 08:32:18 %S A000015 1,2,3,4,5,7,7,8,9,11,11,13,13,16,16,16,17,19,19,23,23,23,23,25,25,27, %T A000015 27,29,29,31,31,32,37,37,37,37,37,41,41,41,41,43,43,47,47,47,47,49,49, %U A000015 53,53,53,53,59,59,59,59,59,59,61,61,64,64,64,67,67,67,71,71,71,71,73 %N A000015 Smallest prime power >= n. %C A000015 The length of the m-th run of {a(n)} is the length of the (m-1)-st run of A031218 for m > 1. - _Colin Linzer_, Mar 08 2024 %H A000015 David W. Wilson, <a href="/A000015/b000015.txt">Table of n, a(n) for n = 1..10000</a> %H A000015 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PrimePower.html">Prime Power</a>. %F A000015 a(A110654(n+1)) = A188666(n). - _Reinhard Zumkeller_, Apr 25 2011, corrected by _M. F. Hasler_, Jul 25 2015 %F A000015 a(n) = A188666(2n-1). - _M. F. Hasler_, Jul 25 2015 %p A000015 N:= 1000: # to get all terms <= N %p A000015 Primes:= select(isprime,{$1..N}): %p A000015 PPs:= {1} union Primes: %p A000015 for k from 1 to ilog2(N) do %p A000015 PPs:= PPs union map(`^`, select(`<=`,Primes, floor(N^(1/k))),k) %p A000015 od: %p A000015 PPs:= sort(convert(PPs,list)): %p A000015 1, seq(PPs[i]$(PPs[i]-PPs[i-1]), i=2..nops(PPs)); # _Robert Israel_, Jul 23 2015 %t A000015 Insert[Table[m:=n;While[Not[Length[FactorInteger[m]]==1],m++ ];m,{n,2,100}], 1, 1] (* _Stefan Steinerberger_, Apr 17 2006 *) %t A000015 a[n_] := NestWhile[# + 1 &, n, Not@*PrimePowerQ]; (* _Matthew House_, Jul 14 2015, v6.0+ *) %t A000015 a[ n_] := If[ n < 2, Boole[n == 1], Module[{m = n}, While[ ! PrimePowerQ[ m], m++]; m]]; (* _Michael Somos_, Mar 06 2018 *) %t A000015 a[ n_] := If[ n < 1, 0, Module[{m = n}, While[ Length[ FactorInteger @ m ] != 1, m++]; m]]; (* _Michael Somos_, Mar 06 2018 *) %o A000015 (PARI) {a(n) = if( n<1, 0, while(matsize(factor(n))[1]>1, n++); n)}; /* _Michael Somos_, Jul 16 2002 */ %o A000015 (PARI) a(n)=if(n>1,while(!isprimepower(n),n++));n \\ _Charles R Greathouse IV_, Feb 01 2013 %o A000015 (Sage) [next_prime_power(n) for n in range(72)] # _Zerinvary Lajos_, Jun 13 2009 %o A000015 (Haskell) %o A000015 a000015 n = a000015_list !! (n-1) %o A000015 a000015_list = 1 : concat %o A000015 (zipWith(\pp qq -> replicate (fromInteger (pp - qq)) pp) %o A000015 (tail a000961_list) a000961_list) %o A000015 -- _Reinhard Zumkeller_, Nov 17 2011, Apr 25 2011 %o A000015 (Python) %o A000015 from itertools import count %o A000015 from sympy import factorint %o A000015 def A000015(n): return next(filter(lambda m:len(factorint(m))<=1, count(n))) # _Chai Wah Wu_, Oct 25 2024 %Y A000015 Cf. A000961, A031218. %K A000015 nonn,easy %O A000015 1,2 %A A000015 _N. J. A. Sloane_ %E A000015 More terms from _Michael Somos_, Jul 16 2002