login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A025480 a(2n) = n, a(2n+1) = a(n). 30
0, 0, 1, 0, 2, 1, 3, 0, 4, 2, 5, 1, 6, 3, 7, 0, 8, 4, 9, 2, 10, 5, 11, 1, 12, 6, 13, 3, 14, 7, 15, 0, 16, 8, 17, 4, 18, 9, 19, 2, 20, 10, 21, 5, 22, 11, 23, 1, 24, 12, 25, 6, 26, 13, 27, 3, 28, 14, 29, 7, 30, 15, 31, 0, 32, 16, 33, 8, 34, 17, 35, 4, 36, 18, 37, 9, 38, 19, 39, 2, 40, 20, 41, 10 (list; graph; refs; listen; history; internal format)
OFFSET

0,5

COMMENTS

These are the nim-values for heaps of n beans in the game where you're allowed to take up to half of the beans in a heap. - R. K. Guy, Mar 30 2006

When n>0 is written as (2k+1)*2^j then k=A000265(n-1) and j=A007814(n), so: when n is written as (2k+1)*2^j-1 then k=A025480(n) and j=A007814(n+1), when n>1 is written as (2k+1)*2^j+1 then k=A025480(n-2) and j=A007814(n-1)

According to the comment from Deuard Worthen, this may be regarded as a triangle where row r=1,2,3... has length 2^(r-1) and values T[r,2k-1]=T[r-1,k], T[r,2k]=2^(r-1)+k-1, i.e. previous row gives first, 3rd, 5th... term and 2nd, 4th... terms are numbers 2^(r-1),...,2^r-1 (i.e. those following the last one from the previous row). - M. F. Hasler (www.univ-ag.fr/~mhasler), May 03 2008

Let StB be a Stern-Brocot tree hanging between (pseudo)fractions Left and Right, then StB(1) = mediant(Left,Right) and for n>1: StB(n) = if a(n-1)<>0 and a(n)<>0 then mediant(StB(a(n-1)),StB(a(n))) else if a(n)=0 then mediant(StB(a(n-1)),Right) else mediant(Left,StB(a(n-1))), where mediant(q1,q2) = ((numerator(q1)+numerator(q2)) / (denominator(q1)+denominator(q2))). [From Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Dec 22 2008]

a(n) = A153733(n)/2. [From Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Dec 31 2008]

Contribution from Cale Gibbard (cgibbard(AT)gmail.com), Nov 18 2009: (Start)

This sequence is the unique fixed point of the function

(a(0), a(1), a(2), ...) |--> (0, a(0), 1, a(1), 2, a(2), ...)

which interleaves the nonnegative integers between the elements of a sequence. (End)

Contribution from Paul Tarau (paul.tarau(AT)gmail.com), Mar 21 2010: (Start)

The following relation holds: 2^A007814[n](2A025480[n]+1)=A001477[n].

(See functions hd,tl and cons in [Paul Tarau 2009]). (End)

REFERENCES

L. Levine, Fractal sequences and restricted Nim, Ars Comb., Ars Combin. 80 (2006), 113-127.

Paul Tarau. A Groupoid of Isomorphic Data Transformations. Calculemus 2009, 8th International Conference, MKM 2009, pp. 170-185,Springer, LNAI 5625. [From Paul Tarau (paul.tarau(AT)gmail.com), Mar 21 2010]

LINKS

N. J. A. Sloane, Table of n, a(n) for n = 0..10000

L. Levine, Fractal sequences and restricted Nim

R. Stephan, Some divide-and-conquer sequences ...

R. Stephan, Table of generating functions

FORMULA

a(n) = (A000265(n+1)-1)/2 = ((n+1)/A006519(n+1)-1)/2

EXAMPLE

Comment from Deuard Worthen (deuard(AT)raytheon.com), Jan 27 2006: This sequence can be constructed as a triangle, thus:

0

0 1

0 2 1 3

0 4 2 5 1 6 3 7

0 8 4 9 2 10 5 11 1 12 6 13 3 14 7 15

...

-at each stage we interpolate the next 2^m numbers in the previous row.

Left=0/1, Right=1/0: StB=A007305/A047679; Left=0/1, Right=1/1: StB=A007305/A007306; Left=1/3, Right=2/3: StB=A153161/A153162. [From Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Dec 22 2008]

MAPLE

a:=array[0..10001]; M:=5000; for n from 0 to M do a[2*n]:=n; a[2*n+1]:=a[n]; od: for n from 0 to 2*M do lprint(n, a[n]); od:

MATHEMATICA

a[n_] := a[n] = If[OddQ@n, a[(n - 1)/2], n/2]; Table[ a[n], {n, 0, 83}] (from Robert G. Wilson v (rgwv(at)rgwv.com), Mar 30 2006)

PROG

(PARI) A025480(n)={while(n%2, n\=2); n\2} - M. F. Hasler (www.univ-ag.fr/~mhasler), May 03 2008

Contribution from Cale Gibbard (cgibbard(AT)gmail.com), Nov 18 2009: (Start)

(Other) Haskell:

import Data.List

interleave xs ys = concat . transpose $ [xs, ys]

a025480 = interleave [0..] a025480 (End)

CROSSREFS

The Y-projection of A075300.

a(n) = A003602(n)-1.

Cf. A108202.

Cf. A138002.

Sequence in context: A081171 A062778 A108202 * A088002 A030109 A058208

Adjacent sequences:  A025477 A025478 A025479 * A025481 A025482 A025483

KEYWORD

easy,nonn,nice,tabf

AUTHOR

David W. Wilson (davidwwilson(AT)comcast.net)

EXTENSIONS

Additional comments from Henry Bottomley (se16(AT)btinternet.com), Mar 02 2000

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 15 21:56 EST 2012. Contains 205860 sequences.