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

A096866 Function A062402(x) = sigma(phi(x)) is iterated. Starting with n, a(n) is the smallest term arising in trajectory, either in transient or in terminal cycle.

Original entry on oeis.org

1, 1, 3, 3, 5, 3, 7, 7, 7, 7, 7, 7, 13, 7, 15, 15, 17, 7, 19, 15, 21, 7, 23, 15, 25, 26, 27, 28, 29, 15, 31, 31, 28, 31, 31, 28, 37, 31, 31, 31, 31, 28, 43, 28, 31, 28, 31, 31, 49, 28, 51, 31, 53, 31, 31, 31, 57, 31, 31, 31, 61, 31, 63, 63, 65, 28, 67, 63, 31, 31, 71, 31, 73, 74
Offset: 1

Views

Author

Labos Elemer, Jul 21 2004

Keywords

Examples

			n=240: list={240,127,312,[252,195],252,...}, a(240)=127, a transient;
n=254: list={254,312,[252,195],252,...}, a(254)=195, a recurrent term.
		

Crossrefs

Cf. A062401, A062402, A096862, A096863, A096864 (largest term), A096993.
Cf. also A096865.

Programs

  • Mathematica
    gf[x_] :=DivisorSigma[1, EulerPhi[x]] gite[x_, hos_] :=NestList[gf, x, hos] Table[Min[gite[w, 20]], {w, 1, 256}]
  • Scheme
    (define (A096866 n) (let loop ((visited (list n)) (m n)) (let ((next (A062402 (car visited)))) (cond ((member next visited) m) (else (loop (cons next visited) (min m next))))))) ;; Antti Karttunen, Nov 18 2017

A096864 Function A062402(x) = sigma(phi(x)) is iterated. Starting with n, a(n) is the largest term arising in trajectory, either in transient or in terminal cycle.

Original entry on oeis.org

1, 2, 3, 4, 12, 6, 12, 12, 12, 12, 18, 12, 28, 14, 15, 16, 72, 18, 72, 20, 28, 22, 36, 24, 42, 28, 72, 28, 72, 30, 72, 72, 42, 72, 72, 36, 252, 72, 72, 72, 90, 42, 252, 44, 72, 46, 72, 72, 252, 50, 252, 72, 252, 72, 90, 72, 252, 72, 90, 72, 168, 72, 252, 252, 168, 66, 168, 252
Offset: 1

Views

Author

Labos Elemer, Jul 21 2004

Keywords

Examples

			n=256: list={256,255,255}, a(256)=256 as a transient term;
n=101: list={101,217,546,403,1170,819,[1240,1512],1240,...}, a(101)=1512 as a cycle term.
		

Crossrefs

Cf. A062401, A062402, A066437, A096862, A096863, A096866 (smallest term), A096993.
Cf. also A096861.

Programs

  • Mathematica
    gf[x_] :=DivisorSigma[1, EulerPhi[x]] gite[x_, hos_] :=NestList[gf, x, hos] Table[Max[gite[w, 20]], {w, 1, 256}]
    Table[Max[NestList[DivisorSigma[1,EulerPhi[#]]&,n,20]],{n,70}] (* Harvey P. Dale, May 13 2019 *)
  • Scheme
    (define (A096864 n) (let loop ((visited (list n)) (m n)) (let ((next (A062402 (car visited)))) (cond ((member next visited) m) (else (loop (cons next visited) (max m next))))))) ;; Antti Karttunen, Nov 18 2017

Formula

a(n) = max(n, A066437(n)). - Antti Karttunen, Dec 06 2017

A096863 Function A062402(x)=sigma(phi(x)) is iterated. Starting with n, a(n) is the count of transient terms of trajectory.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Jul 21 2004

Keywords

Comments

a(n)=0 means that n is a recurrent term from A096998.

Examples

			n=256: list={256,255,255}, a(256)=1;
n=101: list={101,217,546,403,1170,819,[1240,1512],1240,...,a(101)=6;
		

Crossrefs

Formula

a(n) = A096861(n)-A096993(n).

A036840 a(n) is the average of the repeating terms of {T(n,k)} rounded to the nearest integer (rounding up if there's a choice), if {T(n,k)} is eventually periodic; = 0 otherwise. Here T(n,k) is the "phi/sigma tug-of-war sequence with seed n" defined by T(n,1) = phi(n), T(n,2) = sigma(phi(n)), T(n,3) = phi(sigma(phi(n))), ..., T(n,k) = phi(T(n,k-1)) if k is odd and = sigma(T(n,k-1)) if k is even.

Original entry on oeis.org

1, 1, 3, 3, 7, 3, 7, 7, 7, 7, 7, 7, 20, 7, 12, 12, 39, 7, 39, 12, 20, 7, 20, 12, 20, 20, 39, 20, 39, 12, 39, 39, 20, 39, 39, 20, 154, 39, 39, 39, 39, 20, 154, 20, 39, 20, 39, 39, 154, 20, 154, 39, 154, 39, 39, 39, 154, 39, 39, 39, 100, 39, 154, 154, 100, 20, 100, 154, 39, 39
Offset: 1

Views

Author

Joseph L. Pe, Jan 09 2002

Keywords

Comments

Conjecture: a(n) is never 0; i.e. the sequence {T(n,k)} is eventually periodic for every n.
a(n) - n can be thought of as the final score in the phi/sigma tug-of-war with seed n. For example a(5) - 5 = 7 - 5 = 2, so sigma wins by "2 points" over phi at 5. a(8) - 8 = 7 - 8 = -1, so phi wins by "1 point" over sigma at 8. a(3) - 3 = 3 - 3 = 0, so it is a tie at 3. Are sigma's margins of victory over phi bounded? Are phi's bounded?

Examples

			The sequence {T(5,k)} is 4, 7, 6, 12, 4, 7, .... The average of the repeating numbers is 7.25 which rounds off to 7. So a(5) = 7. The sequence {T(37,k)} is 36, 91, 72, 195, 96, 252, 72, 195, .... The average of the repeating numbers is 153.75, which rounds off to 154. So a(37) = 154.
		

Crossrefs

Programs

  • Mathematica
    a[ n_ ] := Module[ {}, For[ m=n; seq={}, !MemberQ[ seq, m ], m=DivisorSigma[ 1, EulerPhi[ m ] ], AppendTo[ seq, m ] ]; rp=Drop[ seq, Position[ seq, m ][ [ 1, 1 ] ]-1 ]; Floor[ 1/2+(Plus@@Join[ rp, EulerPhi/@rp ])/2/Length[ rp ] ] ]
  • Scheme
    (define (A036840 n) (let loop ((visited (list n)) (i 1)) (let ((next ((if (odd? i) A000010 A000203) (car visited)))) (cond ((member next (reverse visited)) => (lambda (start_of_cyclic_part) (cond ((even? (length start_of_cyclic_part)) (floor->exact (+ 1/2 (/ (apply + start_of_cyclic_part) (length start_of_cyclic_part))))) (else (loop (cons next visited) (+ 1 i)))))) (else (loop (cons next visited) (+ 1 i))))))) ;; Antti Karttunen, Dec 06 2017

Extensions

Edited by Dean Hickerson, Jan 18 2002

A097008 a(n) = index of first appearance of n in A096862.

Original entry on oeis.org

1, 2, 5, 11, 19, 43, 53, 101, 1297, 883, 1009, 1037, 1051, 985, 2391, 12101, 13457, 21887, 42683, 69697, 50177, 115601, 113669, 88897, 156817, 184477, 247487, 245029, 187273, 287543, 211031, 287093, 1001447, 5398093, 9741229, 7757137
Offset: 1

Views

Author

Labos Elemer, Jul 26 2004

Keywords

Comments

a(n) = smallest k such that A096863(k) + A096993(k) = n.
a(n) = smallest k such that n equals the index of the term that completes the first cycle in the trajectory of k under iteration of f(x) = A062402(x) = sigma(phi(x)).

Examples

			The trajectory of 19 under iteration of f(x) is 19, 39, 60, 31, 72, 60, 31, 72, ...; the cycle (60, 31, 72) is completed at the fifth term and for j < 19 the first cycle in trajectory of j under iteration of f(x) is completed at the first, second, third or fourth term, hence a(5) = 19.
The trajectory of 247487 under iteration of f(x) is 247487, 787200, 507873, 1282842, 1395372, 1476096, 1572096, 1089403, 3669120, 2621120, 4464096, 3963960, 2946240, 2538280, 3265416, 2877420, 1965840, 2227680, 1310680, 1591200, 1277874, 1307124, 1110488, 2010960, 1488032, 1981496, 2239920, 1965840, ...; the cycle (1965840, 2227680,
..., 2239920) is completed at the 27th term and for j < 247487 the first cycle in trajectory of j under iteration of f(x) is completed at an earlier term, hence a(27) = 247487.
		

Crossrefs

Programs

  • Mathematica
    sf[x_] :=DivisorSigma[1, EulerPhi[x]]; nsf[x_, ho_] :=NestList[sf, x, ho]; luf[x_, ho_] :=Length[Union[nsf[x, ho]]]; t=Table[0, {35}];Do[s=luf[n, 100]; If[s<36&&t[[s]]==0, t[[s]]=n], {n, 1, 1500000}];t
  • PARI
    {v=vector(40); for(n=1, 10000000, k=n; s=Set(k); until(setsearch(s, k=sigma(eulerphi(k))), s=setunion(s, Set(k))); a=#s; if(a<=m&&v[a]==0, v[a]=n)); v} /* Klaus Brockhaus, Jul 16 2007 */

Extensions

Edited, a(27) and a(33) corrected and a(34) through a(36) added by Klaus Brockhaus, Jul 16 2007
Showing 1-5 of 5 results.