A085133 Numbers k such that k and its digit reversal are both 7-smooth (A002473).
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 18, 20, 21, 24, 27, 30, 36, 40, 42, 45, 48, 50, 54, 60, 63, 70, 72, 80, 81, 84, 90, 100, 120, 144, 180, 200, 210, 240, 252, 270, 288, 300, 343, 360, 400, 405, 420, 441, 450, 480, 500, 504, 525, 540, 576, 600, 630, 675, 686, 700, 720
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000 (terms 1..1225 from Robert Israel)
Programs
-
Maple
N:= 10^3: # to get all terms <= N (which should be a power of 10) revdigs:= proc(n) local L; L:= convert(n,base,10); add(10^(i-1)*L[-i],i=1..nops(L)) end proc: S:= {seq(seq(seq(seq(2^a*3^b*5^c*7^d, d=0..floor(log[7](N/(2^a*3^b*5^c)))),c=0..floor(log[5](N/(2^a*3^b)))), b=0..floor(log[3](N/2^a))), a=0..floor(log[2](N)))}: S:= S intersect map(revdigs, S): S:= map(t -> seq(t*10^i, i=0..ilog10(N/t)), S): sort(convert(S,list)); # Robert Israel, Mar 18 2018
-
Python
import heapq from itertools import islice from sympy import factorint def is7smooth(n): for p in [2, 3, 5, 7]: while n%p == 0: n //= p return n == 1 def agen(): # generator of terms v, oldv, h = 1, 0, [1] while True: v = heapq.heappop(h) if v != oldv: if is7smooth(int(str(v)[::-1])): yield v oldv = v for p in [2, 3, 5, 7]: heapq.heappush(h, v*p) print(list(islice(agen(), 65))) # Michael S. Branicky, Sep 20 2024
Extensions
More terms from David Wasserman, Jan 28 2005
Comments