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.

Showing 1-2 of 2 results.

A330264 Distinct values of A330261 in order of their appearance as n grows.

Original entry on oeis.org

1, 0, -1, -2, -3, 4, -4, 5, 7, 2, -5, 3, -6, 6, -7, 9, 10, -8, 8, -14, -9, -12, 13, -16, 16, 18, 19, 15, -18, 21, -13, -17, -19, 17, -20, -25, -32, 32, -33, 33, 37, 35, -35, 39, -39, -42, 36, -38, -37, 38, 41, -34, 34, 43, -41, 12, -10, 11, 22, -21, -31, 29
Offset: 1

Views

Author

Rémy Sigrist, Dec 07 2019

Keywords

Comments

Every integer appears in the sequence.

Examples

			The first terms of A330261 and of this sequence are:
- A330261 = 1, 0, 1, -1, 1, 0, 1, -2, 1, 1, 1, -1, 1, 0, 1, -3, 1, 4, ...
- a       = 1, 0,    -1,          -2,                       -3,    4, ...
		

Crossrefs

Cf. A330261.

Programs

  • PARI
    See Links section.

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.

Original entry on oeis.org

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
Offset: 1

Views

Author

Rémy Sigrist, Dec 07 2019

Keywords

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.

Examples

			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)
		

Crossrefs

Programs

  • PARI
    See Links section.
Showing 1-2 of 2 results.