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.

A076092 a(n) = n - 2*Sum_{i=1..n} A076182(i).

Original entry on oeis.org

1, 0, -1, 0, 1, 2, 1, 0, -1, -2, -1, -2, -3, -2, -1, 0, -1, 0, 1, 2, 3, 2, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0, 1, 2, 3, 2, 1, 0, -1, -2, -3, -4, -3, -2, -1, 0, 1, 0, -1, -2, -3, -4, -5, -6, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 1, 0, -1, -2, -3, -4, -5, -4, -5, -4, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -4, -5, -4, -3
Offset: 1

Views

Author

Benoit Cloitre, Nov 01 2002

Keywords

Comments

Recall the modified Collatz map: x->x/2 if x is even; x->(3x+1)/2 if x is odd. Let C_m(n) denotes the image of n after m iterations. Then b(n) = A076182(n) = (lim_{k->infinity} C_2k(n))-1 (from the Collatz conjecture C_2k(n) is constant = 1 or 2 for k sufficiently large).
Curiously the graph of a(n) has "regularities" around 0 and a pattern that becomes larger and larger when compared with a random sequence of the form n - 2*Sum_{k=1..n} r(k) where r(k) takes random values from (0;1).

Examples

			b(12)=1 since, starting with 12, the Collatz map gives: 12->6->3->5->8->4->2->1, then C_6(12)=2 and then b(12) = C_6(12)-1 = 1.
		

Crossrefs

Cf. A076182 (b(n) sequence).

Programs

  • PARI
    a(n)=n-2*sum(i=1,n,if(i<0,0,s=i; c=0; while(s>1,s=(s%2)*(3*s+1)/2+(1-s%2)*s/2; c++); c)%2)

Extensions

Revised by Sean A. Irvine, Mar 19 2025