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

A076042 a(0) = 0; thereafter a(n) = a(n-1) + n^2 if a(n-1) < n^2, otherwise a(n) = a(n-1) - n^2.

Original entry on oeis.org

0, 1, 5, 14, 30, 5, 41, 90, 26, 107, 7, 128, 272, 103, 299, 74, 330, 41, 365, 4, 404, 845, 361, 890, 314, 939, 263, 992, 208, 1049, 149, 1110, 86, 1175, 19, 1244, 2540, 1171, 2615, 1094, 2694, 1013, 2777, 928, 2864, 839, 2955, 746, 3050, 649, 3149
Offset: 0

Views

Author

Amarnath Murthy, Oct 29 2002

Keywords

Comments

Does not return to zero within first 2^25000 =~ 10^7525 terms. Define an epoch as an addition followed by a sequence of (addition, subtraction) pairs. The first epoch has length 1 (+), the second 3 (++-), the third 5 (++-+-), and so forth (cf. A324792). The epoch lengths increase geometrically by about the square root of 3, and the value at the end of each epoch is the low value in the epoch. These observations lead to the Python program given. - Tomas Rokicki, Aug 31 2019
Using the Maple program in A324791, I confirmed that a(n) != 0 for 0 < n < 10^2394. See the a- and b-files in A325056 and A324791. - N. J. A. Sloane, Oct 03 2019
'Easy Recamán transform' of the squares. - Daniel Forgues, Oct 25 2019

Crossrefs

See also A325056, A324791, A324792.
Cf. A053461 ('Recamán transform' of the squares).

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<0, 0,
          ((s, t)-> s+`if`(sAlois P. Heinz, Jan 11 2020
  • Mathematica
    a[0] = 0;
    a[n_] := a[n] = a[n-1] + If[a[n-1] < n^2, n^2, -n^2];
    a /@ Range[0, 50] (* Jean-François Alcover, Apr 11 2020 *)
  • PARI
    v=vector(50); v[1]=1; for(n=2,50,if(v[n-1]
    				

Extensions

More terms from Ralf Stephan, Mar 20 2003
a(0)=0 prepended, at the suggestion of Allan C. Wechsler, by N. J. A. Sloane, Aug 31 2019
Offset set to 0, to cohere with previous action of N. J. A. Sloane, by Allan C. Wechsler, Sep 08 2019

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

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