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.

A340967 a(n) is the number of iterations of the map x -> n mod sopfr(x) starting with n to reach 0 or 1, where sopfr = A001414.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 3, 1, 4, 2, 1, 1, 2, 1, 2, 1, 4, 1, 3, 2, 4, 1, 3, 1, 1, 1, 2, 3, 3, 3, 2, 1, 4, 4, 3, 1, 3, 1, 4, 1, 3, 1, 2, 2, 2, 4, 1, 1, 5, 3, 2, 4, 4, 1, 1, 1, 4, 4, 2, 4, 2, 1, 4, 2, 1, 1, 1, 1, 3, 3, 3, 3, 3, 1, 2, 3, 3, 1, 1, 3, 4, 5, 2, 1, 3, 3, 3, 3, 5, 4, 2, 1, 2, 2
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jan 31 2021

Keywords

Comments

If n is prime, or n is in A164643, then a(n) = 1.

Examples

			a(12) = 3 because 12 mod (2+2+3) = 5, 12 mod 5 = 2 and 12 mod 2 = 0 (3 iterations).
a(54) = 5 because 54 mod (2+3+3+3) = 10, 54 mod (2+5) = 6, 54 mod 5 = 4, 54 mod (2+2) = 2, and 54 mod 2 = 0 (5 iterations).
		

Crossrefs

Programs

  • Maple
    sopfr:= proc(n) local t;
      add(t[1]*t[2], t = ifactors(n)[2])
    end proc:
    f:= proc(n) local x,k;
      x:= n;
      for k from 1 do x:= n mod sopfr(x); if x <= 1 then return k fi od;
    end proc:
    f(1):= 0:
    map(f, [$1..200]);
  • Python
    from sympy import factorint
    def A340967(n):
        c, x = 0, n
        while x > 1:
            c += 1
            x = n % sum(p*e for p, e in factorint(x).items())
        return c # Chai Wah Wu, Feb 01 2021