A324385 Distance from the n-th highly composite number, A002182(n), from the largest prime <= A002182(n).
0, 1, 1, 1, 1, 5, 1, 1, 7, 1, 1, 1, 1, 1, 1, 11, 17, 1, 1, 1, 13, 11, 11, 19, 17, 13, 1, 23, 1, 1, 13, 17, 17, 13, 17, 1, 17, 1, 1, 23, 17, 17, 17, 1, 19, 83, 37, 23, 17, 23, 1, 43, 19, 1, 19, 43, 19, 31, 23, 19, 31, 19, 19, 1, 1, 1, 1, 47, 1, 31, 47, 23, 53, 23, 83, 37, 31, 1, 31, 1, 23, 61, 1, 41, 47, 61, 41, 29, 41, 29, 43, 73, 29, 47, 31, 31
Offset: 2
Keywords
Examples
A002182(2) = 2, the largest prime <= 2 is 2 itself, thus a(2) = 2-2 = 0. A002182(7) = 36, the largest prime <= 36 is 31, thus a(7) = 36-31 = 5.
Links
- Antti Karttunen, Table of n, a(n) for n = 2..10000
Programs
-
Mathematica
With[{s = Array[DivisorSigma[0, #] &, 10^6]}, {0}~Join~Map[# - NextPrime[#, -1] &@ FirstPosition[s, #][[1]] &, Drop[Union@ FoldList[Max, s], 2]]] (* or *) {0}~Join~Map[# - NextPrime[#, -1] &, Import["https://oeis.org/A002182/b002182.txt", "Data"][[3 ;; 97, -1]] ] (* Michael De Vlieger, Dec 11 2020 *)
-
PARI
A324385(n) = (A002182(n)-precprime(A002182(n)));
Comments