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.

A119632 Lengths of successive runs in A160357, where a run here means a string of alternating terms.

This page as a plain text file.
%I A119632 #39 Jan 25 2025 02:12:11
%S A119632 1,1,3,1,11,1,4,10,1,4,28,1,10,24,1,8,1,2,1,1,4,1,9,4,1,2,36,1,12,4,1,
%T A119632 2,1,3,28,1,10,52,1,18,1,32,1,12,15,38,1,14,32,1,12,1,44,1,16,1,148,1,
%U A119632 50,7,22,1,8,3,4,1,2,70,1,24,1,114,1,42,1,200,1,68,6,1,2,13
%N A119632 Lengths of successive runs in A160357, where a run here means a string of alternating terms.
%C A119632 Gives a highly compressed version of A005132.
%C A119632 The encoding of Recamán's sequence a(n) = A005132 using A119632 is easy - A119632 counts runs of alternating i(n)'s, where i(n) = (a(n)-a(n-1))/n = A160357(n).
%C A119632 Note that i(n) is always +1 or -1.  Each run ends when i(n) = i(n+1).
%C A119632 Here is pseudo-code to reconstruct Recamán's sequence from A119632, which we will call I(n):
%C A119632         a(0) = 0
%C A119632         n = 1
%C A119632         i = 1
%C A119632         for k = 1..oo {
%C A119632                 for j = 1..I(k) {
%C A119632                         a(n) = a(n-1) + n*i
%C A119632                         n = n+1
%C A119632                         i = -i
%C A119632                 }
%C A119632                 i = -i
%C A119632         }
%C A119632 The gzipped file attached to A119632 represents the first 1470117206801829 terms of A005132. The longest run of alternating i(n)'s (maximal value found so far in A119632) is 232144588914. There are 64094657 runs encoded in the gzipped file.
%H A119632 Allan Wilks, <a href="/A119632/b119632.txt">Table of n, a(n) for n = 1..100000</a>
%H A119632 Allan Wilks, <a href="/A119632/a119632.gz">The first 64094657 terms (gzipped)</a>. (A large file. This encodes the first 1470117206801829 terms of A005132!)
%H A119632 <a href="/index/Rea#Recaman">Index entries for sequences related to Recamán's sequence</a>
%e A119632 A160357 begins 1, 1; 1; -1, 1, 1; 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1; 1; -1, 1, -1, -1; 1, -1, 1, -1, 1, -1, 1, -1, 1, 1; 1; ..., where semicolons demark the successive runs.
%Y A119632 Cf. A005132, A160357.
%K A119632 nonn
%O A119632 1,3
%A A119632 _N. J. A. Sloane_ and _Allan Wilks_, Jun 10 2006
%E A119632 Entry expanded by _N. J. A. Sloane_, Jul 15 2011