login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A363408
Squares whose base-3 expansion has no 2.
2
0, 1, 4, 9, 36, 81, 121, 256, 324, 361, 729, 841, 1089, 2304, 2916, 3025, 3249, 6561, 6889, 7569, 9801, 20449, 20736, 26244, 26569, 27225, 29241, 59049, 60025, 62001, 68121, 68644, 88209, 177241, 184041, 186624, 203401, 236196, 237169, 239121, 245025, 263169, 531441, 534361, 540225, 558009
OFFSET
1,3
COMMENTS
Squares that are the sum of distinct powers of 3.
If k is a term, then so is 9*k.
The only square whose base-3 expansion has no 1 is 0.
LINKS
FORMULA
a(n) = A176189(n-1)^2 for n>=2. - Alois P. Heinz, Jun 07 2023
EXAMPLE
a(5) = 36 is a term because 36 = 6^2 = 3^2 + 3^3.
MAPLE
R:= {0, 1};
S:= {1};
for i from 1 to 20 do
S:= map(t -> (3*t, 3*t+1), S);
R:= R union select(issqr, S)
od:
R;
MATHEMATICA
Select[Range[0, 1000]^2, ! MemberQ[IntegerDigits[#, 3], 2] &] (* Amiram Eldar, Jun 01 2023 *)
PROG
(Python)
from gmpy2 import digits
def okA176189(n): return "2" not in digits(n*n, 3)
print([k**2 for k in range(1000) if okA176189(k)]) # Michael S. Branicky, Jun 07 2023
CROSSREFS
Intersection of A000290 and A005836. Cf. A363428.
Cf. A176189.
Sequence in context: A326182 A053057 A118547 * A115700 A029806 A133125
KEYWORD
nonn,base
AUTHOR
Robert Israel, May 31 2023
STATUS
approved