|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
|
|
|
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)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|