OFFSET
0,8
FORMULA
a(n) >= A322849(n), for n >= 4.
EXAMPLE
n = 0, a(n) = 0, 2^n = 1 - no solutions;
n = 1, a(n) = 0, 2^n = 2 - no solutions;
n = 2, a(n) = 0, 2^n = 4 - no solutions;
n = 3, a(n) = 0, 2^n = 8 - no solutions;
n = 4, a(n) = 1, 2^n = 16 - solution is 1;
n = 5, a(n) = 1, 2^n = 32 - solution is 2;
n = 6, a(n) = 1, 2^n = 64 - solution is 4;
n = 7, a(n) = 3, 2^n = 128 - solutions are 1,2,8;
n = 14, a(n) = 4, 2^n = 16384 - solutions are 1,4,8,16;
n = 15, a(n) = 3, 2^n = 32768 - solutions are 2,8,32;
n = 16, a(n) = 0, 2^n = 65536 - no solutions.
MATHEMATICA
Array[If[# < 4, Total@ DigitCount[2^#, 10, 2^Range[0, Min[# - 1, 3]]], Total@ DigitCount[2^#, 10, {1, 2, 4, 8}]] &, 85, 0] (* Michael De Vlieger, Dec 31 2018 *)
PROG
(Python 3.7)
import re
results = []
start_n = 0
N = 100
compare_list = [] # Store powers up to n-1
current_num = int(pow(2, start_n-1)) # Calculate (n-1) power. Convert to integer for better precision
for n in range(start_n, N):
if n == 0:
current_num = 1
else:
current_num += current_num
current_string = str(current_num)
count = 0
for test_str in compare_list:
count += len(re.findall(test_str, current_string))
compare_list.append(current_string)
results.append(count)
a=1
print(results)
(PARI) isp2(n) = (n==1) || (n==2) || (ispower(n, , &k) && (k==2));
a(n) = {my(d=digits(2^n), nb = 0); for (i=1, #d-1, for (j=1, #d-i+1, my(nd = vector(i, k, d[j+k-1])); if (nd[1] != 0, nb += isp2(fromdigits(nd))); ); ); nb; } \\ Michel Marcus, Dec 30 2018
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Gaitz Soponski, Dec 28 2018
STATUS
approved