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.

Showing 1-2 of 2 results.

A352618 Squares that are 7-smooth.

Original entry on oeis.org

1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 144, 196, 225, 256, 324, 400, 441, 576, 625, 729, 784, 900, 1024, 1225, 1296, 1600, 1764, 2025, 2304, 2401, 2500, 2916, 3136, 3600, 3969, 4096, 4900, 5184, 5625, 6400, 6561, 7056, 8100, 9216, 9604, 10000, 11025, 11664, 12544, 14400
Offset: 1

Views

Author

Michael S. Branicky, Mar 24 2022

Keywords

Comments

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.

Examples

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

Crossrefs

Intersection of A000290 and A002473.
Cf. A352598.

Programs

  • Mathematica
    Select[Range[120], Max[FactorInteger[#][[;; , 1]]] <= 7 &]^2 (* Amiram Eldar, Mar 24 2022 *)
    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 *)
  • Python
    from itertools import count, islice
    def agen():
        for i in count(1):
            k = i
            for p in [2, 3, 5, 7]:
                while k%p == 0:
                    k //= p
            if k == 1:
                yield i*i
    print(list(islice(agen(), 50)))
    
  • Python
    from sympy import integer_log
    def A352618(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,5)[0]+1):
                    for k in range(integer_log(r:=m//5**j,3)[0]+1):
                        c -= (r//3**k).bit_length()
            return c
        return bisection(f,n,n)**2 # Chai Wah Wu, Sep 17 2024
    
  • Python
    # faster for initial segment of sequence
    import heapq
    from itertools import islice
    from sympy import primerange
    def A352618gen(p=7): # generator of terms
        v, oldv, h, psmooth_primes, = 1, 0, [1], list(primerange(1, p+1))
        while True:
            v = heapq.heappop(h)
            if v != oldv:
                yield v*v
                oldv = v
                for p in psmooth_primes:
                    heapq.heappush(h, v*p)
    print(list(islice(A352618gen(), 65))) # Michael S. Branicky, Sep 17 2024

Formula

a(n) = A002473(n)^2. - Pontus von Brömssen, Mar 24 2022
Sum_{n>=1} 1/a(n) = 1225/768. - Amiram Eldar, Mar 24 2022

A352595 Positive integers that are fixed points for the map x->f^k(x) for some k>1, where f(x) is the product of squares of nonzero digits of x.

Original entry on oeis.org

256, 324, 576, 3600, 11664, 15876, 20736, 44100, 63504, 65536, 129600, 2822400, 5308416, 7290000, 8294400
Offset: 1

Views

Author

Michael S. Branicky, Mar 24 2022

Keywords

Comments

f(x) = A352598(x).
Fixed points of f(x) are in A115385.
64524128256, 386983526400, 849346560000, 49787136000000, 55725627801600 are also terms.

Examples

			256 -> 3600 -> 324 -> 576 -> 44100 -> 256 is a limit cycle of f, so all elements are terms.
		

Crossrefs

Subsequence of the intersection of A000290 and A002473.

Programs

  • Python
    from math import prod
    from itertools import count, islice
    def f(n): return prod(int(d)**2 for d in str(n) if d != "0")
    def ok(n):
        n0, k, seen = n, 0, set(),
        while n not in seen: # iterate until fixed point or in cycle
            seen.add(n)
            n = f(n)
            k += 1
        return n == n0 and k > 1
    def agen(startk=1):
        for m in count(1):
            if ok(m): yield m
    print(list(islice(agen(), 11)))
Showing 1-2 of 2 results.