A335491 a(n) is the smallest number m with exactly n divisors whose last digit equals the last digit of m.
1, 11, 40, 60, 160, 120, 640, 240, 360, 480, 8064, 600, 18144, 1920, 1440, 1200, 72576, 1800, 52416, 2400, 5760, 30720, 183456, 3600, 12960, 122880, 9000, 9600, 602784, 7200, 445536, 8400, 92160, 798336, 51840, 12600, 2159136, 576576, 368640, 16800, 2935296, 28800
Offset: 1
Examples
Of the twelve divisors of 60, four have their last digit equals to the last digit of 60: 10, 20, 30 and 60, and there is no smaller number k with four divisors whose last digit equals the last digit of k, hence a(4) = 60.
Links
- Project Euler, Problem 474: Last digits of divisors
Crossrefs
Programs
-
Magma
a:=[]; for n in [1..30] do k:=1; while #[d:d in Divisors(k)|k mod 10 eq d mod 10] ne n do k:=k+1; end while; Append(~a,k); end for; a; // Marius A. Burtea, Jun 12 2020
-
Mathematica
d[n_] := DivisorSum[n, 1 &, Mod[# - n, 10] == 0 &]; mx = 20; c = 0; n = 1; s = Table[0, {mx}]; While[c < mx, i = d[n]; If[i <= mx && s[[i]] == 0, c++; s[[i]] = n]; n++]; s (* Amiram Eldar, Jun 12 2020 *)
-
PARI
f(n) = my(u=n%10); sumdiv(n, d, (d%10) == u); a(n) = my(k=1); while(f(k) != n, k++); k; \\ Michel Marcus, Jun 12 2020
Extensions
Corrected and extended by Marius A. Burtea, Jun 12 2020
Comments