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.

A346392 a(n) is the number of proper divisors of n ending with the same digit as n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 2, 1, 1, 0, 1, 2, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 3, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 2, 0, 0, 3, 0, 1, 0, 0, 3, 1, 1, 0, 2, 1, 0, 0, 1, 0, 2
Offset: 1

Views

Author

Stefano Spezia, Jul 15 2021

Keywords

Examples

			a(40) = 2 since there are 2 proper divisors of 40 ending with 0: 10 and 20.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Length[Drop[Select[Divisors[n], (Mod[#,10]==Mod[n,10]&)], -1]]; Array[a, 90]
  • PARI
    a(n) = my(x = n%10); sumdiv(n, d, if (dMichel Marcus, Jul 19 2021
    
  • Python
    from sympy import divisors
    def a(n): return sum(d%10 == n%10 for d in divisors(n)[:-1])
    print([a(n) for n in range(1, 91)]) # Michael S. Branicky, Jul 31 2021

Formula

For a prime p, a(p) = 1 if p has the final digit equal to 1, otherwise a(p) = 0.
a(n) = A330348(n) - 1. - Michel Marcus, Jul 19 2021