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.

A309155 For integer n with prime factors p_i (1 <= i <= r), with repetition, (Omega(n) = r); a(n) = Sum_{i=1..r} k_i, where k_i is the least positive integer such that p_i - k_i | n - k_i.

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 1, 3, 2, 5, 1, 4, 1, 7, 4, 4, 1, 5, 1, 4, 6, 11, 1, 5, 2, 13, 3, 6, 1, 7, 1, 5, 10, 17, 5, 6, 1, 19, 12, 7, 1, 5, 1, 10, 3, 23, 1, 6, 2, 5, 16, 12, 1, 7, 10, 9, 18, 29, 1, 8, 1, 31, 5, 6, 10, 9, 1, 16, 22, 9, 1, 7, 1, 37, 7, 18, 7, 11, 1, 6, 4, 41, 1, 10, 14
Offset: 1

Views

Author

David James Sycamore, Jul 14 2019

Keywords

Comments

For n>1, such a k_i always exists for every p_i|n, since with k_i=p_i - 1, p-k_i =1, always divides n - p_i. omega(n)<=a(n)<=Sopf(n) - Omega(n). The left side equality applies when n is a prime or a Carmichael number. The right side equality applies to numbers n such that k_i = p_i - 1, 1 <= i <= r (it can be shown that all numbers with this property are even, see A309239). For n>2, records of a(n) occur when n is an even semiprime.

Examples

			For n prime a(n) = 1; n = 4 = 2*2 —> k_1 = k_2 = 1, so a(4) = 1 + 1 = 2.
		

Crossrefs

Programs

  • Mathematica
    g[n_,p_] := Module[{k=1}, While[!Divisible[n - k, p - k], k++]; k]; a[1]=0; a[n_] := Module[{f = FactorInteger[n]}, p=f[[;;,1]]; e=f[[;;,2]]; Sum[e[[k]] * g[n,p[[k]]], {k, 1, Length[p]}]]; Array[a, 85] (* Amiram Eldar, Jul 18 2019 *)
  • PARI
    getk(p, n) = {my(k=1); while ((n - k) % (p - k), k++); k;}
    a(n) = {my(f=factor(n)); for (i=1, #f~, f[i, 1] = getk(f[i, 1], n);); sum(i=1, #f~, f[i,1]*f[i,2]);} \\ Michel Marcus, Jul 16 2019

Formula

n a prime power p^k, (k>=1) -> a(n) = k; n an even semiprime, 2*p -> a(n) = p (because for n=2*p, k_1 = 1, and k_2 = p-1).
A001221(n) <= a(n) <= A001414(n) - A001222(n).

Extensions

More terms from Michel Marcus, Jul 16 2019