login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A257868 Negative integers n such that in balanced ternary representation the number of occurrences of each trit doubles when n is squared. 3
-314, -898, -942, -2694, -2824, -2826, -2962, -3014, -3070, -3074, -8066, -8082, -8090, -8096, -8132, -8170, -8224, -8336, -8426, -8434, -8450, -8472, -8478, -8480, -8618, -8656, -8870, -8886, -8918, -9008, -9042, -9210, -9222, -9224, -24198, -24226, -24246 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
Wikipedia, Balanced ternary
EXAMPLE
-898 is in the sequence because -898 = LL10L1L_bal3 and (-898)^2 = 806404 = 1LLLL00L1LLL11_bal3, where L represents (-1).
MAPLE
p:= proc(n) local d, m, r; m:=abs(n); r:=0;
while m>0 do
d:= irem(m, 3, 'm');
if d=2 then m:=m+1 fi;
r:=r+x^`if`(n>0, d, irem(3-d, 3))
od; r
end:
a:= proc(n) option remember; local k;
for k from -1+`if`(n=1, 0, a(n-1)) by -1
while p(k)*2<>p(k^2) do od; k
end:
seq(a(n), n=1..50);
PROG
(Python)
def a(n):
s=[]
l=[]
x=0
while n>0:
x=n%3
n//=3
if x==2:
x=-1
n+=1
s.append(x)
l.append(-x)
return [s, l]
print([-n for n in range(1, 25001) if a(n**2)[0].count(-1)==2*a(n)[1].count(-1) and a(n**2)[0].count(1)==2*a(n)[1].count(1) and a(n**2)[0].count(0)==2*a(n)[1].count(0)]) # Indranil Ghosh, Jun 07 2017
CROSSREFS
Sequence in context: A161963 A276993 A205618 * A257867 A050818 A050807
KEYWORD
sign,base
AUTHOR
Alois P. Heinz, May 11 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 16:58 EDT 2024. Contains 371254 sequences. (Running on oeis4.)