login
A350046
Numbers m such that, in the prime factorization of m! (with the primes in ascending order), no two successive exponents differ by a composite number.
0
2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 15, 32, 35, 162, 163
OFFSET
1,1
COMMENTS
Is this sequence finite?
After 163, there are no more terms through 10^10. - Jon E. Schoenfield, Dec 15 2021
Sequence is the same as numbers m such that, in the prime factorization of m! (with the exponents in ascending order), no two successive exponents differ by a composite number. This is due to the fact that in the factorization of m! with the primes in ascending order, the corresponding exponents are in descending order. - Chai Wah Wu, Jan 10 2022
EXAMPLE
15! = 2^11 * 3^6 * 5^3 * 7^2 * 11^1 * 13^1; the exponents are 11, 6, 3, 2, 1, 1, and no two successive/neighboring exponents differ by a composite number, so 15 is a term of the sequence.
MATHEMATICA
q[n_] := AllTrue[Differences @ Reverse[FactorInteger[n!][[;; , 2]]], !CompositeQ[#] &]; Select[Range[2, 200], q] (* Amiram Eldar, Dec 11 2021 *)
PROG
(Python)
import sympy
def last_exponent(c, i):
if sympy.nextprime(i//2)<=i:
if c==1 or sympy.isprime(c-1):
return(True)
else: return(False)
else:
if c==1 or sympy.isprime(c):
return(True)
else: return(False)
A350046_n=[2, 3]
for i in range(4, 1001):
p_expo=True
x = list(sympy.primerange(2, i//2+1))
prime_expo=[]
for j in (x):
c=i//j
s=0
while c!=0:
s=s+c
c=c//j
prime_expo.append(s)
c=prime_expo[0]
l=len(prime_expo)
for j in range(1, l):
c=c-prime_expo[j]
if c!=0:
if c!=1 and not sympy.isprime(c):
p_expo=False
break
c=prime_expo[j]
prime_expo=last_exponent(c, i)
if p_expo==True:
A350046_n.append(i)
print(A350046_n)
(Python)
from collections import Counter
from itertools import count, islice
from sympy import factorint, isprime
def A350046_gen(): # generator of terms
f = Counter()
for m in count(2):
f += Counter(factorint(m))
e = sorted(f.items())
if all(d <= 1 or isprime(d) for d in (abs(e[i+1][1]-e[i][1]) for i in range(len(e)-1))):
yield m
A350046_list = list(islice(A350046_gen(), 15)) # Chai Wah Wu, Jan 10 2022
(PARI) valp(n, p)=my(s); while(n\=p, s+=n); s
is(n)=my(o=valp(n, 2), e); forprime(p=3, , e=valp(n, p); if(o-e<4, return(1)); if(isprime(o-e), o=e, return(0))) \\ Charles R Greathouse IV, Dec 15 2021
CROSSREFS
Sequence in context: A178338 A048097 A130843 * A087087 A050742 A350572
KEYWORD
nonn
AUTHOR
Devansh Singh, Dec 11 2021
STATUS
approved