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!)
A079878 a(1)=1, then a(n)=2*a(n-1) if 2*a(n-1)<=n, a(n)=2*a(n-1)-n otherwise. 5
1, 2, 1, 2, 4, 2, 4, 8, 7, 4, 8, 4, 8, 2, 4, 8, 16, 14, 9, 18, 15, 8, 16, 8, 16, 6, 12, 24, 19, 8, 16, 32, 31, 28, 21, 6, 12, 24, 9, 18, 36, 30, 17, 34, 23, 46, 45, 42, 35, 20, 40, 28, 3, 6, 12, 24, 48, 38, 17, 34, 7, 14, 28, 56, 47, 28, 56, 44, 19, 38, 5, 10, 20, 40, 5, 10, 20, 40, 1, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
a(A200087(n)) = n and a(m) <> n for m < A200087(n). [Reinhard Zumkeller, Nov 13 2011]
LINKS
FORMULA
a(n) = A064434(n)+1.
It seems that sum(k=1, n, a(k))/n^2 ->1/4
MATHEMATICA
nxt[{n_, a_}]:={n+1, If[2a<=n+1, 2a, 2a-n-1]}; Transpose[NestList[nxt, {1, 1}, 80]][[2]] (* Harvey P. Dale, Jul 20 2015 *)
PROG
(PARI) a=1; for(n=2, 100, b=if(sign(2*a-n)-1, 2*a, 2*a-n); a=b; print1(b, ", "))
(Haskell)
a079878 n = a079878_list !! (n-1)
a079878_list = 1 : zipWith (\x n -> if x <= n then x else x - n)
(map (* 2) a079878_list) [2..]
-- Reinhard Zumkeller, Nov 13 2011
CROSSREFS
Cf. A200063 (fixed points), A064456 (positions of 1).
Sequence in context: A274624 A263050 A060547 * A324469 A329688 A217920
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Feb 20 2003
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 April 23 08:33 EDT 2024. Contains 371905 sequences. (Running on oeis4.)