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-3 of 3 results.

A376615 a(n) is the number of iterations that n requires to reach a noninteger under the map x -> x / wt(x), where wt(k) is the binary weight of k (A000120); a(n) = 0 if n is a power of 2.

Original entry on oeis.org

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

Views

Author

Amiram Eldar, Sep 30 2024

Keywords

Comments

The powers of 2 are fixed points of the map, since wt(2^k) = 1 for all k >= 0. Therefore they are arbitrarily assigned the value a(2^k) = 0.
Each number n starts a chain of a(n) integers: n, n/wt(n), (n/wt(n))/wt(n/wt(n)), ..., of them the first a(n)-1 integers are binary Niven numbers (A049445).

Examples

			a(6) = 2 since 6/wt(6) = 3 and 3/wt(3) = 3/2 is a noninteger that is reached after 2 iterations.
a(20) = 3 since 20/wt(20) = 10, 10/wt(10) = 5 and 5/wt(5) = 5/2 is a noninteger that is reached after 3 iterations.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = Module[{bw = DigitCount[n, 2, 1]}, If[bw == 1, 0, If[!Divisible[n, bw], 1, 1 + a[n/bw]]]]; Array[a, 100]
  • PARI
    a(n) = {my(w = hammingweight(n)); if(w == 1, 0, if(n % w, 1, 1 + a(n/w)));}

Formula

a(n) = 0 if and only if n is in A000079 (by definition).
a(n) = 1 if and only if n is in A065878.
a(n) >= 2 if and only if n is in A049445 \ A000079 (i.e., n is a binary Niven number that is not a power of 2).
a(n) >= 3 if and only if n is in A376616 \ A000079.
a(n) >= 4 if and only if n is in A376617 \ A000079.
a(2*n) >= a(n).
a(3*2^n) = n+1 for n >= 0.
a(n) < A000005(n).

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; }

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

Original entry on oeis.org

1, 3, 8, 27, 135, 1215, 15795, 328050, 4920750, 127764000, 5826168000, 126097171200
Offset: 0

Views

Author

Amiram Eldar, Oct 27 2024

Keywords

Comments

a(12) > 2.2*10^12, if it exists.
a(12) <= 5160284236800, a(13) <= 227052506419200. - David A. Corneth, Oct 27 2024
All the terms except for 3 are factorial-base Niven numbers (A118363).

Examples

			  n | The n iterations
  --+------------------------------------------------------
  1 | 3 -> 3/2
  2 | 8 -> 4 -> 2 = 2!
  3 | 27 -> 9 -> 3 -> 3/2
  4 | 135 -> 27 -> 9 -> 3 -> 3/2
  5 | 1215 -> 135 -> 27 -> 9 -> 3 -> 3/2
  6 | 15795 -> 1215 -> 135 -> 27 -> 9 -> 3 -> 3/2
  7 | 328050 -> 18225 -> 1215 -> 135 -> 27 -> 9 -> 3 -> 3/2
		

Crossrefs

Analogous sequences: A376619 (binary), A377211 (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]; f[n_] := f[n] = Module[{s = fdigsum[n]}, If[s == 1, 0, If[!Divisible[n, s], 1, 1 + f[n/s]]]]; seq[len_] := Module[{v = Table[0, {len}], c = 0, k = 1, i}, While[c < len, i = f[k] + 1; If[v[[i]] == 0, c++; v[[i]] = k]; k++]; v]; seq[8]
  • 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;}
    f(n) = {my(s = fdigsum(n)); if(s == 1, 0, if(n % s, 1, 1 + f(n/s)));}
    lista(len) = {my(v = vector(len), c = 0, k = 1, i); while(c < len, i = f(k) + 1; if(v[i] == 0, c++; v[i] = k); k++); v; }
Showing 1-3 of 3 results.