OFFSET
1,1
COMMENTS
Also first differences of Stanley sequence S(1,5) (A033158).
While there are conjectures about formulas for S(0,m), m=1,2,3,6,9... (see A093682), m=4 is the first case where the first differences look almost random.
Records are 4, 7, 17, 18, 26, 48, 50, 55, 76, 87, 92, 93, 165, 175,...
Positions of records are 1, 7, 16, 23, 28, 49, 61, 81, 83, 101, 147, 165, 185, 250, 400,...
Positions where a(n)=1: 2, 5, 12, 33, 35, 66, 72, 94, 125, 160, 189, 288, 307, 327,...
LINKS
Ralf Stephan, Table of n, a(n) for n = 1..4650
PROG
(PARI) NAP(sv, N)=local(v, vv, m, k, l, sl, vvl); sl=length(sv); vvl=min(N*N, 10^5); v=vector(N); vv=vector(vvl); for(k=1, sl, v[k]=sv[k]; for(l=1, k-1, vv[2*v[k]-v[l]]=1)); m=v[sl]+1; for(k=sl+1, N, while(m<=vvl&&vv[m], m=m+1); if(m>vvl, return(v)); for(l=1, k-1, sl=2*m-v[l]; if(sl<=vvl, vv[sl]=1)); vv[m]=1; v[k]=m); v
S04(n)=N=1000; NAP([0, 4], N)[n]
a(n)=S04(n+1)-S04(n)
CROSSREFS
KEYWORD
nonn
AUTHOR
Ralf Stephan, Jan 21 2014
STATUS
approved