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.

A339436 If n = p_1 * ... * p_m with primes p_i <= p_{i+1}, a(n) = Sum_{j=1..m-1} p_1*...*p_j + Sum_{j=2..m} p_j*...*p_m.

Original entry on oeis.org

0, 0, 4, 0, 5, 0, 12, 6, 7, 0, 15, 0, 9, 8, 28, 0, 20, 0, 21, 10, 13, 0, 35, 10, 15, 24, 27, 0, 28, 0, 60, 14, 19, 12, 48, 0, 21, 16, 49, 0, 36, 0, 39, 32, 25, 0, 75, 14, 42, 20, 45, 0, 65, 16, 63, 22, 31, 0, 68, 0, 33, 40, 124, 18, 52, 0, 57, 26, 54, 0, 104, 0, 39, 48, 63, 18, 60, 0, 105, 78, 43
Offset: 2

Views

Author

J. M. Bergot and Robert Israel, Dec 04 2020

Keywords

Comments

a(n) is the sum of proper prefixes and suffixes of the prime factorization of n.
a(n)=0 if n is prime.
a(n)=p+q if n=p*q is a semiprime.
First differs from A288654 at n=30, with a(30)=28 while A288654(30)=0.

Examples

			12=2*2*3 so a(12) = 2 + 2*2 + 2*3 + 3 = 15.
		

Crossrefs

Cf. A288654.

Programs

  • Maple
    f:= proc(n) local L,m;
      L:= sort(map(t -> t[1]$t[2],ifactors(n)[2]));
      m:= nops(L);
      add(mul(L[i],i=1..j)+mul(L[i],i=j+1..m),j=1..m-1)
    end proc:
    map(f, [$2..100]);
  • PARI
    conv(n) = {my(f=factor(n), v=vector(bigomega(n)), k=1); for (i=1, #f~, for (j=1, f[i,2], v[k] = f[i,1]; k++;);); v;}
    a(n) = my(v=conv(n)); sum(j=1, #v-1, prod(k=1, j, v[k])) + sum(j=2, #v, prod(k=j, #v, v[k])); \\ Michel Marcus, Dec 04 2020