A117825 Distance from n-th highly composite number (cf. A002182) to nearest prime.
1, 0, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1, 1, 11, 13, 1, 11, 1, 17, 1, 1, 13, 13, 1, 1, 17, 1, 17, 1, 1, 17, 17, 17, 1, 1, 19, 37, 37, 1, 17, 23, 1, 29, 1, 1, 19, 1, 19, 23, 1, 19, 31, 1, 19, 1, 1, 1, 1, 23, 1, 29, 23, 23, 1, 23, 71, 37, 1, 1, 31, 1, 23, 53, 1, 31
Offset: 1
Examples
a(5) = abs(12-11) = 1.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..19999
- Bill McEachen, Alternate plot, Wikimedia Commons.
- Graeme McRae, Highly Composite Numbers.
- Wikipedia, Highly Composite Numbers.
- Wikipedia, Divisor Function (sigma).
Crossrefs
Programs
-
Mathematica
With[{s = DivisorSigma[0, Range[Product[Prime@ i, {i, 8}]]]}, Map[If[PrimeQ@ #, 0, Min[# - NextPrime[#, -1], NextPrime[#] - #]] &@ FirstPosition[s, #][[1]] &, Union@ FoldList[Max, s]]] (* Michael De Vlieger, Mar 11 2019 *)
-
PARI
A141345(n) = (nextprime(1+A002182(n))-A002182(n)); A324385(n) = (A002182(n)-precprime(A002182(n))); A117825(n) = if(1==n,1,min(A141345(n), A324385(n))); \\ Antti Karttunen, Feb 26 2019
Formula
Extensions
More terms from Don Reble, May 02 2006
Comments