OFFSET
0,2
LINKS
Michel Marcus, Table of n, a(n) for n = 0..500
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
KEYWORD
nonn,base
AUTHOR
Michel Marcus, Sep 23 2022
STATUS
approved