login
A356549
a(n) is the number of divisors of 10^n whose first digit is 1.
2
1, 2, 3, 5, 8, 11, 15, 20, 25, 31, 38, 45, 52, 60, 69, 78, 88, 99, 110, 122, 135, 148, 161, 175, 190, 205, 221, 238, 255, 273, 292, 311, 330, 350, 371, 392, 414, 437, 460, 484, 509, 534, 559, 585, 612, 639, 667, 696, 725, 755, 786, 817, 848, 880, 913, 946, 980, 1015, 1050, 1086
OFFSET
0,2
LINKS
FORMULA
a(n) = A357299(A011557(n)).
EXAMPLE
The divisors of 1000 with initial digit 1 are: 1, 10, 100, 125 and 1000, so a(3)=5.
MAPLE
a:= n-> add(`if`((""||d)[1]="1", 1, 0), d=numtheory[divisors](10^n)):
seq(a(n), n=0..60); # Alois P. Heinz, Sep 23 2022
MATHEMATICA
a[n_] := DivisorSum[10^n, 1 &, IntegerDigits[#][[1]] == 1 &]; Array[a, 60, 0] (* Amiram Eldar, Sep 23 2022 *)
PROG
(PARI) a(n) = sumdiv(10^n, d, digits(d)[1] == 1);
(Python)
from sympy import divisors
def a(n): return sum(1 for d in divisors(10**n, generator=True) if str(d)[0]=="1")
print([a(n) for n in range(60)]) # Michael S. Branicky, Sep 23 2022
(Python)
def A356549(n): return n+1+sum(n-m+1 for m in range(1, n+2) for d in (2, 5) if str(d**m).startswith('1')) # Chai Wah Wu, Sep 23 2022
CROSSREFS
Sequence in context: A062485 A175143 A137179 * A096777 A125811 A281706
KEYWORD
nonn,base
AUTHOR
Michel Marcus, Sep 23 2022
STATUS
approved