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.

A367502 Sum of the final digits of the prime power divisors (p^k, k>=0) of n.

Original entry on oeis.org

1, 3, 4, 7, 6, 6, 8, 15, 13, 8, 2, 10, 4, 10, 9, 21, 8, 15, 10, 12, 11, 4, 4, 18, 11, 6, 20, 14, 10, 11, 2, 23, 5, 10, 13, 19, 8, 12, 7, 20, 2, 13, 4, 8, 18, 6, 8, 24, 17, 13, 11, 10, 4, 22, 7, 22, 13, 12, 10, 15, 2, 4, 20, 27, 9, 7, 8, 14, 7, 15, 2, 27, 4, 10, 14, 16, 9, 9, 10, 26, 21, 4, 4
Offset: 1

Views

Author

Wesley Ivan Hurt, Nov 20 2023

Keywords

Examples

			a(16) = 21 since the prime power divisors of 16 are {1, 2, 4, 8, 16} and the sum of their final digits is 1 + 2 + 4 + 8 + 6 = 21.
		

Crossrefs

Cf. A000961 (Powers of primes), A001221 (omega), A010879 (Final digit of n), A023888 (Sum of the prime power divisors of n including 1), A371885 (first k with a(k) = n).

Programs

  • Maple
    f:= proc(n) local F,i,j,t;
      F:= ifactors(n)[2];
      1 + add(add(F[i,1]^j mod 10, j = 1 .. F[i,2]),i=1..nops(F))
    end proc:
    map(f, [$1..100]); # Robert Israel, Apr 10 2024
  • Mathematica
    Table[1 + Sum[Floor[1/PrimeNu[k]] Mod[k, 10] (1 - Ceiling[n/k] + Floor[n/k]), {k, 2, n}], {n, 100}]
  • PARI
    a(n) = my(f=factor(n)); 1 + sum(k=1, #f~, sum(j=1, f[k,2], lift(Mod(f[k,1], 10)^j))); \\ Michel Marcus, Nov 22 2023

Formula

a(n) = 1 + Sum_{d|n, d>1} floor(1/omega(d)) * (d mod 10).