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.

A324787 Index of n-th low point in A022837.

This page as a plain text file.
%I A324787 #10 Oct 18 2020 02:49:59
%S A324787 2,5,12,29,78,199,508,1355,3592,9589,25752,70579,194228,539961,
%T A324787 1507602,4228745,11913940,33690443,95581182,272003821,776082524,
%U A324787 2219823175,6363074656
%N A324787 Index of n-th low point in A022837.
%C A324787 A "low point" in a sequence is a term which is less than the previous term (this condition is skipped for the initial term) and which is followed by two or more increases.
%H A324787 Rémy Sigrist, <a href="/A324787/a324787.gp.txt">PARI program for A324787</a>
%p A324787 Riecaman := proc(a,s,M)
%p A324787 # Start with s, add or subtract a[n], get M terms. If a has w terms, can get M=w+1 terms.
%p A324787 local b,M2,n,t;
%p A324787 if whattype(a) <> list then ERROR("First argument should be a list"); fi;
%p A324787 if a[1]=0 then ERROR("a[1] should not be zero"); fi;
%p A324787 M2 := min(nops(a),M-1);
%p A324787 b:=[s]; t:=s;
%p A324787 for n from 1 to M2 do
%p A324787    if a[n]>t then t:=t+a[n] else t:=t-a[n]; fi; b:=[op(b),t]; od:
%p A324787 b; end;
%p A324787 blocks := proc(a,S) local b,c,d,M,L,n;
%p A324787 # Given a list a, whose leading term has index S, return [b,c,d], where b lists the indices of the low points in a, c lists the values of a at the low points, and d lists the length of runs between the low points.
%p A324787 b:=[]; c:=[]; d:=[]; L:=1;
%p A324787 # if a[1] a low point?
%p A324787    n:=1;
%p A324787    if( (a[n+1]>a[n]) and (a[n+2]>a[n+1]) ) then
%p A324787    b:=[op(b),n+S-1]; c:=[op(c),a[n]]; d:=[op(d), n-L]; L:=n; fi;
%p A324787 for n from 2 to nops(a)-2 do
%p A324787 # if a[n] a low point?
%p A324787    if( (a[n-1]>a[n]) and (a[n+1]>a[n]) and (a[n+2]>a[n+1]) ) then
%p A324787    b:=[op(b),n+S-1]; c:=[op(c),a[n]]; d:=[op(d), n-L]; L:=n; fi; od;
%p A324787 [b,c,d]; end;
%p A324787 p0:=[seq(ithprime(n),n=1..100001)]:
%p A324787 q1:=Riecaman(p0,1,100000):
%p A324787 blocks(q1,0); # produces [the present sequence, A324788, A324789]
%o A324787 (PARI) See Links section.
%Y A324787 Cf. A022837, A324788, A324789, A324790.
%Y A324787 If the basic sequence (A022837) began with 0 instead of 1 we would get A008348, A309226, A324782, A324783, A309225.
%K A324787 nonn,more
%O A324787 0,1
%A A324787 _N. J. A. Sloane_, Sep 04 2019
%E A324787 Modified definition to make offset 0. - _N. J. A. Sloane_, Oct 02 2019
%E A324787 a(12)-a(22) from _Rémy Sigrist_, Oct 18 2020