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
