The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A330262 Start with an empty stack S; for n = 1, 2, 3, ..., interpret the binary representation of n from left to right as follows: in case of bit 1, push the number 1 on top of S, in case of bit 0, replace the two numbers on top of S, say u on top of v, with v-u; a(n) gives the number on top of S after processing n. 2
 1, 0, 1, 1, 1, 0, 1, 0, 1, -1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 2, 1, 0, 1, 0, 1, -1, 1, 1, 1, 0, 1, 0, 1, -1, 1, -1, 1, 0, 1, -1, 1, -2, 1, 0, 1, 0, 1, 1, 1, 0, 1, 2, 1, 0, 1, 0, 1, -1, 1, 1, 1, 0, 1, 1, 1, -1, 1, 0, 1, 0, 1, -3, 1, -3, 1, 1, 1, 0, 1, 2, 1, -2, 1 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,20 COMMENTS This sequence is a variant of A330261. After processing n, S has A268289(n) elements. Every integer appears infinitely many times in the sequence: - the proof is similar to that found in A330261, - see A330265 for the values in order of appearance. LINKS Rémy Sigrist, Table of n, a(n) for n = 1..8192 Rémy Sigrist, Scatterplot of the first 2^20 terms Rémy Sigrist, PARI program for A330262 EXAMPLE The first terms, alongside the binary representation of n and the evolution of stack S, are:   n  a(n)  bin(n)  S   -  ----  ------  ------------------------------------------------------------   1     1       1  () -> (1)   2     0      10  (1) -> (1,1) -> (0)   3     1      11  (0) -> (0,1) -> (0,1,1)   4     1     100  (0,1,1) -> (0,1,1,1) -> (0,1,0) -> (0,1)   5     1     101  (0,1) -> (0,1,1) -> (0,0) -> (0,0,1)   6     0     110  (0,0,1) -> (0,0,1,1) -> (0,0,1,1,1) -> (0,0,1,0)   7     1     111  (0,0,1,0) -> (0,0,1,0,1) -> (0,0,1,0,1,1) -> (0,0,1,0,1,1,1) PROG (PARI) See Links section. CROSSREFS Cf. A268289, A308551, A330261, A330265. Sequence in context: A339872 A280269 A321894 * A098055 A344739 A092111 Adjacent sequences:  A330259 A330260 A330261 * A330263 A330264 A330265 KEYWORD sign,base AUTHOR Rémy Sigrist, Dec 07 2019 STATUS approved

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

Last modified June 22 21:29 EDT 2021. Contains 345393 sequences. (Running on oeis4.)