A347749 Number of positive integers with n digits and final digit 6 that are equal to the product of two integers ending with the same digit.
0, 4, 33, 352, 3597, 36781, 374071, 3790993, 38326689, 386782889
Offset: 1
Programs
-
Mathematica
Table[{lo, hi}={10^(n-1), 10^n}; Length@Select[Union[Union@Flatten@Table[a*b, {a, 4, Floor[hi/4], 10}, {b, a, Floor[hi/a], 10}],Union@Flatten@Table[a*b, {a, 6, Floor[hi/6], 10}, {b, a, Floor[hi/a], 10}]], lo<#
-
Python
def a(n): lo, hi = 10**(n-1), 10**n return len(set(a*b for a in range(4, hi//4+1, 10) for b in range(a, hi//a+1, 10) if lo <= a*b < hi) | set(a*b for a in range(6, hi//6+1, 10) for b in range(a, hi//a+1, 10) if lo <= a*b < hi)) print([a(n) for n in range(1, 9)]) # Michael S. Branicky, Oct 06 2021
Formula
Extensions
a(9)-a(10) from Michael S. Branicky, Oct 06 2021
Comments