login
A143143
a(n) = the number of primes that exist between (but don't include) j and k, where j is the largest divisor of n that is <= sqrt(n) and k = the smallest divisor of n that is >= sqrt(n).
3
0, 0, 1, 0, 2, 0, 3, 1, 0, 1, 4, 0, 5, 2, 0, 0, 6, 1, 7, 0, 1, 3, 8, 1, 0, 4, 2, 1, 9, 0, 10, 2, 2, 5, 0, 0, 11, 6, 3, 1, 12, 0, 13, 2, 1, 7, 14, 1, 0, 1, 4, 3, 15, 1, 1, 0, 5, 8, 16, 1, 17, 9, 0, 0, 2, 1, 18, 4, 6, 0, 19, 0, 20, 10, 3, 5, 0, 2, 21, 0, 0, 11, 22, 1, 3, 12, 7, 0, 23, 0, 1, 6, 8, 13, 4
OFFSET
1,5
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000 (* First 500 terms from Owen Whitby *)
EXAMPLE
The divisors of 14 are 1,2,7,14. The two middle divisors are 2 and 7. Between 2 and 7 (and not including 2 and 7) there are 2 primes (3 and 5). So a(14) = 2.
MATHEMATICA
a143143[minn_, maxn_]:=Module[{d, ld, a, b, c, lst143143={}}, Do[d=Divisors[n ]; ld=Length[d]; If[OddQ[ld], AppendTo[lst143143, {n, 0}], a=ld/2; b=d[[a]]; c =d[[ a+1]]; AppendTo[lst143143, {n, PrimePi[c-1]-PrimePi[b]}]], {n, minn, maxn}]; Transpose[lst143143]//MatrixForm] - Owen Whitby, Oct 22 2008
np[n_]:=Module[{s=Sqrt[n], d=Divisors[n]}, Count[Range[Max[Select[d, #<=s&]] +1, Min[Select[d, #>=s&]]-1], _?PrimeQ]]; Array[np, 100] (* Harvey P. Dale, Nov 06 2022 *)
CROSSREFS
Sequence in context: A290256 A303110 A079133 * A158853 A238762 A269517
KEYWORD
nonn
AUTHOR
Leroy Quet, Jul 27 2008
EXTENSIONS
a(16) to a(500) from Owen Whitby, Oct 22 2008
STATUS
approved