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.

A053148 When cototient function (A051953) is iterated with initial value A002110(n), a(n) = exponent of the largest power of 2 which appears in the iteration.

Original entry on oeis.org

1, 2, 3, 5, 5, 8, 5, 9, 8, 16, 6, 9, 12, 8, 9, 7, 4, 11, 6, 6, 9, 13, 8, 13, 11, 17, 7, 13, 20, 4, 11, 11, 15, 13, 9, 19, 13, 6, 4, 13, 4, 4, 8, 4, 24, 20
Offset: 1

Views

Author

Labos Elemer, Feb 28 2000

Keywords

Comments

In these iteration chains, powers of 2 seem to be in the minority.
The sequence is not monotonic.

Examples

			For n=10, the iteration chain of 43 terms is {6469693230, 5447823150, 4315810350, ..., 188416, 98304, 65536, 32768, ..., 4, 2, 1, 0} in which the largest power of 2 is 65536 = 2^16, so a(10)=16;
for n=11 the length is 61, including 54 numbers that are not powers of 2 and 7 powers of 2, of which the largest is 2^6 thus a(11)=6.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Max@ IntegerExponent[ NestWhileList[# - EulerPhi[#] &, Times @@ Prime[Range[n]], # > 1 &], 2]; Array[a, 25] (* Giovanni Resta, May 30 2018 *)
  • PARI
    A051953(n)= { return(n-eulerphi(n)); } A002110(n)= { return(prod(i=1,n,prime(i))); } ispow2(n)= { local(nbin,nbinl,sd); nbin=binary(n); nbinl=matsize(nbin); sd=sum(i=1,nbinl[2],nbin[i]); if(sd==1, return(nbinl[2]-1), return(0); ); } A053148itr(n)= { local(v,vbin,maxp); v=A002110(n); maxp=ispow2(v); while(v>0, v=A051953(v); maxp=max(maxp,ispow2(v)); ); return(maxp); } { for(n=1,70, print1(A053148itr(n),","); ); } \\ R. J. Mathar, May 19 2006

Extensions

More terms from R. J. Mathar, May 19 2006
a(37)-a(46) from Giovanni Resta, May 31 2018