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.

A377384 a(n) is the number of iterations that n requires to reach a noninteger or a factorial number under the map x -> x / f(x), where f(k) = A034968(k) is the sum of digits in the factorial-base representation of k; a(n) = 0 if n is a factorial number.

This page as a plain text file.
%I A377384 #10 Oct 28 2024 09:35:10
%S A377384 0,0,1,1,1,0,1,2,2,1,1,1,1,1,1,2,1,1,1,2,1,1,1,0,1,2,3,1,1,2,1,1,1,1,
%T A377384 2,2,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,2,1,2,1,2,1,1,1,2,1,1,1,1,1,1,1,1,
%U A377384 1,2,1,1,1,1,2,1,1,1,1,3,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1
%N A377384 a(n) is the number of iterations that n requires to reach a noninteger or a factorial number under the map x -> x / f(x), where f(k) = A034968(k) is the sum of digits in the factorial-base representation of k; a(n) = 0 if n is a factorial number.
%C A377384 The factorial numbers are fixed points of the map, since f(k!) = 1 for all k >= 0. Therefore they are arbitrarily assigned the value a(k!) = 0.
%C A377384 Each number n starts a chain of a(n) integers: n, n/f(n), (n/f(n))/f(n/f(n)), ..., of them the first a(n)-1 integers are factorial-base Niven numbers (A118363).
%H A377384 Amiram Eldar, <a href="/A377384/b377384.txt">Table of n, a(n) for n = 1..10000</a>
%F A377384 a(n) = 0 if and only if n is in A000142 (by definition).
%F A377384 a(n) = 1 if and only if n is in A286607.
%F A377384 a(n) >= 2 if and only if n is in A118363 \ A000142 (i.e., n is a factorial-base Niven number that is not a factorial number).
%F A377384 a(n) >= 3 if and only if n is in A377385 \ A000142.
%F A377384 a(n) >= 4 if and only if n is in A377386 \ A000142.
%F A377384 a(n) < A000005(n).
%e A377384 a(8) = 2 since 8/f(8) = 4 and 4/f(4) = 2 is a factorial number that is reached after 2 iterations.
%e A377384 a(27) = 3 since 27/f(27) = 9, 9/f(9) = 3 and 3/f(3) = 3/2 is a noninteger that is reached after 3 iterations.
%t A377384 fdigsum[n_] := Module[{k = n, m = 2, r, s = 0}, While[{k, r} = QuotientRemainder[k, m]; k != 0 || r != 0, s += r; m++]; s]; a[n_] := a[n] = Module[{s = fdigsum[n]}, If[s == 1, 0, If[!Divisible[n, s], 1, 1 + a[n/s]]]]; Array[a, 100]
%o A377384 (PARI) fdigsum(n) = {my(k = n, m = 2, r, s = 0); while([k, r] = divrem(k, m); k != 0 || r != 0, s += r; m++); s;}
%o A377384 a(n) = {my(f = fdigsum(n)); if(f == 1, 0, if(n % f, 1, 1 + a(n/f)));}
%o A377384 (Python)
%o A377384 def f(n, p=2): return n if n<p else f(n//p, p+1) + n%p
%o A377384 def a(n): return 0 if (fn:=f(n)) == 1 else (1 if n%fn else 1 + a(n//fn))
%o A377384 print([a(n) for n in range(1, 101)]) # _Michael S. Branicky_, Oct 27 2024
%Y A377384 Cf. A000005, A000142, A034968, A118363, A286607, A377385, A377386.
%Y A377384 Analogous sequences: A376615 (binary), A377208 (Zeckendorf).
%K A377384 nonn,easy,base
%O A377384 1,8
%A A377384 _Amiram Eldar_, Oct 27 2024