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-10 of 16 results. Next

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

A324782 Value of A008348 at its n-th low point (A309226).

Original entry on oeis.org

0, 0, 3, 2, 1, 2, 3, 2, 7, 2, 17, 26, 1, 0, 27, 6, 17, 0, 7, 6, 47, 38, 53, 38, 25, 8, 19, 2, 37
Offset: 0

Views

Author

N. J. A. Sloane, Sep 01 2019

Keywords

Comments

a(n) = A008348(A309226).

Crossrefs

Cf. A008348.
See A309226 for more information.

Programs

Extensions

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

A324783 First differences of A309226: distances in A008348 from n-th low point to the next.

Original entry on oeis.org

3, 5, 13, 35, 89, 221, 579, 1561, 4127, 11143, 30745, 84585, 235913, 659385, 1851883, 5220661, 14776197, 41946423, 119451363, 341007809, 975932453, 2798620993, 8041115863, 23145844263, 66733786153, 192697084389, 557206314727, 1613334811187
Offset: 0

Views

Author

N. J. A. Sloane, Sep 01 2019

Keywords

Comments

Also (essentially) the first differences of A135025.
See A309226 for more information.

Crossrefs

Programs

Extensions

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

A309225 Indices m such that A008348(m)=0.

Original entry on oeis.org

0, 3, 369019, 22877145
Offset: 1

Views

Author

N. J. A. Sloane, Aug 31 2019

Keywords

Comments

These terms given here are based on the comments in A008348 from Dmitry Kamenetsky.
Probably infinite, on probabilistic grounds, but this is an open question. (Comment modified by N. J. A. Sloane, Oct 03 2019.)

Crossrefs

A022832 Duplicate of A008348.

Original entry on oeis.org

2, 5, 0, 7, 18, 5, 22, 3, 26, 55, 24, 61, 20, 63, 16, 69, 10, 71, 4, 75, 2, 81, 164, 75
Offset: 0

Views

Author

Keywords

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

A022837 a(n) = c(0)*p(0) + ... + 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(0) = 1, p(i) = prime(i)).

Original entry on oeis.org

1, 3, 0, 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
Offset: 0

Views

Author

Keywords

Comments

Alternative definition: a(0)=1; thereafter a(n) = a(n-1) + prime(n) if a(n-1) < prime(n), otherwise a(n) = a(n-1) - prime(n). Cf. A008348. - N. J. A. Sloane, Aug 31 2019

Examples

			From _Seiichi Manyama_, Sep 05 2019: (Start)
a(0) = 1.
a(1) = 1 + 2 = 3.
a(2) = 1 + 2 - 3 = 0.
a(3) = 1 + 2 - 3 + 5 = 5.
a(4) = 1 + 2 - 3 + 5 + 7 = 12.
a(5) = 1 + 2 - 3 + 5 + 7 - 11 = 1. (End)
		

Crossrefs

Extensions

Missing a(46)=94 inserted and name corrected by Sean A. Irvine, May 21 2019

A135025 Let b(1) = 2; and for n>= 2, if b(n-1) < prime(n) then b(n) = b(n-1) + prime(n) otherwise b(n) = b(n-1) - prime(n). The sequence gives the indices n where b(n-1) < b(n) < b(n+1).

Original entry on oeis.org

4, 9, 22, 57, 146, 367, 946, 2507, 6634, 17777, 48522, 133107, 369020, 1028405, 2880288, 8100949, 22877146, 64823569, 184274932, 525282741, 1501215194, 4299836187, 12340952050, 35486796313, 102220582466, 294917666855, 852123981582, 2465458792769
Offset: 1

Views

Author

Lior Deutsch (liorde(AT)gmail.com), Feb 10 2008

Keywords

Comments

The b sequence, prefixed by 0, is A008348. The low points in b are 1 less than the terms of the present sequence, and are given in A309226. - N. J. A. Sloane, Aug 31 2019

Examples

			b(1) = 2
b(2) = 5
b(3) = 0
b(4) = 7
b(5) = 18
b(3) < b(4) < b(5), so 4 is the first term of the sequence.
		

Crossrefs

Programs

  • Maple
    B := proc(n) option remember ; if n = 1 then 2; else if procname(n-1)-ithprime(n) < 0 then procname(n-1)+ithprime(n) ; else procname(n-1)-ithprime(n) ; fi; fi; end: A135025 := proc(n) option remember ; if n = 1 then 4; else for a from procname(n-1)+1 do if B(a-1) < B(a) and B(a) < B(a+1) then RETURN(a) ; fi; od: fi; end: for n from 1 do printf("%d,\n",A135025(n)) ; od: # R. J. Mathar, Feb 06 2009
  • Mathematica
    B[n_] := B[n] = If[n == 1, 2, If[B[n-1] - Prime[n] < 0, B[n-1] + Prime[n], B[n-1] - Prime[n]]];
    a[n_] := a[n] = If[n == 1, 4, For[k = a[n-1]+1, True, k++, If[B[k-1] < B[k] && B[k] < B[k+1], Return[k]]]];
    Table[Print[n, " ", a[n]]; a[n], {n, 1, 16}] (* Jean-François Alcover, Aug 16 2022, after R. J. Mathar *)

Extensions

New term added by Lior Deutsch (liorde(AT)gmail.com), Oct 17 2008
Definition corrected and entry revised by Robert Israel, Michel Marcus, and N. J. A. Sloane, Sep 29 2014
a(17)-a(28) from Giovanni Resta, 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
Showing 1-10 of 16 results. Next