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.

A297025 Number of iterations of A220096 required to reach 0 starting from n.

Original entry on oeis.org

0, 1, 2, 3, 3, 4, 4, 5, 4, 4, 5, 6, 5, 6, 6, 5, 5, 6, 5, 6, 6, 6, 7, 8, 6, 5, 7, 5, 7, 8, 6, 7, 6, 7, 7, 6, 6, 7, 7, 7, 7, 8, 7, 8, 8, 6, 9, 10, 7, 6, 6, 7, 8, 9, 6, 7, 8, 7, 9, 10, 7, 8, 8, 7, 7, 7, 8, 9, 8, 9, 7, 8, 7, 8, 8, 6, 8, 7, 8, 9, 8, 6, 9, 10, 8, 7
Offset: 0

Views

Author

Peter Kagey and Alec Jones, Dec 24 2017

Keywords

Comments

Records occur at indices 0, 1, 2, 3, 5, 7, 11, 22, 23, 46, 47, 94, ... (see A297026).

Examples

			For n = 14, a(14) = 6 because six iterations are required to reach zero:
A220096(14) = 7,
A220096(7)  = 6,
A220096(6)  = 3,
A220096(3)  = 2,
A220096(2)  = 1, and
A220096(1)  = 0.
		

Crossrefs

Cf. A220096. Positions of records at A297026.

Programs

  • Mathematica
    g[n_Integer] := If[n == 1, 0, Block[{fi = FactorInteger@ n}, If[Plus @@ (Last@# & /@ FactorInteger@n) == 1, n -1, n/fi[[1, 1]] ]]]; f[n_] := Length@ NestWhileList[g, n, # > 0 &] -1; Array[f, 86, 0] (* Robert G. Wilson v, Dec 24 2017 *)
  • PARI
    f(n) = if (n==1, 0, isprime(n), n-1, my(d=divisors(n)); d[#d-1]);
    a(n) = my(nb = 0); while (n, n = f(n); nb++); nb; \\ Michel Marcus, Dec 24 2017

A091934 Number of dual isomorphisms on [ n,n* ].

Original entry on oeis.org

1, 3, 4, 7, 8, 10, 11, 15, 19, 24, 25, 30
Offset: 1

Views

Author

Jon Perry, Mar 11 2004

Keywords

Comments

I would like a better definition. - N. J. A. Sloane.

Crossrefs

Cf. A220096.

A297026 Positions of records in A297025.

Original entry on oeis.org

0, 1, 2, 3, 5, 7, 11, 22, 23, 46, 47, 94, 167, 283, 359, 718, 719, 1438, 1439, 2878, 2879, 5758, 11516, 23032, 34549, 69098, 138059, 138197, 276394, 552788, 1105576, 2211152, 3316619, 6633238, 11792393, 23584786, 23584787, 47169574, 53065907, 106131814, 212263628, 424527256
Offset: 1

Views

Author

Peter Kagey, Dec 24 2017

Keywords

Comments

From David A. Corneth, Dec 24 2017: (Start)
If n > 2 then a(n) <= 2 * a(n - 1). Proof: 2 * a(n - 1) is even. After one iteration of A220096, we get a(n - 1), which gives a record.
If n > 3 and a(n) < 2 * a(n - 1) then a(n) is odd. Proof: if a(n) is even then a(n) / 2 < a(n - 1) is in the sequence. We have k = A297025(a(n - 1)) and k + 1 = A297025(2 * a(n - 1)) hence a(n) can't be the position of a record as a(n - 1) < a(n) < 2 * a(n-1).
If n > 2 and a(n) < 2 * a(n - 1) then a(n) is prime. Proof: This is true for n = 3. For n > 3, a(n) is odd. If a(n) is composite then it has a smallest odd prime factor p >= 3. We have A297025(a(n) / p) < A297025(a(n - 1)) < A297025(a(n)) which is impossible hence in this case, a(n) is prime. (End)

Crossrefs

Programs

  • Mathematica
    With[{s = Array[Length@ NestWhileList[If[#1 == 1, 0, If[Total[#2[[All, -1]] ] == 1, #1 - 1, #1/#2[[1, 1]] ]] & @@ {#, FactorInteger@ #} &, #, # > 0 &] - 1 &, 2^18, 0] }, FirstPosition[s, #][[1]] - 1 & /@ Union@ FoldList[Max, s]] (* Michael De Vlieger, Dec 24 2017, after Robert G. Wilson v at A297025 *)
  • PARI
    f(n) = if (n==1, 0, isprime(n), n-1, my(d=divisors(n)); d[#d-1]);
    nb(n) = my(nb = 0); while (n, n = f(n); nb++); nb;
    lista(nn) = {my(rec = - 1); for (n=0, nn, if ((m=nb(n)) > rec, rec = m; print1(n, ", ")););} \\ Michel Marcus, Dec 24 2017
    
  • PARI
    first(n) = {n = max(n, 2); my(res = vector(n), i = 3, c = 2, m = 1); res[1] = 0; res[2] = 1; while(i <= n, forprime(p = res[i-1] + 1, 2*res[i-1], c = A297025(p); if(c > m, m = c; res[i] = p; i++; next(2))); if(res[i] == 0, res[i] = 2 * res[i-1]; i++; m++)); res}
    A220096(n) = if(n == 1, return(0)); my(f = factor(n)); if(vecsum(f[,2])==1, n-1, n / f[1,1])
    A297025(n) = my(t); while(n, t++; n = A220096(n)); t \\ David A. Corneth, Dec 24 2017

Extensions

a(29)-a(33) from Michel Marcus, Dec 24 2017
More terms from David A. Corneth, Dec 24 2017
Showing 1-3 of 3 results.