OFFSET
1,2
LINKS
David A. Corneth, Table of n, a(n) for n = 1..10195
FORMULA
Sum_{n>=1} 1/a(n) = 63/16. - Amiram Eldar, Apr 01 2021
EXAMPLE
12 is in the sequence as all of its prime divisors are <= 7 and 12 is not divisible by 10.
MATHEMATICA
Select[Range@500, Max[First/@FactorInteger@#]<=7&&Mod[#, 10]!=0&] (* Giorgos Kalogeropoulos, Mar 30 2021 *)
PROG
(PARI) is(n) = if(n%10 == 0, return(0)); forprime(p = 2, 7, n/=p^valuation(n, p)); n==1
(Python)
A342950_list, n = [], 1
while n < 10**9:
if n % 10:
m = n
for p in (2, 3, 5, 7):
q, r = divmod(m, p)
while r == 0:
m = q
q, r = divmod(m, p)
if m == 1:
A342950_list.append(n)
n += 1 # Chai Wah Wu, Mar 31 2021
(Python)
from sympy import integer_log
def A342950(n):
def bisection(f, kmin=0, kmax=1):
while f(kmax) > kmax: kmax <<= 1
while kmax-kmin > 1:
kmid = kmax+kmin>>1
if f(kmid) <= kmid:
kmax = kmid
else:
kmin = kmid
return kmax
def f(x):
c = n+x
for i in range(integer_log(x, 7)[0]+1):
for j in range(integer_log(m:=x//7**i, 3)[0]+1):
c -= (k:=m//3**j).bit_length()+integer_log(k, 5)[0]
return c
return bisection(f, n, n) # Chai Wah Wu, Sep 17 2024
(Python) # faster for initial segment of sequence
import heapq
from itertools import islice
def A342950gen(): # generator of terms
v, oldv, h, psmooth_primes, = 1, 0, [1], [2, 3, 5, 7]
while True:
v = heapq.heappop(h)
if v != oldv:
yield v
oldv = v
for p in psmooth_primes:
if not (p==2 and v%5==0) and not (p==5 and v&1==0):
heapq.heappush(h, v*p)
print(list(islice(A342950gen(), 65))) # Michael S. Branicky, Sep 17 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
David A. Corneth, Mar 30 2021
STATUS
approved