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

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A138607 List first A008578(1-1) odd numbers, then first A008578(2-1) even numbers, then the next A008578(3-1) odd numbers, then the next A008578(4-1) even numbers, etc. 3
1, 2, 4, 3, 5, 7, 6, 8, 10, 12, 14, 9, 11, 13, 15, 17, 19, 21, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73 (list; graph; refs; listen; history; internal format)
OFFSET

1,2

COMMENTS

The original name was "PrimCon sequence". However, this sequence has only a passing resemblance to Connell-like sequences (see A001614), which are all monotone, while this sequence is a bijection of natural numbers.

LINKS

Index entries for sequences that are permutations of the natural numbers

FORMULA

If n < 3, a(n) = n. If n-2 = A007504(A083375(n-2)), then a(n) = a(n-1-A000040(A083375(n-2)))+2, otherwise a(n) = a(n-1)+2. - Antti Karttunen, Oct 05 2009.

EXAMPLE

Let us separate natural numbers into odd (A005408) and even numbers (A005843):

1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,...

2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,...

The sequence is formed by concatenating subsequences S1, S2, S3, ..., each of finite length. The subsequence S1 consists of the element 1, after which the n-th subsequence has p(n-1) elements, where p(n) denotes n-th prime number, A000040(n). Each subsequence is nondecreasing and the difference between two consecutive elements in the same subsequence is 2.

thus we have

S1={1}

S2={2,4}

S3={3,5,7}

S4={6,8,10,12,14}

S5={9,11,13,15,17,19,21}

S6={16,18,20,22,24,26,28,30,32,34,36}

...

and concatenating them S1/S2/S3/S4/S5/S6/... gives this sequence.

PROG

(MIT Scheme:) (define (A138607 n) (if (< n 3) n (let ((k (A083375 (- n 2)))) (if (= (- n 2) (A007504 k)) (+ 2 (A138607 (- n 1 (A000040 k)))) (+ 2 (A138607 (-1+ n)))))))

CROSSREFS

Inverse: A166014. Cf. A138606-A138609, A138612.

Sequence in context: A074146 A143097 A074147 * A166014 A199779 A093506

Adjacent sequences:  A138604 A138605 A138606 * A138608 A138609 A138610

KEYWORD

nonn

AUTHOR

Ctibor O. Zizka (ctibor.zizka(AT)seznam.cz), May 14 2008

EXTENSIONS

Edited, extended, starting offset changed from 0 to 1, and Scheme-code added by Antti Karttunen (His-Firstname.His-Surname(AT)gmail.com), Oct 05 2009

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 10:05 EST 2012. Contains 206009 sequences.