cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A383612 #26 May 12 2025 19:54:37
%S A383612 3,5,7,11,13,14,15,17,19,23,29,30,31,37,38,39,41,42,43,44,45,47,53,54,
%T A383612 55,59,60,61,62,63,67,71,73,74,75,79,83,84,85,89,90,91,97,98,99,101,
%U A383612 102,103,104,105,107,108,109,110,111,113,114,115,127,131,137,138,139,140,141,149,150
%N 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.
%C A383612 All odd primes are contained within this sequence.
%e A383612 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.
%e A383612 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.
%e A383612 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.
%o A383612 (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
%o A383612 (Python)
%o A383612 from sympy import primerange, prevprime
%o A383612 def valuation(n, p):
%o A383612   count = 0
%o A383612   i = p
%o A383612   while n // i >= 1:
%o A383612     count += n // i
%o A383612     i *= p
%o A383612   return count
%o A383612 def create_list():
%o A383612   result_list = []
%o A383612   for n in range(2, 151):
%o A383612     for p in primerange(3, n + 1):
%o A383612       if 2 + valuation(n, 2) < p + valuation(n, p):
%o A383612         result_list.append(n)
%o A383612         break
%o A383612   return result_list
%o A383612 result = create_list()
%o A383612 print(result)
%Y A383612 Cf. A000142, A007814, A007917.
%K A383612 nonn
%O A383612 1,1
%A A383612 _Ryan Jean_, May 02 2025