1,2

No more terms < 3^20. - Joshua Zucker, Jun 05 2006

Table of n, a(n) for n=1..9.

n: 1, 2, 4, 5, 7, 22, 43, 131, 394

n^2: 1, 4, 16, 25, 49, 484, 1849, 17161, 155236

n written in base 3: 1, 2, 11, 12, 21, 211, 1121, 11212, 112121

n^2 written in base 3: 1,11,121,221,1211,122221,2112111,212112121,21212221111

Select[Range[500], DigitCount[#, 3, 0]==DigitCount[#^2, 3, 0]==0&] (* Harvey P. Dale, Feb 06 2015 *)

(PARI) isok(n) = vecmin(digits(n, 3)) && vecmin(digits(n^2, 3)); \\ Michel Marcus, Oct 10 2013

Subsequence of A032924.

Sequence in context: A005620 A049915 A244332 * A301521 A097698 A233524

Adjacent sequences: A119906 A119907 A119908 * A119910 A119911 A119912

base,more,nonn

Zak Seidov, May 28 2006

approved