login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 3
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
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?
LINKS
EXAMPLE
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.
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 ] ] ]
PROG
(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
CROSSREFS
Sequence in context: A317929 A285387 A100803 * A159913 A183061 A172097
KEYWORD
nonn
AUTHOR
Joseph L. Pe, Jan 09 2002
EXTENSIONS
Edited by Dean Hickerson, Jan 18 2002
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 08:13 EDT 2024. Contains 371265 sequences. (Running on oeis4.)