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

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

A324788 Value of A022837 at its n-th low point.

Original entry on oeis.org

0, 1, 0, 7, 2, 3, 0, 1, 0, 7, 0, 29
Offset: 0

Views

Author

N. J. A. Sloane, Sep 04 2019

Keywords

Crossrefs

Cf. A022837. See A324787 for further information.

Extensions

Modified definition to make offset 0. - N. J. A. Sloane, Oct 02 2019

A324789 First differences of A324787: distances in A022837 from n-th low point to the next.

Original entry on oeis.org

3, 7, 17, 49, 121, 309, 847, 2237, 5997, 16163, 44827
Offset: 0

Views

Author

N. J. A. Sloane, Sep 04 2019

Keywords

Crossrefs

Cf. A022837. See A324787 for further information.

Extensions

Modified definition to make offset 0. - N. J. A. Sloane, Oct 02 2019

A324790 Indices of zeros in A022837.

Original entry on oeis.org

2, 12, 508, 3592, 25752, 1507602
Offset: 1

Views

Author

N. J. A. Sloane, Sep 04 2019

Keywords

Comments

For k > 0, A022837(2*k-1) is odd and A022837(2*k) is even. So a(n) is even. - Seiichi Manyama, Sep 06 2019
If it exists, a(7) > 10^10. - Michael S. Branicky, Sep 02 2024

Crossrefs

Cf. A022837, A309225. See A324787 for further information.

Extensions

a(5)-a(6) from Seiichi Manyama, Sep 05 2019

A008348 a(0)=0; thereafter a(n) = a(n-1) + prime(n) if a(n-1) < prime(n), otherwise a(n) = a(n-1) - prime(n).

Original entry on oeis.org

0, 2, 5, 0, 7, 18, 5, 22, 3, 26, 55, 24, 61, 20, 63, 16, 69, 10, 71, 4, 75, 2, 81, 164, 75, 172, 71, 174, 67, 176, 63, 190, 59, 196, 57, 206, 55, 212, 49, 216, 43, 222, 41, 232, 39, 236, 37, 248, 25, 252, 23, 256, 17, 258, 7, 264, 1, 270, 541, 264, 545, 262, 555
Offset: 0

Views

Author

Keywords

Comments

a(n) < 2*prime(n). Conjecture: a(n) > 0 for n > 3. - Thomas Ordowski, Dec 03 2016 [This conjecture is false, because a(369019)=0. The next counterexample occurs at n = 22877145. - Dmitry Kamenetsky, Feb 14 2017. (Cf. A309225.)]

Crossrefs

Programs

  • Maple
    A008348 := proc(n) option remember; if n = 0 then 0 elif A008348(n-1)>=ithprime(n) then A008348(n-1)-ithprime(n); else A008348(n-1)+ithprime(n); fi; end;
    # Maple from N. J. A. Sloane, Aug 31 2019 (Start)
    # Riecaman transform
    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;
    # Riecaman transform of primes, starting at s=0
    p1:=[seq(ithprime(i),i=1..100)];
    q0:=Riecaman(p1,0,99);
    # End
  • Mathematica
    a := {0}; For[n = 2, n < 100, n++, If[a[[n - 1]] >= Prime[n - 1], b := a[[n - 1]] - Prime[n - 1], b := a[[n - 1]] + Prime[n - 1];]; a = Append[a, b]]; a (* Stefan Steinerberger, May 02 2006 *)
    nxt[{n_,a_}]:={n+1,If[aHarvey P. Dale, Sep 13 2024 *)
  • PARI
    lista(nn) = {print1(a=0, ", "); for (n=1, nn, if (a < (p=prime(n)), a += p, a -= p); print1(a, ", "););} \\ Michel Marcus, Dec 04 2016

Formula

a(n) = c(1)p(1) + ... + c(n)p(n), where c(i) = 1 if a(i-1) > p(i) and c(i) = -1 if a(i-1) <= p(i) (p(i) = primes). - Clark Kimberling

Extensions

More terms from Clark Kimberling
Name edited by Dmitry Kamenetsky, Feb 14 2017

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

A309222 a(0) = 6; thereafter a(n) = a(n-1) + prime(n) if prime(n) > a(n-1), otherwise a(n) = a(n-1) - prime(n).

Original entry on oeis.org

6, 4, 1, 6, 13, 2, 15, 32, 13, 36, 7, 38, 1, 42, 85, 38, 91, 32, 93, 26, 97, 24, 103, 20, 109, 12, 113, 10, 117, 8, 121, 248, 117, 254, 115, 264, 113, 270, 107, 274, 101, 280, 99, 290, 97, 294, 95, 306, 83, 310, 81, 314, 75, 316, 65, 322, 59, 328, 57, 334, 53, 336, 43, 350, 39, 352
Offset: 0

Views

Author

N. J. A. Sloane, Aug 29 2019

Keywords

Comments

Hugo van der Sanden asks if this ever reaches 0. He finds that a(n) > 0 for n < 5*10^10. Probabilistic arguments suggest it will never reach 0.

References

  • Hugo van der Sanden, Posting to Sequence Fans Mailing List, Aug 28 2019

Crossrefs

If we start with 0 or 1 instead of 6 we get A008348, A022837.
Similar in spirit to A008344, and has a similar graph.

A022833 a(0)=2; thereafter a(n) = a(n-1) + prime(n) if a(n-1) < prime(n), otherwise a(n) = a(n-1) - prime(n). Cf. A008348.

Original entry on oeis.org

2, 0, 3, 8, 1, 12, 25, 8, 27, 4, 33, 2, 39, 80, 37, 84, 31, 90, 29, 96, 25, 98, 19, 102, 13, 110, 9, 112, 5, 114, 1, 128, 259, 122, 261, 112, 263, 106, 269, 102, 275, 96, 277, 86, 279, 82, 281, 70, 293, 66, 295, 62, 301, 60, 311, 54, 317, 48, 319, 42, 323, 40
Offset: 0

Views

Author

Keywords

Comments

Old definition was "a(n) = c(1)p(2) + ... + c(n)p(n+1), where c(i) = 1 if a(i-1) <= p(i+1) and c(i) = -1 if a(i-1) > p(i+1) (p(i) = primes)."

Crossrefs

Extensions

Name corrected by Sean A. Irvine, May 22 2019
Definition and start of sequence rewritten by N. J. A. Sloane, Sep 04 2019

A022835 a(n) = c(1)p(3) + ... + c(n)p(n+2), where c(i) = 1 if a(i-1) < p(i+2) and c(i) = -1 if a(i-1) >= p(i+2) (p(i) = primes).

Original entry on oeis.org

5, 12, 1, 14, 31, 12, 35, 6, 37, 0, 41, 84, 37, 90, 31, 92, 25, 96, 23, 102, 19, 108, 11, 112, 9, 116, 7, 120, 247, 116, 253, 114, 263, 112, 269, 106, 273, 100, 279, 98, 289, 96, 293, 94, 305, 82, 309, 80, 313, 74, 315, 64, 321, 58, 327, 56, 333, 52, 335, 42
Offset: 0

Views

Author

Keywords

Crossrefs

Essentially identical to A022837. See that entry for more details. - N. J. A. Sloane, Aug 31 2019

Extensions

Name corrected by Sean A. Irvine, May 22 2019
Showing 1-9 of 9 results.