OFFSET
1,1
COMMENTS
Known formulas for first differences of Stanley sequences are sums with one term always being A236313(n), so it makes sense in order to find a formula for the first differences of the Stanley sequence S[0,4] to subtract A236313(n) from that and look if something shows.
a(n) is negative for n = 2,4,8,12,16,24,32,40,48,56,64,66,72... and it appears that n is always even if a(n) is negative. It also seems that a(n) is always negative if n is a power of two, with a(2^m) = -1,-1,-11,-24,-105,-347,-1073,-3260,-9839,-29467,-85479,-265530...
LINKS
Ralf Stephan, Table of n, a(n) for n = 1..4599
PROG
(PARI)
NAP(sv, N)=local(v, vv, m, k, l, sl, vvl); sl=length(sv); vvl=min(N*N, 10^6); 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
v=NAP([0, 4], 5000)
a(n)=v[n+1]-v[n]-(3^valuation(n, 2)+1)/2
CROSSREFS
KEYWORD
sign
AUTHOR
Ralf Stephan, Jan 31 2014
STATUS
approved