|
EXAMPLE
|
2^66 = {2, 0, 0, 0, 1, 2, 1, 2, 1, 0, 2, 1, 1, 2, 1, 0, 2, 1, 1, 2, 1, 0, 2, 1, 2, 2, 2, 1, 0, 0, 0, 2, 0, 0, 2, 0, 1, 0, 1, 2, 0, 1}
Count of 1 = count of 2 = count of 0 = 14, so 66 is member
Occurrences of digits 0,1,2 in 2^n:
{n, {#0,#1,#2}}
{66,{14,14,14}}
{227,{48,48,48}}
{903,{190,190,190}}
{17574,{3696,3696,3696}}
{40102,{8434,8434,8434}}
|
|
MATHEMATICA
|
Do[If[DigitCount[2^n, 3, 0]==DigitCount[2^n, 3, 1]==DigitCount[2^n, 3, 2], Print[n]], {n, 1, 60000}]
Select[Range[41000], Length[Union[DigitCount[2^#, 3, {0, 1, 2}]]]==1&] (* The program generates the first 5 terms of the sequence. To generate more, increase the Range constant, but the program may take a long time to run. *) (* Harvey P. Dale, Aug 05 2021 *)
|