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!)
A332498 a(n) = y(w+1) where y(0) = 0 and y(k+1) = 2^(k+1)-1-y(k) (resp. y(k)) when d_k = 2 (resp. d_k <> 2) and Sum_{k=0..w} d_k*3^k is the ternary representation of n. Sequence A332497 gives corresponding x's. 3
0, 0, 1, 0, 0, 1, 3, 3, 2, 0, 0, 1, 0, 0, 1, 3, 3, 2, 7, 7, 6, 7, 7, 6, 4, 4, 5, 0, 0, 1, 0, 0, 1, 3, 3, 2, 0, 0, 1, 0, 0, 1, 3, 3, 2, 7, 7, 6, 7, 7, 6, 4, 4, 5, 15, 15, 14, 15, 15, 14, 12, 12, 13, 15, 15, 14, 15, 15, 14, 12, 12, 13, 8, 8, 9, 8, 8, 9, 11, 11 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,7
LINKS
FORMULA
a(n) = 0 iff n belongs to A005836.
EXAMPLE
For n = 42:
- the ternary representation of 42 is "1120",
- x(0) = 0,
- x(1) = x(0) = 0 (as d_0 = 0),
- x(2) = 2^2-1 - x(1) = 3 (as d_1 = 2),
- x(3) = x(2) = 3 (as d_2 = 1 <> 2),
- x(4) = x(3) = 3 (as d_3 = 1 <> 2),
- hence a(42) = 3.
PROG
(PARI) a(n) = { my (y=0, k=1); while (n, if (n%3==2, y=2^k-1-y); n\=3; k++); y }
CROSSREFS
Cf. A005836, A332497 (corresponding x's and additional comments).
Sequence in context: A271082 A053375 A117252 * A181407 A114187 A016037
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Feb 14 2020
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 August 11 17:45 EDT 2024. Contains 375073 sequences. (Running on oeis4.)