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.

A340594 a(n) is the number of iterations of A340592 starting from n, until 0, 1 or a prime is reached.

Original entry on oeis.org

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

Views

Author

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

Keywords

Comments

a(n) = 0 if n is prime.

Examples

			A340592(21) = 16, A340592(16) = 14, A340592(14) = 13 is prime, so a(21) = 3.
		

Crossrefs

Programs

  • Maple
    dcat:= proc(L) local i, x;
      x:= L[-1];
      for i from nops(L)-1 to 1 by -1 do
        x:= 10^(1+ilog10(x))*L[i]+x
      od;
      x
    end proc:
    f:= proc(n) local F;
      F:= sort(ifactors(n)[2], (a, b) -> a[1] < b[1]);
      dcat(map(t -> t[1]$t[2], F)) mod n;
    end proc:
    g:= proc(n) option remember;
         if isprime(n) then 0 else 1 + procname(f(n)) fi
    end proc:
    g(0):= 0: g(1):= 0:
    map(g, [$1..1000]);

Formula

a(n) = A066247(n)*(1 + a(A340592(n))).