Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Geometric mean of digits = 3 and digits are in nondecreasing order.
3

%I #12 Apr 29 2021 00:57:22

%S 3,19,33,139,333,1199,1339,3333,11399,13339,33333,111999,113399,

%T 133339,333333,1113999,1133399,1333339,3333333,11119999,11133999,

%U 11333399,13333339,33333333,111139999,111333999,113333399,133333339,333333333,1111199999,1111339999

%N Geometric mean of digits = 3 and digits are in nondecreasing order.

%C No number is obtainable by permuting the digits of other members - only one with ascending order of digits is included.

%H Michael S. Branicky, <a href="/A069516/b069516.txt">Table of n, a(n) for n = 1..10000</a>

%e 1339 belongs to this sequence but 1933 does not.

%t a = {}; b = 3; Do[c = Apply[ Times, IntegerDigits[n]]/b^Floor[ Log[10, n] + 1]; If[c == 1 && Position[a, FromDigits[ Sort[ IntegerDigits[n]]]] == {}, Print[n]; a = Append[a, n]], {n, 1, 10^8}]

%o (Python)

%o from math import prod

%o from sympy.utilities.iterables import multiset_combinations

%o def aupton(terms):

%o n, digits, alst, powsexps3 = 0, 1, [], [(1, 0), (3, 1), (9, 2)]

%o while n < terms:

%o target = 3**digits

%o mcstr = "".join(str(d)*(digits//max(1, r)) for d, r in powsexps3)

%o for mc in multiset_combinations(mcstr, digits):

%o if prod(map(int, mc)) == target:

%o n += 1

%o alst.append(int("".join(mc)))

%o if n == terms: break

%o else: digits += 1

%o return alst

%o print(aupton(31)) # _Michael S. Branicky_, Apr 28 2021

%Y Cf. A061427, A069512, A069518.

%K nonn,base

%O 1,1

%A _Amarnath Murthy_, Mar 30 2002

%E Edited and extended by _Robert G. Wilson v_, Apr 01 2002

%E Name edited and a(30) and beyond from _Michael S. Branicky_, Apr 28 2021