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!)
A216430 (-1)^A081603(n), parity of the number of 2's in the ternary expansion of n. 1
1, -1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, -1, -1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, -1, -1, 1, -1, -1, 1, 1, 1, -1, -1, -1, 1, -1, -1, 1, 1, 1, -1, -1, -1, 1, -1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1
LINKS
A. Aksenov, The Newman phenomenon and Lucas sequence, arXiv:1108.5352, chapter 6.
EXAMPLE
a(7) = -1 because 7 is 21 (has one 2s) in base 3, and (-1)^1 = -1.
a(8) = 1 because 8 is 22 (has two 2s) in base 3, and (-1)^2 = 1.
MAPLE
A081603 := proc(n)
local a, d ;
a := 0 ;
for d in convert(n, base, 3) do
if d = 2 then
a := a+1 ;
end if;
end do;
a;
end proc:
A216430 := proc(n)
(-1)^A081603(n) ;
end proc:
seq(A216430(n), n=1..90) ;
MATHEMATICA
Table[(-1)^DigitCount[n, 3, 2], {n, 90}] (* Alonso del Arte, Sep 08 2012 *)
CROSSREFS
Sequence in context: A209661 A033999 A000012 * A232544 A309873 A162511
KEYWORD
sign,easy,base
AUTHOR
R. J. Mathar, Sep 08 2012
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 April 25 11:39 EDT 2024. Contains 371969 sequences. (Running on oeis4.)