OFFSET
1,1
COMMENTS
The asymptotic density of this sequence is log_10(8/7) = 0.057991... - Amiram Eldar, Jan 27 2021
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
EXAMPLE
70368744177664 = 2^46.
MATHEMATICA
Select[Range[1000], Floor[2^# / 10^(Floor[# * Log10[2]])] == 7 &] (* Amiram Eldar, Dec 07 2019 *)
Select[Range[1000], IntegerDigits[2^#][[1]]==7&] (* or *) Select[Range[ 1000], NumberDigit[2^#, IntegerLength[2^#]-1]==7&] (* Harvey P. Dale, Aug 10 2021 *)
PROG
(C#)
public static void Main()
{
for(int a = 1; a <= 10000; a++)
{
BigInteger n1 = BigInteger.Pow(2, a);
string n2 = Convert.ToString(n1);
if(n2.StartsWith("7"))
{
Console.WriteLine(a);
}
}
}
(Python)
A330243_list = [n for n in range(10**3) if str(2**n)[0] == '7'] # Chai Wah Wu, Dec 12 2019
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Eder Vanzei, Dec 06 2019
STATUS
approved