cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A330262 #11 Feb 27 2020 23:16:02
%S A330262 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,
%T A330262 -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,
%U A330262 -1,1,0,1,0,1,-3,1,-3,1,1,1,0,1,2,1,-2,1
%N 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.
%C A330262 This sequence is a variant of A330261.
%C A330262 After processing n, S has A268289(n) elements.
%C A330262 Every integer appears infinitely many times in the sequence:
%C A330262 - the proof is similar to that found in A330261,
%C A330262 - see A330265 for the values in order of appearance.
%H A330262 Rémy Sigrist, <a href="/A330262/b330262.txt">Table of n, a(n) for n = 1..8192</a>
%H A330262 Rémy Sigrist, <a href="/A330262/a330262.png">Scatterplot of the first 2^20 terms</a>
%H A330262 Rémy Sigrist, <a href="/A330262/a330262.gp.txt">PARI program for A330262</a>
%e A330262 The first terms, alongside the binary representation of n and the evolution of stack S, are:
%e A330262   n  a(n)  bin(n)  S
%e A330262   -  ----  ------  ------------------------------------------------------------
%e A330262   1     1       1  () -> (1)
%e A330262   2     0      10  (1) -> (1,1) -> (0)
%e A330262   3     1      11  (0) -> (0,1) -> (0,1,1)
%e A330262   4     1     100  (0,1,1) -> (0,1,1,1) -> (0,1,0) -> (0,1)
%e A330262   5     1     101  (0,1) -> (0,1,1) -> (0,0) -> (0,0,1)
%e A330262   6     0     110  (0,0,1) -> (0,0,1,1) -> (0,0,1,1,1) -> (0,0,1,0)
%e A330262   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)
%o A330262 (PARI) See Links section.
%Y A330262 Cf. A268289, A308551, A330261, A330265.
%K A330262 sign,base
%O A330262 1,20
%A A330262 _Rémy Sigrist_, Dec 07 2019