login
Squares that are 7-smooth.
1

%I #31 Sep 18 2024 03:50:41

%S 1,4,9,16,25,36,49,64,81,100,144,196,225,256,324,400,441,576,625,729,

%T 784,900,1024,1225,1296,1600,1764,2025,2304,2401,2500,2916,3136,3600,

%U 3969,4096,4900,5184,5625,6400,6561,7056,8100,9216,9604,10000,11025,11664,12544,14400

%N Squares that are 7-smooth.

%C Also, distinct terms appearing in A352598, or terms of the form 4^i * 9^j * 25^k * 49^m for i, j, k, m >= 0.

%H Michael De Vlieger, <a href="/A352618/b352618.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A002473(n)^2. - _Pontus von Brömssen_, Mar 24 2022

%F Sum_{n>=1} 1/a(n) = 1225/768. - _Amiram Eldar_, Mar 24 2022

%e 49 = 7*7, 81 = (3*3)*(3*3), and 100 = (2*5)*(2*5) are terms.

%t Select[Range[120], Max[FactorInteger[#][[;; , 1]]] <= 7 &]^2 (* _Amiram Eldar_, Mar 24 2022 *)

%t With[{n = 15000}, Union@ Flatten@ Table[2^(2 a)*3^(2 b)*5^(2 c)*7^(2 d), {a, 0, Log[4, n]}, {b, 0, Log[9, n/(2^(2 a))]}, {c, 0, Log[25, n/(2^(2 a)*3^(2 b))]}, {d, 0, Log[49, n/(2^(2 a)*3^(2 b)*5^(2 c))]}]] (* _Michael De Vlieger_, Mar 26 2022 *)

%o (Python)

%o from itertools import count, islice

%o def agen():

%o for i in count(1):

%o k = i

%o for p in [2, 3, 5, 7]:

%o while k%p == 0:

%o k //= p

%o if k == 1:

%o yield i*i

%o print(list(islice(agen(), 50)))

%o (Python)

%o from sympy import integer_log

%o def A352618(n):

%o def bisection(f,kmin=0,kmax=1):

%o while f(kmax) > kmax: kmax <<= 1

%o while kmax-kmin > 1:

%o kmid = kmax+kmin>>1

%o if f(kmid) <= kmid:

%o kmax = kmid

%o else:

%o kmin = kmid

%o return kmax

%o def f(x):

%o c = n+x

%o for i in range(integer_log(x,7)[0]+1):

%o for j in range(integer_log(m:=x//7**i,5)[0]+1):

%o for k in range(integer_log(r:=m//5**j,3)[0]+1):

%o c -= (r//3**k).bit_length()

%o return c

%o return bisection(f,n,n)**2 # _Chai Wah Wu_, Sep 17 2024

%o (Python) # faster for initial segment of sequence

%o import heapq

%o from itertools import islice

%o from sympy import primerange

%o def A352618gen(p=7): # generator of terms

%o v, oldv, h, psmooth_primes, = 1, 0, [1], list(primerange(1, p+1))

%o while True:

%o v = heapq.heappop(h)

%o if v != oldv:

%o yield v*v

%o oldv = v

%o for p in psmooth_primes:

%o heapq.heappush(h, v*p)

%o print(list(islice(A352618gen(), 65))) # _Michael S. Branicky_, Sep 17 2024

%Y Intersection of A000290 and A002473.

%Y Cf. A352598.

%K nonn

%O 1,2

%A _Michael S. Branicky_, Mar 24 2022