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.

Showing 1-2 of 2 results.

A377211 a(n) is the least number k such that A377208(k) = n, or -1 if no such number exists.

Original entry on oeis.org

1, 4, 12, 24, 180, 1056, 2592, 15552, 46656, 544320, 20528640, 238085568, 3547348992, 46438023168, 599501979648
Offset: 0

Views

Author

Amiram Eldar, Oct 20 2024

Keywords

Comments

a(15) > 2.4*10^12, if it exists.
All the terms are Zeckendorf-Niven numbers (A328208).

Examples

			  n | The n iterations
  --+---------------------------------------------
  1 | 4 -> 2 = Fibonacci(3)
  2 | 12 -> 4 -> 2
  3 | 24 -> 12 -> 4 -> 2
  4 | 180 -> 60 -> 30 -> 10 -> 5 = Fibonacci(5)
  5 | 1056 -> 264 -> 66 -> 22 -> 11 -> 11/2
  6 | 2592 -> 1296 -> 324 -> 108 -> 27 -> 9 -> 9/2
		

Crossrefs

Cf. A000045, A376619 (binary analog), A377208.
Subsequence of A328208.

Programs

  • Mathematica
    zeck[n_] := Length[DeleteCases[NestWhileList[# - Fibonacci[Floor[Log[Sqrt[5]*# + 3/2]/Log[GoldenRatio]]] &, n, # > 1 &], 0]]; (* Alonso del Arte at A007895 *)
    s[n_] := s[n] = Module[{z = zeck[n]}, If[z == 1, 0, If[!Divisible[n, z], 1, 1 + s[n/z]]]];
    seq[len_] := Module[{v = Table[0, {len}], c = 0, k = 1, i}, While[c < len, i = s[k] + 1; If[v[[i]] == 0, c++; v[[i]] = k]; k++]; v]; seq[9]
  • PARI
    zeck(n) = if(n<4, n>0, my(k=2, s, t); while(fibonacci(k++)<=n, ); while(k && n, t=fibonacci(k); if(t<=n, n-=t; s++); k--); s) \\ Charles R Greathouse IV at A007895
    s(n) = {my(z = zeck(n)); if(z == 1, 0, if(n % z, 1, 1 + s(n/z)));}
    lista(len) = {my(v = vector(len), c = 0, k = 1, i); while(c < len, i = s(k) + 1; if(v[i] == 0, c++; v[i] = k); k++); v; }

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.

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Amiram Eldar, Oct 27 2024

Keywords

Comments

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.
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).

Examples

			a(8) = 2 since 8/f(8) = 4 and 4/f(4) = 2 is a factorial number that is reached after 2 iterations.
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.
		

Crossrefs

Analogous sequences: A376615 (binary), A377208 (Zeckendorf).

Programs

  • Mathematica
    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]
  • 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;}
    a(n) = {my(f = fdigsum(n)); if(f == 1, 0, if(n % f, 1, 1 + a(n/f)));}
    
  • Python
    def f(n, p=2): return n if n

Formula

a(n) = 0 if and only if n is in A000142 (by definition).
a(n) = 1 if and only if n is in A286607.
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).
a(n) >= 3 if and only if n is in A377385 \ A000142.
a(n) >= 4 if and only if n is in A377386 \ A000142.
a(n) < A000005(n).
Showing 1-2 of 2 results.