login
A331954
a(n) is the least positive k such that floor(n/k) is a prime number.
3
1, 1, 2, 1, 2, 1, 3, 3, 2, 1, 4, 1, 2, 2, 3, 1, 5, 1, 4, 3, 2, 1, 7, 5, 2, 2, 4, 1, 4, 1, 6, 3, 2, 2, 5, 1, 2, 2, 3, 1, 6, 1, 4, 4, 2, 1, 9, 7, 7, 3, 3, 1, 4, 4, 5, 3, 2, 1, 8, 1, 2, 2, 9, 5, 5, 1, 4, 3, 3, 1, 10, 1, 2, 2, 4, 4, 4, 1, 6, 6, 2, 1, 11, 5, 2, 2
OFFSET
2,3
COMMENTS
This sequence is unbounded; a(n!*p^2) > n where n > 1 and p is a prime number > n.
LINKS
FORMULA
a(n) = 1 iff n is a prime number.
EXAMPLE
For n = 8:
- floor(8/1) = 8 is not a prime number,
- floor(8/2) = 4 is not a prime number,
- floor(8/3) = 2 is a prime number,
- hence a(8) = 3.
MATHEMATICA
Array[Block[{k = 1}, While[! PrimeQ@ Floor[#/k], k++]; k] &, 86, 2] (* Michael De Vlieger, Feb 04 2020 *)
PROG
(PARI) a(n) = for (k=1, oo, if (isprime(n\k), return (k)))
CROSSREFS
Cf. A331953 (square variant), A331959 (corresponding prime numbers).
Sequence in context: A322866 A328847 A331175 * A309892 A078899 A055172
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Feb 02 2020
STATUS
approved