login
Positive numbers of the form u * v where the ternary representations of u and of v have the same number of digits d for d = 0..2.
5

%I #10 Jan 13 2020 18:27:22

%S 1,4,9,16,25,35,36,49,64,81,100,120,121,144,165,169,196,209,224,225,

%T 231,256,285,289,308,315,324,352,361,391,399,400,425,441,480,484,529,

%U 575,576,625,676,729,784,840,841,900,957,961,1008,1024,1080,1088,1089

%N Positive numbers of the form u * v where the ternary representations of u and of v have the same number of digits d for d = 0..2.

%C In other words, the terms of this sequence are squares or the products of two ternary anagrams.

%C Leading zeros are ignored.

%C If m belongs to the sequence, then 9*m also belongs to the sequence.

%H Rémy Sigrist, <a href="/A331220/b331220.txt">Table of n, a(n) for n = 1..10000</a>

%e The ternary representations of 5 and 7 are "12" and "21", respectively.

%e So 5 and 7 are ternary anagrams, and 35 = 7*5 belongs to the sequence.

%o (PARI) is(n, base=3) = fordiv (n,d, if (vecsort(digits(d,base))==vecsort(digits(n/d,base)), return (1))); return (0)

%Y Cf. A331219 (binary analog), A331221 (decimal analog), A331268, A331269.

%K nonn,base

%O 1,2

%A _Rémy Sigrist_, Jan 12 2020