login
A383612
Numbers k such that 2 + val(k!, 2) < p + val(k!, p), where p is the largest prime <= k and val(r, m) is the valuation of r at m.
0
3, 5, 7, 11, 13, 14, 15, 17, 19, 23, 29, 30, 31, 37, 38, 39, 41, 42, 43, 44, 45, 47, 53, 54, 55, 59, 60, 61, 62, 63, 67, 71, 73, 74, 75, 79, 83, 84, 85, 89, 90, 91, 97, 98, 99, 101, 102, 103, 104, 105, 107, 108, 109, 110, 111, 113, 114, 115, 127, 131, 137, 138, 139, 140, 141, 149, 150
OFFSET
1,1
COMMENTS
All odd primes are contained within this sequence.
EXAMPLE
For 3, p = 3 since 3 is the largest prime <= 3, and since val(3!, 2) = 1 and val(3!, 3) = 1, 2 + 1 = 3 < 4 = 3 + 1. So, 3 is in the sequence.
For 5, p = 5 since 5 is the largest prime <= 5, and since val(5!, 2) = 3 and val(5!, 5) = 1, 2 + 3 = 5 < 6 = 5 + 1. So, 5 is in the sequence.
For 14, p = 13 since 13 is the largest prime <= 14, and since val(14!, 2) = 11 and val(14!, 13) = 1, 2 + 11 = 13 < 14 = 13 + 1. So, 14 is in the sequence.
PROG
(PARI) isok(k) = if (k>1, my(p=precprime(k), fk=k!); 2 + valuation(fk, 2) < p + valuation(fk, p)); \\ Michel Marcus, May 02 2025
(Python)
from sympy import primerange, prevprime
def valuation(n, p):
count = 0
i = p
while n // i >= 1:
count += n // i
i *= p
return count
def create_list():
result_list = []
for n in range(2, 151):
for p in primerange(3, n + 1):
if 2 + valuation(n, 2) < p + valuation(n, p):
result_list.append(n)
break
return result_list
result = create_list()
print(result)
CROSSREFS
KEYWORD
nonn
AUTHOR
Ryan Jean, May 02 2025
STATUS
approved