OFFSET
1,2
COMMENTS
The sequence lists the positive binomial coefficient predictors in base 5. For definition, see paper in link.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
V. Shevelev, Binomial Coefficient Predictors, Journal of Integer Sequences, Vol. 14 (2011), Article 11.2.8.
MAPLE
a:= proc(n) option remember; local i, l, m, t;
m:= `if`(n=1, 0, a(n-1));
l:=NULL;
for t while m>0 do l:=l, irem(m, 5, 'm') od;
l:= array([l, 0]);
for i while l[i]=4 do od;
if l[i]<3 then l[i]:= l[i]+1
else l[i]:= 4;
if i>1 then l[i-1]:= 3 fi
fi;
add(l[i] *5^(i-1), i=1..t)
end:
seq(a(n), n=1..100); # Alois P. Heinz, Apr 03 2011
MATHEMATICA
aQ[n_] := Module[{d=IntegerDigits[n, 5]}, s=Select[d, #!=4 &]; s=={} || s =={3} || (d[[1]]<3 && s=={d[[1]]})]; Select[Range[100000], aQ] (* Amiram Eldar, Dec 14 2018 *)
PROG
(PARI) listb(nd) = {for (i = 1, nd, my(v = vector(nd, k, 4), kstart = if (i==1, 1, 3)); for (k=kstart, 3, v[i] = k; print1(fromdigits(v, 5), ", "); ); ); print1(fromdigits(vector(nd, k, 4), 5), ", "); }
lista(nnd) = {for (nd=1, nnd, listb(nd); ); } \\ Michel Marcus, Dec 14 2018
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Vladimir Shevelev, Apr 03 2011
STATUS
approved