%I #45 Jun 11 2019 22:33:10
%S 2,1,0,3,6,3,0,5,12,11,0,5,12,0,0,5,0,0,0,48,14,0,61,188,83,0,81,232,
%T 268,0,0,650,0,0,622,299,0,0,0,501,0,0,2655,602,0,6429,8990,7856,0,
%U 26187,17898,3744,0,40300,16395,0,0,0,0,0,0,124876,173552,0,0
%N a(n) is the number of base-4 n-digit numbers requiring only binary digits in bases 3 and 4.
%C 0 is included to mesh with the earlier A146025 ({0, 1, 82000}: the values in decimal with top base 4 here replaced by 5, conjectured complete). It appears unlikely, empirically, that this sequence has a last positive term, and a heuristic approximation of terms is likely not difficult.
%C The numbers here are the counts of members of A000695 also occurring in A005836 and being n digits in length in base-4.
%H Stuart A. Burrell, Han Yu, <a href="https://arxiv.org/abs/1905.00832">Digit expansions of numbers in different bases</a>, arXiv:1905.00832 [math.NT], 2019.
%e The first 8 values are 0, 1, 4, 81, 84, 85, 256 and 273--0, 1, 11, 10000, 10010, 10011, 10000111 and 10001010 in base 3, and 0, 1, 10, 1101, 1110, 1111, 10000 and 10101 in base 4; and, from the base-4 listing, a(1)=2, a(2)=1, a(3)=0, a(4)=3, and a(5) is at least 2.
%t MapAt[# + 1 &, Array[Count[FromDigits[#, 4] & /@ IntegerDigits[Range[2^(# - 1), 2^# - 1], 2], _?(DigitCount[#, 3][[2]] == 0 &)] &, 20], 1] (* _Michael De Vlieger_, Jun 11 2019 *)
%o (PARI)
%o {
%o \\ This program finds the number of d-digit base B>b\\
%o \\ numbers not requiring digits beyond those of base b\\
%o \\ for bases b+1 through B. It runs a check in reverse\\
%o \\ down to base b+1, maintaining additions not yet done\\
%o \\ in vector S, where the digits in each base are kept\\
%o \\ in matrix N. The value itself is kept as n, at each\\
%o \\ new base checked for n, the value in S is transfered\\
%o \\ to variable t; with the check being done of whether\\
%o \\ the criterion is satisfied for n in the base under\\
%o \\ consideration. A flag f is used to see if n passed\\
%o \\ for all bases or there was a break. If pass, then\\
%o \\ count variable c is incremented (as is n) for the\\
%o \\ next run through bases. At each addition, a check\\
%o \\ of whether the base is B and the number of digits\\
%o \\ changes is done, and if so a new term is output.\\
%o \\ pos and POS are variables for the digit-positions\\
%o \\ under consideration in additions essentially mimic-\\
%o \\ king hand addition. Flag g identifies whether or\\
%o \\ not a large addition is warranted by virtue of an\\
%o \\ addition resulting in a digit larger than b-1, the\\
%o \\ leftmost of these being the point from which this\\
%o \\ addition is made using variable s calculated four\\
%o \\ lines above the bottom one of the program. This \\
%o \\ program is readily modified to store a smaller #\\
%o \\ of digits (D), change the b and B values, and print\\
%o \\ specific n values as desired.\\
%o b=2;B=4;d=1;c=1;D=10000;
%o N=matrix(B-b,D);n=1;S=vector(B-b,x,1);
%o while(1,
%o f=1;forstep(i=B,b+1,-1,
%o t=S[i-b];if(t,
%o S[i-b]=0;pos=0;ca=0;
%o while(t,
%o pos++;N[i-b,pos]+=t%i+ca;
%o if(N[i-b,pos]>=i,ca=1;N[i-b,pos]-=i,ca=0);
%o t\=i);
%o if(ca,pos++;N[i-b,pos]++;if(i==B,if(pos==d+1,
%o print1(c",");d++;c=0)));
%o POS=pos;g=1;
%o while(POS,
%o if(N[i-b,POS]>=b,g=0;break(),POS--));
%o if(g==0,
%o f=0;POS++;while(N[i-b,POS]==b-1,POS++);
%o N[i-b,POS]++;for(j=1,POS-1,N[i-b,j]=0);
%o s=i^(POS-1)-n%(i^(POS-1));
%o for(j=1,B-b,if(j!=i-b,S[j]+=s));
%o if(i==B,if(POS==d+1,print1(c",");d++;c=0));
%o n+=s;break())));
%o if(f,c++;n++;S=vector(B-b,x,1)))
%o }
%Y Cf. A146025, A005836, A000695
%K nonn,base,uned
%O 1,1
%A _James G. Merickel_, Oct 16 2013
|