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.

A174813 a(n) = number whose product of digits equals a power of 3.

This page as a plain text file.
%I A174813 #22 Jun 28 2025 09:52:44
%S A174813 1,3,9,11,13,19,31,33,39,91,93,99,111,113,119,131,133,139,191,193,199,
%T A174813 311,313,319,331,333,339,391,393,399,911,913,919,931,933,939,991,993,
%U A174813 999,1111,1113,1119,1131,1133,1139,1191,1193,1199,1311,1313,1319,1331
%N A174813 a(n) = number whose product of digits equals a power of 3.
%C A174813 Equivalently, numbers whose decimal representation consists of digits from the set {1,3,9}.
%H A174813 Reinhard Zumkeller, <a href="/A174813/b174813.txt">Table of n, a(n) for n = 1..10000</a>
%e A174813 a(9)=39 is in the sequence because 3*9=3^3.
%t A174813 Select[Range[2000], IntegerQ[Log[3, Times @@ (IntegerDigits[#])]] &]
%o A174813 (Haskell)
%o A174813 a174813 n = a174813_list !! (n-1)
%o A174813 a174813_list = f [1] where
%o A174813    f ds = foldr (\d v -> 10 * v + d) 0 ds : f (s ds)
%o A174813    s [] = [1]; s (9:ds) = 1 : s ds; s (d:ds) = 3*d : ds
%o A174813 -- _Reinhard Zumkeller_, Jan 13 2014
%o A174813 (Python)
%o A174813 from sympy import integer_log
%o A174813 def A174813(n):
%o A174813     m = integer_log(k:=(n<<1)+1,3)[0]
%o A174813     return sum(3**((k-3**m)//(3**j<<1)%3)*10**j for j in range(m)) # _Chai Wah Wu_, Jun 28 2025
%Y A174813 Cf. A028846, A061427.
%K A174813 nonn,base
%O A174813 1,2
%A A174813 _Michel Lagneau_, Dec 01 2010