%I #28 Sep 24 2022 08:16:19
%S 1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,1,2,1,2,1,2,1,2,1,2,1,1,2,1,
%T 1,2,1,1,2,2,1,1,1,2,1,1,1,2,1,2,1,1,1,1,2,1,1,1,1,2,1,1,1,1,1,2,1,1,
%U 1,2,1,1,1,1,1,1,2,1,1,2,1,1,1,1,1,1,1,2,1,2,1,1,1,1,1,1,1,1,2,3
%N a(n) is the number of divisors of n whose first digit equals the first digit of n.
%C Similar to A330348, but with last digit.
%C a(n) >= 1 because there is always a divisor that fits: n.
%C a(n) >= 2 for n>1 in A131835.
%H Michel Marcus, <a href="/A357299/b357299.txt">Table of n, a(n) for n = 1..10000</a>
%e The divisors of 26 that start in 2 are 2 and 26, so a(26) = 2.
%t f[n_] := IntegerDigits[n][[1]]; a[n_] := DivisorSum[n, 1 &, f[#] == f[n] &]; Array[a, 100] (* _Amiram Eldar_, Sep 23 2022 *)
%o (PARI) a(n) = my(fd=digits(n)[1]); sumdiv(n, d, digits(d)[1] == fd); \\ _Michel Marcus_, Sep 23 2022
%o (Python)
%o from sympy import divisors
%o def a(n): f = str(n)[0]; return sum(1 for d in divisors(n) if str(d)[0]==f)
%o print([a(n) for n in range(1, 101)]) # _Michael S. Branicky_, Sep 23 2022
%Y Cf. A000030, A131835, A330348, A356549, A357300.
%K nonn,base
%O 1,10
%A _Bernard Schott_, Sep 23 2022