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-5 of 5 results.

A309226 Index of n-th low point in A008348 (see Comments for definition).

Original entry on oeis.org

0, 3, 8, 21, 56, 145, 366, 945, 2506, 6633, 17776, 48521, 133106, 369019, 1028404, 2880287, 8100948, 22877145, 64823568, 184274931, 525282740, 1501215193, 4299836186, 12340952049, 35486796312, 102220582465, 294917666854, 852123981581, 2465458792768
Offset: 0

Views

Author

N. J. A. Sloane, Sep 01 2019

Keywords

Comments

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.
This concept is useful for the analysis of sequences (such as A005132, A008344, A008348, A022837, A076042, A309222, etc.) which have long runs of terms which alternately rise and fall.

Crossrefs

Programs

  • Maple
    blocks := proc(a,S) local b,c,d,M,L,n;
    # 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.
    b:=[]; c:=[]; d:=[]; L:=1;
    # is a[1] a low point?
       n:=1;
       if( (a[n+1]>a[n]) and (a[n+2]>a[n+1]) ) then
       b:=[op(b),n+S-1]; c:=[op(c),a[n]]; d:=[op(d), n-L]; L:=n; fi;
    for n from 2 to nops(a)-2 do
    # is a[n] a low point?
       if( (a[n-1]>a[n]) and (a[n+1]>a[n]) and (a[n+2]>a[n+1]) ) then
       b:=[op(b),n+S-1]; c:=[op(c),a[n]]; d:=[op(d), n-L]; L:=n; fi; od;
    [b,c,d]; end;
    # Let a := [0, 2, 5, 0, 7, 18, 5, 22, 3, 26, 55, 24, ...]; be a list of the first terms in A008348
    blocks(a,0)[1]; # the present sequence
    blocks(a,0)[2]; # A324782
    blocks(a,0)[3]; # A324783

Formula

a(n) = A135025(n-1)-1.

Extensions

a(17)-a(28) from Giovanni Resta, Oct 02 2019
Modified definition to make offset 0. - N. J. A. Sloane, Oct 02 2019

A324787 Index of n-th low point in A022837.

Original entry on oeis.org

2, 5, 12, 29, 78, 199, 508, 1355, 3592, 9589, 25752, 70579, 194228, 539961, 1507602, 4228745, 11913940, 33690443, 95581182, 272003821, 776082524, 2219823175, 6363074656
Offset: 0

Views

Author

N. J. A. Sloane, Sep 04 2019

Keywords

Comments

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.

Crossrefs

If the basic sequence (A022837) began with 0 instead of 1 we would get A008348, A309226, A324782, A324783, A309225.

Programs

  • Maple
    Riecaman := proc(a,s,M)
    # Start with s, add or subtract a[n], get M terms. If a has w terms, can get M=w+1 terms.
    local b,M2,n,t;
    if whattype(a) <> list then ERROR("First argument should be a list"); fi;
    if a[1]=0 then ERROR("a[1] should not be zero"); fi;
    M2 := min(nops(a),M-1);
    b:=[s]; t:=s;
    for n from 1 to M2 do
       if a[n]>t then t:=t+a[n] else t:=t-a[n]; fi; b:=[op(b),t]; od:
    b; end;
    blocks := proc(a,S) local b,c,d,M,L,n;
    # 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.
    b:=[]; c:=[]; d:=[]; L:=1;
    # if a[1] a low point?
       n:=1;
       if( (a[n+1]>a[n]) and (a[n+2]>a[n+1]) ) then
       b:=[op(b),n+S-1]; c:=[op(c),a[n]]; d:=[op(d), n-L]; L:=n; fi;
    for n from 2 to nops(a)-2 do
    # if a[n] a low point?
       if( (a[n-1]>a[n]) and (a[n+1]>a[n]) and (a[n+2]>a[n+1]) ) then
       b:=[op(b),n+S-1]; c:=[op(c),a[n]]; d:=[op(d), n-L]; L:=n; fi; od;
    [b,c,d]; end;
    p0:=[seq(ithprime(n),n=1..100001)]:
    q1:=Riecaman(p0,1,100000):
    blocks(q1,0); # produces [the present sequence, A324788, A324789]
  • PARI
    See Links section.

Extensions

Modified definition to make offset 0. - N. J. A. Sloane, Oct 02 2019
a(12)-a(22) from Rémy Sigrist, Oct 18 2020

A324791 Value of A076042 at its n-th low point.

Original entry on oeis.org

0, 5, 7, 4, 19, 104, 74, 193, 515, 725, 241, 1948, 2948, 709, 8746, 16451, 48443, 47915, 61369, 41566, 136585, 710582, 476516, 1363747, 3165833, 5491067, 11906702, 15854273, 6895924, 38766838, 63676139, 3935833, 209116033, 219826349, 265573243, 263220940
Offset: 0

Views

Author

N. J. A. Sloane, Sep 04 2019

Keywords

Crossrefs

If we use primes instead of squares we get A008348, A309226, A324782, A324783.

Programs

  • Maple
    # Maple program from N. J. A. Sloane, Oct 03 2019; guessb = A325056, guessc = A324791 (this sequence).
    Digits := 64;
    f := proc(k,M) local j1, twoL, RL, kprime, Mprime;
    j1 := 3*k^2+7*k+17/4+2*M;
    if issqr(j1) then lprint("Beware, perfect square: k,M,j1 are ",k,M,j1); fi;
    twoL := -k-3/2+evalf(sqrt(j1)) ;
    RL := floor(twoL/2);
    Mprime := M+(k+1)^2 - (2*k*RL+3*RL+2*RL^2);
    kprime := 1+k+2*RL;
    [twol, RL, Mprime, kprime];
    end;
    guessb:=[0,5]; b:=5; guessc:=[0,5]; c:=5;
    for i from 1 to 100 do
    t1:=f(b,c);
    b:=t1[4]; c:=t1[3]; guessb:=[op(guessb),b]; guessc:=[op(guessc),c];
    od:
    guessb; guessc;
  • Mathematica
    a=b=c=d=n=0; L={0}; While[Length[L] < 22, n++; a=b; b=c; c=d; d=c + If[c < n^2, n^2, -n^2]; If[a > b < c < d, AppendTo[L, b]]]; L (* Giovanni Resta, Oct 01 2019 *)
  • PARI
    \\ See Tomas Rokicki's PARI program in A076042.

Extensions

More terms from Giovanni Resta, Oct 01 2019

A324792 First differences of A325056: distance in A076042 from n-th low point to the next.

Original entry on oeis.org

5, 5, 9, 15, 25, 45, 77, 133, 231, 401, 693, 1201, 2081, 3603, 6241, 10809, 18723, 32429, 56169, 97287, 168505, 291861, 505517, 875581, 1516551, 2626743, 4549653, 7880231, 13648959, 23640691, 40946879, 70922073, 122840635, 212766221, 368521905, 638298663
Offset: 0

Views

Author

N. J. A. Sloane, Sep 04 2019

Keywords

Crossrefs

If we use primes instead of squares we get A008348, A309226, A324782, A324783.

Programs

  • Mathematica
    a=b=c=d=n=0; L={0}; While[Length[L] < 22, n++; a=b; b=c; c=d; d=c + If[c < n^2, n^2, -n^2]; If[a > b < c < d, AppendTo[L, n-2]]]; Differences@ L (* Giovanni Resta, Oct 01 2019 *)

Extensions

More terms from Giovanni Resta, Oct 01 2019

A325056 Index of n-th low point in A076042.

Original entry on oeis.org

0, 5, 10, 19, 34, 59, 104, 181, 314, 545, 946, 1639, 2840, 4921, 8524, 14765, 25574, 44297, 76726, 132895, 230182, 398687, 690548, 1196065, 2071646, 3588197, 6214940, 10764593, 18644824, 32293783, 55934474, 96881353, 167803426, 290644061, 503410282, 871932187
Offset: 0

Views

Author

N. J. A. Sloane, Sep 04 2019

Keywords

Crossrefs

If we use primes instead of squares we get A008348, A309226, A324782, A324783.

Programs

  • Maple
    See A324791.
  • Mathematica
    a=b=c=d=n=0; L={0}; While[Length[L] < 22, n++; a=b; b=c; c=d; d=c + If[c < n^2, n^2, -n^2]; If[a > b < c < d, AppendTo[L, n - 2]]]; L (* Giovanni Resta, Oct 01 2019 *)
  • PARI
    \\ See PARI program in A076042.

Extensions

a(14)-a(17) added by N. J. A. Sloane, Sep 30 2019
More terms from Giovanni Resta, Oct 01 2019
Modified definition to make offset 0. - N. J. A. Sloane, Oct 02 2019
Showing 1-5 of 5 results.