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

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A005940 The Doudna sequence: write n-1 in binary; power of p_k in a(n) is # of 1's that are followed by k-1 0's.
(Formerly M0509)
5
1, 2, 3, 4, 5, 6, 9, 8, 7, 10, 15, 12, 25, 18, 27, 16, 11, 14, 21, 20, 35, 30, 45, 24, 49, 50, 75, 36, 125, 54, 81, 32, 13, 22, 33, 28, 55, 42, 63, 40, 77, 70, 105, 60, 175, 90, 135, 48, 121, 98, 147, 100, 245, 150, 225, 72, 343, 250, 375, 108, 625, 162, 243, 64, 17, 26, 39 (list; graph; refs; listen; history; internal format)
OFFSET

1,2

COMMENTS

A permutation of the natural numbers. - Robert G. Wilson v (rgwv(AT)rgwv.com), Feb 22 2005

Fixed points: A029747. - Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Aug 23 2006

REFERENCES

R. E. Kutz, Two unusual sequences, Two-Year College Mathematics Journal, 12 (1981), 316-319.

N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

LINKS

R. Zumkeller, Table = of n, a(n) for n = 1..1024

Index entries for sequences that are permutations of the natural numbers

FORMULA

a(n) = f(n-1, 1, 1) with f(n, i, x) = if n=0 then x = else (if n mod 2 = 0 then f(n/2, i+1, x) else f((n-1)/2, i, x*prime(i))). - Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Aug 23 2006, R. J. Mathar, Mar 06 2010

MAPLE

f := proc(n, i, x) option remember ; if n = 0 then x; elif type(n, 'even') then procname(n/2, i+1, x) ; else procname((n-1)/2, i, x*ithprime(i)) ; end if; end proc:

A005940 := proc(n) f(n-1, 1, 1) ; end proc: # R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Mar 06 2010

MATHEMATICA

f[n_] := Block[{p = Partition[ Split[ Join[ IntegerDigits[n - 1, 2], {2}]], 2]}, Times @@ Flatten[ Table[q = Take[p, -i]; Prime[ Count[ Flatten[q], 0] + 1]^q[[1, 1]], {i, Length[p]}] ]]; Table[ f[n], {n, 67}] (from Robert G. Wilson v Feb 22 2005)

PROG

(PARI) A005940(n) = { my(p=2, t=1); n--; until(!n\=2, n%2 & (t*=p) | p=nextprime(p+1)); t } [From M. F. Hasler (www.univ-ag.fr/~mhasler), Mar 07 2010]

CROSSREFS

Cf. A103969. Inverse is A005941.

Cf. A125106. [From Franklin T. Adams-Watters (FrankTAW(AT)Netscape.net), Mar 06 2010]

Sequence in context: A099004 A055170 A068384 * A005941 A075164 A023841

Adjacent sequences:  A005937 A005938 A005939 * A005941 A005942 A005943

KEYWORD

nonn,easy,nice

AUTHOR

N. J. A. Sloane (njas(AT)research.att.com) and J. H. Conway (conway(AT)math.princeton.edu)

EXTENSIONS

More terms from Robert G. Wilson v (rgwv(AT)rgwv.com), Feb 22 2005

Sign in a formula switched and Maple program added - R. J. Mathar (mathar(AT)strw.leidenuniv.nl), Mar 06 2010

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 17 21:13 EST 2012. Contains 206085 sequences.