cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A330348 a(n) is the number of divisors of n whose last digit equals the last digit of n.

This page as a plain text file.
%I A330348 #139 Apr 24 2024 13:07:04
%S A330348 1,1,1,1,1,1,1,1,1,1,2,2,1,1,2,1,1,1,1,2,2,2,1,2,2,1,1,1,1,2,2,2,2,1,
%T A330348 2,2,1,1,1,3,2,2,1,2,3,1,1,2,1,2,2,2,1,1,2,1,1,1,1,4,2,2,2,2,2,2,1,1,
%U A330348 1,2,2,3,1,1,4,1,2,1,1,4,2,2,1,3,2,1,1,2,1
%N A330348 a(n) is the number of divisors of n whose last digit equals the last digit of n.
%C A330348 Inspired by Project Euler, Problem 474 (see link).
%C A330348 a(n) >= 1.
%C A330348 When n > 10 ends with 0, 1, 2 or 5, then a(n) >= 2.
%C A330348 The first 19 terms are the same as A038769, but a(20) = 2 and A038769(20) = 1.
%C A330348 From _Robert Israel_, Jun 04 2020: (Start)
%C A330348 a(10*n) = A000005(n).
%C A330348 If n is odd, then a(2*n) = a(n) and a(5*n) = A000005(n). (End)
%C A330348 Integers all of whose divisors end with the same last digit (which is necessarily 1) are in A004615. - _Bernard Schott_, May 07 2021
%H A330348 Robert Israel, <a href="/A330348/b330348.txt">Table of n, a(n) for n = 1..10000</a>
%H A330348 Project Euler, <a href="https://projecteuler.net/problem=474">Problem 474: Last digits of divisors</a>
%e A330348 The divisors of 12 that end in 2 are 2 and 12, so a(12) = 2.
%p A330348 f:= proc(n) local t;
%p A330348 t:= n mod 10;
%p A330348 nops(select(k -> k mod 10 = t, numtheory:-divisors(n)))
%p A330348 end proc:
%p A330348 map(f, [$1..100]); # _Robert Israel_, Jun 04 2020
%t A330348 a[n_] := DivisorSum[n, 1 &, Mod[# - n, 10] == 0 &]; Array[a, 100] (* _Amiram Eldar_, Jun 04 2020 *)
%o A330348 (PARI) a(n) = my(u=n%10); sumdiv(n, d, d%10 == u); \\ _Michel Marcus_, Jun 04 2020
%o A330348 (Python)
%o A330348 from sympy import divisors
%o A330348 def a(n): return sum((n-d)%10 == 0 for d in divisors(n, generator=True))
%o A330348 print([a(n) for n in range(1, 90)]) # _Michael S. Branicky_, Aug 15 2022
%Y A330348 Cf. A000005 (number of divisors), A004615, A010879 (last digit of n), A038769.
%K A330348 nonn,base
%O A330348 1,11
%A A330348 _Bernard Schott_, Jun 04 2020