OFFSET
0,2
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 0..4000 (Terms through a(42) from Giovanni Resta)
N. J. A. Sloane, Table of n, a(n) for n = 0..10001
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 *)
PROG
(PARI) \\ See Tomas Rokicki's PARI program in A076042.
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Sep 04 2019
EXTENSIONS
More terms from Giovanni Resta, Oct 01 2019
STATUS
approved