A083270 Duplicate of A000879.
2, 4, 9, 15, 30, 39, 61, 72, 99, 146, 162, 219, 263, 283, 329, 409, 487, 519, 609, 675
Offset: 1
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.
For n=9, n-th prime is 23, composites between 23 and next prime are 24 25 26 27 28, smallest prime divisors are 2 5 2 3 2; maximal value is 5, so a(9)=5.
a052180 n = a052180_list !! (n-2) a052180_list = f [4..] where f ws = (maximum $ map a020639 us) : f vs where (us, _:vs) = span ((== 0) . a010051) ws -- Reinhard Zumkeller, Dec 27 2012
ffi[x_] := Flatten[FactorInteger[x]]; lf[x_] := Length[FactorInteger[x]]; ba[x_] := Table[Part[ffi[x], 2*w-1], {w, 1, lf[x]}]; mi[x_] := Min[ba[x]]; Table[Max[Table[mi[ba[w]], {w, Prime[j]+1, -1+Prime[j+1]}]], {j, 2, 256}] (* Second program: *) mpf[{a_,b_}] := Max[FactorInteger[#][[1,1]]& /@ Range[a+1,b-1]]; mpf/@ Partition[ Prime[Range[2,100]],2,1] (* Harvey P. Dale, Apr 30 2013 *)
a(n) = {my(p = prime(n), amax = 0); forcomposite(c = p, nextprime(p+1), amax = max(factor(c)[1,1], amax);); amax;} \\ Michel Marcus, Apr 21 2018
from sympy import prime, nextprime, primefactors def a(n): p = prime(n); q = nextprime(p) return max(min(primefactors(m)) for m in range(p+1, q)) print([a(n) for n in range(2, 95)]) # Michael S. Branicky, Feb 02 2021
There are 2 primes less than 2^2, there are 2 primes between 2^2 and 3^2, 5 primes between 3^2 and 5^2, etc. [corrected by Jonathan Sperry, Aug 30 2013]
import Data.List (group) a050216 n = a050216_list !! (n-1) a050216_list = map length $ filter (/= [0]) $ group $ map a010051 a000430_list -- Reinhard Zumkeller, Sep 23 2011
A050216 := proc(n) local p,pn ; if n = 0 then 2; else p := ithprime(n) ; pn := nextprime(p) ; numtheory[pi](pn^2)-numtheory[pi](p^2) ; end if; end proc: seq(A050216(n),n=0..40) ; # R. J. Mathar, Jan 27 2025
-Subtract @@@ Partition[PrimePi[Prime[Range[20]]^2], 2, 1] (* Eric W. Weisstein, Jan 10 2025 *)
a(n)={n||return(2);primepi(prime(n+1)^2)-primepi(prime(n)^2)} \\ M. F. Hasler, Dec 31 2014
prime(1) = 2 occurs as the least prime factor in range [1,8] for four times (all even numbers <= 8), thus a(1) = 4. prime(2) = 3 occurs as the least prime factor in range [1,27] for five times (when n is: 3, 9, 15, 21, 27), thus a(2) = 5.
f[n_] := Count[Range[Prime[n]^3], x_ /; Min[First /@ FactorInteger[x]] == Prime@ n]; Array[f, 16] (* Michael De Vlieger, Mar 30 2015 *)
A250474(n) = 3 + primepi(prime(n)^2) - n; \\ Fast implementation. for(n=1, 5001, write("b250474.txt", n, " ", A250474(n))); \\ The following program reflects the given sum formula, but is far from the optimal solution: allocatemem(234567890); A002110(n) = prod(i=1, n, prime(i)); A020639(n) = if(1==n,n,vecmin(factor(n)[,1])); A055396(n) = if(1==n,0,primepi(A020639(n))); A250474(n) = { my(p2 = prime(n)^2); sumdiv(A002110(n-1), d, moebius(d)*(p2\d)); }; for(n=1, 23, print1(A250474(n),", "));
(define (A250474 n) (let loop ((k 2)) (if (not (prime? (A249821bi n k))) k (loop (+ k 1))))) ;; This is even slower. Code for A249821bi given in A249821.
n=4, the zone in question is [7,49] and encloses a(4)=12 primes, as follows: {7,11,13,17,19,23,29,31,37,41,43,47}.
a[n_] := PrimePi[Prime[n]^2] - n + 1; Array[a, 50] (* Jean-François Alcover, Dec 07 2015 *)
\\ A fast version: default(primelimit, 2^31 + 2^30); A054272(n) = 1 + primepi(prime(n)^2) - n; for(n=1, 5000, write("b054272.txt", n, " ", A054272(n))); \\ The following mirrors the given new formula. It is far from an optimal way to compute this sequence: allocatemem(234567890); A002110(n) = prod(i=1, n, prime(i)); A054272(n) = { my(p2); p2 = prime(n)^2; sumdiv(A002110(n), d, moebius(d)*floor(p2/d)); }; for(n=1, 22, print1(A054272(n),", ")); \\ Antti Karttunen, Dec 05 2014
seq(prevprime(ithprime(i)^2),i=1..100); # Robert Israel, May 04 2020
NextPrime[Prime[Range[50]]^2,-1] (* Harvey P. Dale, May 19 2016 *)
a(n) = precprime(prime(n)^2); \\ Michel Marcus, Dec 13 2013
100th prime, 541 immediately follows 529, square of 9th prime.
with(numtheory): [seq(nextprime(ithprime(w)^2),w=1..100)];
Array[NextPrime[Prime[#]^2] &, 41] (* Michael De Vlieger, Nov 02 2017 *)
a(n) = { nextprime(prime(n)^2) } \\ Harry J. Smith, Aug 10 2009
With[{tpps=Select[Partition[Prime[Range[10000]],2,1],Last[#]- First[#] == 2&]}, Table[ Count[tpps,?(Last[#]<Prime[n]^2&)],{n,60}]] (* _Harvey P. Dale, Aug 11 2011 *)
Comments