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

A053039 Exponent of largest power of 2 which appears in the cototient-iteration started with n!.

Original entry on oeis.org

0, 1, 2, 4, 5, 7, 9, 12, 14, 11, 13, 16, 14, 16, 23, 27, 23, 23, 24, 21, 23, 28, 42, 46, 26, 26, 26, 36, 43, 29, 50, 55, 37, 37, 40, 40, 39, 59, 39, 44, 68, 42, 42, 44, 51, 45, 50, 53, 49, 52, 51, 85, 55, 57, 53, 57, 60, 85, 62, 71, 62, 63, 60, 66, 66, 107, 67, 101, 76, 70, 75, 77
Offset: 1

Views

Author

Labos Elemer, Feb 24 2000

Keywords

Comments

If the exponent is a(n), then the number of powers of 2 in the iteration-chain is 1+a(n), the maximal 2-power is 2^a(n) and the number of iterations (until fixed state) performed on these 2-powers is a(n).

Examples

			For n = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 and starting the iteration of A051593 with n!, the first powers of 2 which appear are 1, 2, 4, 16, 32, 128, 512, 4096, 16384, 2048 and the corresponding exponents are a(n) = 0, 1, 2, 4, 5, 7, 9, 12, 14, 11.
		

Crossrefs

Programs

  • Mathematica
    Log2 /@ Table[NestWhile[# - EulerPhi@ # &, n!, ! IntegerQ@ Log2@ # &], {n, 60}] (* Michael De Vlieger, Aug 15 2017 *)
  • PARI
    cototient(x)= x - eulerphi(x)
    FunctionIterate(f,x,t)= {local(retval); retval = vector(0); while(x!=t, x = eval(concat(f,"(x)")); retval = concat(retval,x)); retval;}
    A053039(x) = {local(li,fa,retval); count = 0; li = concat([x! ], FunctionIterate("cototient", x!, 0)); for(i=1,#li, fa = factor(li[i]); if(((matsize(fa)[1] == 1) && (fa[1,1] == 2)),retval = fa[1,2]; break)); retval}
    for(i=1,72,print1(A053039(i),", ")) \\ Olaf Voß, Feb 21 2008

Extensions

More terms from Olaf Voß, Feb 21 2008

A076640 a(1)=1, a(n) = a(n-phi(n)) + 1.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Oct 23 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Length@ NestWhileList[# - EulerPhi@ # &, n, # > 0 &] - 1, {n, 105}] (* Michael De Vlieger, Jul 04 2016 *)
  • PARI
    a(n)=if(n<2,1,a(n-eulerphi(n))+1)

Formula

It seems that for n large enough: log(n) < (1/n)*sum(k=1, n, a(k)) < log(n)+log(log(n)).
a(n) = A053475(n) - 1.
For n = p^k, p prime (A000040), k >= 0, a(n) = A000005(n). - Ctibor O. Zizka, Nov 09 2024

A053034 Length of sequence when A051953 (cototient function) is repeatedly applied starting with n!.

Original entry on oeis.org

2, 3, 5, 7, 10, 13, 17, 20, 24, 32, 36, 40, 50, 55, 59, 63, 72, 78, 87, 101, 103, 114, 107, 112, 135, 151, 160, 167, 164, 188, 179, 184, 208, 219, 220, 230, 260, 241, 266, 273, 261, 298, 311, 313, 321, 338, 342, 340, 367, 377, 389, 374, 410, 410, 438, 436, 457
Offset: 1

Views

Author

Labos Elemer, Feb 24 2000

Keywords

Comments

The iteration is much slower than the analog for the divisor function; this sequence is not monotonic, cf. A053475.

Examples

			n=8: initial value = 8! = 40320; the successive iterates when cototient is iterated are {40320, 31104, 20736, 13824, 9216, 6144, 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0}. Observe the parameters: length=20, cototient was applied 19 times, number of initial non-powers of 2 is 6 and 0 is the 7th, while 13 terminal powers of 2 did arise: 4096, ..., 2, 1.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{c = 1, x = n!}, While[x != 0, x = x - EulerPhi[x]; c++;]; c]; (* Sam Handler (sam_5_5_5_0(AT)yahoo.com), Sep 12 2006 *)

Formula

a(n)-1 is the smallest number such that Nest[cototient, n!, a(n)]=0, the fixed point.

Extensions

More terms from Sam Handler (sam_5_5_5_0(AT)yahoo.com), Sep 12 2006

A053035 Number of powers of 2 in the iteration-sequence when A051953 (cototient function) is repeatedly applied starting with n!.

Original entry on oeis.org

1, 2, 3, 5, 6, 8, 10, 13, 15, 12, 14, 17, 15, 17, 24, 28, 24, 24, 25, 22, 24, 29, 43, 47, 27, 27, 27, 37, 44, 30, 51, 56, 38, 38, 41, 41, 40, 60, 40, 45, 69, 43, 43, 45, 52, 46, 51, 54, 50, 53, 52, 86, 56, 58, 54, 58, 61, 86, 63, 72, 63, 64, 61, 67, 67, 108, 68, 102, 77, 71, 76
Offset: 1

Views

Author

Labos Elemer, Feb 24 2000

Keywords

Comments

Unlike the analogous sequence with A000005, the powers of 2 which emerge are consecutive iterates.

Examples

			n=7, initial value=7!=5040, the successive iterates when cototient function (A051953) is repeatedly applied are: {5040,3888,2592,1728,1152,768,512,256,128,64,32,16,8,4,2,1,0}. Between the initial segment and terminal 0, ten powers of 2 emerge: 512,...,1. Thus a(7)=10.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{x = n!}, While[ ! IntegerQ[Log[2, x]], x = x - EulerPhi[x];]; Log[2, x] + 1]; (* Sam Handler (sam_5_5_5_0(AT)yahoo.com), Sep 12 2006 *)

Extensions

More terms from Sam Handler (sam_5_5_5_0(AT)yahoo.com), Sep 12 2006

A053036 Number of values which are not powers of 2 in the trajectory when A051953 (cototient function) is repeatedly applied starting with n!.

Original entry on oeis.org

1, 1, 2, 2, 4, 5, 7, 7, 9, 20, 22, 23, 35, 38, 35, 35, 48, 54, 62, 79, 79, 85, 64, 65, 108, 124, 133, 130, 120, 158, 128, 128, 170, 181, 179, 189, 220, 181, 226, 228, 192, 255, 268, 268, 269, 292, 291, 286, 317, 324, 337, 288, 354, 352, 384, 378, 396, 345, 426, 393
Offset: 1

Views

Author

Labos Elemer, Feb 24 2000

Keywords

Comments

Unlike the analogous sequence based on A000005, the non-powers 2 which emerge during iteration are initial, consecutive iterates, except the last one=0.

Examples

			n=9, initial value=9!=362880, the successive iterates when the cototient function (A051953) is repeatedly applied are: {362880, 279936, 186624, 124416, 82944, 55296, 36864, 24576, 16384, 8192, 4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0}. This includes 8 initial and 1 terminal (it is the 0) which are not powers of 2. So a(9)=8+1=9. Beside 15 2-powers appear.
		

Crossrefs

Programs

  • PARI
    cototient(x)= x - eulerphi(x)
    FunctionIterate(f,x,t)= {local(retval); retval = vector(0); while(x!=t, x = eval(concat(f,"(x)")); retval = concat(retval,x)); retval;}
    A053036(x) = {local(li,fa,count); count = 0; li = concat([x! ],FunctionIterate("cototient", x!, 0)); for(i=1,#li, fa = factor(li[i]); if(((matsize(fa)[1] == 1) && (fa[1,1] == 2)) || (matsize(fa)[1] == 0),0,count++)); count}
    for(i=1,64,print1(A053036(i),", ")) \\ Olaf Voß, Feb 20 2008

Extensions

More terms from Olaf Voß, Feb 20 2008

A053038 The first (largest) power of 2 arising in the iteration-sequence when A051953 (the cototient function) is repeatedly applied starting with n!.

Original entry on oeis.org

1, 2, 4, 16, 32, 128, 512, 4096, 16384, 2048, 8192, 65536, 16384, 65536, 8388608, 134217728, 8388608, 8388608, 16777216, 2097152, 8388608, 268435456, 4398046511104, 70368744177664, 67108864, 67108864, 67108864, 68719476736
Offset: 1

Views

Author

Labos Elemer, Feb 24 2000

Keywords

Examples

			For n = 10, initial value = 10! = 3628800; after the following initial terms {3628800, 2799360, 2052864, 1430784, 974592, 656640, 490752, 329472,  237312, 158976, 108288, 72960, 54528, 36608, 21248, 10752, 7680, 5632, 3072, ...}, the first power of 2 is 2048 = cototient(3072). Therefore a(10) = 2048.
		

Crossrefs

Programs

  • Mathematica
    Table[NestWhile[# - EulerPhi@ # &, n!, ! IntegerQ@ Log2@ # &], {n, 28}] (* Michael De Vlieger, Aug 15 2017 *)

A098200 Number of distinct terms in iteration-list when cototient-function[=A051953] is iterated and the initial value is even number.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Sep 22 2004

Keywords

Comments

Seems larger than A053475[2n+1]=A098201[n]

Crossrefs

Formula

a[n]=A053475[2n]

A098201 Number of distinct terms in iteration-list when cototient-function[=A051953] is iterated and the initial value is odd number.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Sep 22 2004

Keywords

Comments

Seems smaller than A053475[2n]=A098200[n]

Crossrefs

Formula

a[n]=A053475[ -1+2n]

A098202 a(n) is the length of the iteration trajectory when the cototient function (A051953) is applied to the n-th primorial number (A002110(n)).

Original entry on oeis.org

3, 5, 8, 12, 18, 20, 31, 32, 41, 43, 61, 65, 80, 77, 95, 125, 131, 125, 157, 173, 140, 192, 195, 221, 213, 212, 261, 269, 277, 300, 296, 321, 336, 329, 358, 367, 379, 405, 428, 439, 438, 464, 477, 493, 506, 454, 491, 542, 564, 588, 543, 600, 639, 660
Offset: 1

Views

Author

Labos Elemer, Sep 22 2004

Keywords

Examples

			For n = 3: list = {30,22,12,8,4,2,1,0}, a(4) = 8.
		

Crossrefs

Programs

  • Mathematica
    g[x_] := x - EulerPhi[x]; f[x_] := Length[ FixedPointList[g, x]] - 1; q[x_] := Product[ Prime[j], {j, x}]; Table[ f[ q[n]], {n, 33}]
    a[n_] := Length@ NestWhileList[(# - EulerPhi[#])&, Times @@ Prime[Range[n]], # > 0 &]; Array[a, 30] (* Amiram Eldar, Nov 19 2024 *)
  • PARI
    a(n) = {my(p = prod(i=1, n, prime(i)), c = 1); while(p > 0, c++; p -= eulerphi(p)); c;} \\ Amiram Eldar, Nov 19 2024

Formula

a(n) = A053475(A002110(n)). - Robert G. Wilson v, Sep 22 2004

Extensions

More terms from Robert G. Wilson v, Sep 22 2004
a(37)-a(54) from Amiram Eldar, Nov 19 2024

A098115 a(n) is the length of iteration trajectory when the cototient function (A051953) is applied to the half of the n-th primorial number (A070826(n) = A002110(n)/2).

Original entry on oeis.org

2, 3, 4, 7, 10, 5, 12, 15, 12, 28, 6, 6, 31, 12, 47, 29, 23, 32, 33, 24, 40, 28, 12, 35, 34, 56, 17, 36, 40, 123, 57, 61, 9, 99, 94, 132, 158, 172, 23, 43, 89, 186, 196, 194, 203, 157, 205, 62, 32, 26, 76, 105, 65, 45, 177, 56, 278
Offset: 1

Views

Author

Labos Elemer, Sep 27 2004

Keywords

Comments

Initial values are here odd numbers. Comparing with the case of primorials (A098202), the lengths are here significantly smaller. The cause of this is unknown, albeit informally "understood": lack of powers of 2 in lists because parity is invariant during this iteration. See also lists for A098200 and A098201.

Examples

			For n = 7: list = {255255,163095,77815,16663,895,183,63,27,9,3,1,0}, a(7) = 12, while the comparable length for 510510 is A098202(7) = 43.
		

Crossrefs

Programs

  • Mathematica
    g[x_] :=x-EulerPhi[x]; f[x_] :=Length[FixedPointList[g, x]]-1; q[x_] :=Apply[Times, Table[Prime[j], {j, 1, x}]]; t=Table[f[q[w]/2], {w, 1, 37}]
    a[n_] := Length@ NestWhileList[(# - EulerPhi[#])&, Times @@ Prime[Range[2, n]], # > 0 &]; Array[a, 30] (* Amiram Eldar, Nov 19 2024 *)
  • PARI
    a(n) = {my(p = prod(i=2, n, prime(i)), c = 1); while(p > 0, c++; p -= eulerphi(p)); c;} \\ Amiram Eldar, Nov 19 2024

Formula

a(n) = A053475(A070826(n)) = A053475(A002110(n)/2).

Extensions

a(38)-a(57) from Amiram Eldar, Nov 19 2024
Showing 1-10 of 10 results.