The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A143692 Permutation of natural numbers: If n is k-th number with an odd number of prime divisors (counted with multiplicity) [i.e., n = A026424(k)], a(n) = 2*k, otherwise, when n is k-th number with an even number of prime divisors [i.e., n = A028260(k)], a(n) = (2*k)-1. 4
1, 2, 4, 3, 6, 5, 8, 10, 7, 9, 12, 14, 16, 11, 13, 15, 18, 20, 22, 24, 17, 19, 26, 21, 23, 25, 28, 30, 32, 34, 36, 38, 27, 29, 31, 33, 40, 35, 37, 39, 42, 44, 46, 48, 50, 41, 52, 54, 43, 56, 45, 58, 60, 47, 49, 51, 53, 55, 62, 57, 64, 59, 66, 61, 63, 68, 70, 72, 65, 74, 76, 78 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
a(a(n)) = A143694(n).
LINKS
FORMULA
From Antti Karttunen, Jul 27 2014: (Start)
If A066829(n) = 1, then a(n) = 2 * A055038(n), otherwise a(n) = (2 * A055037(n)) - 1.
For all n >= 1, A000035(a(n)) = 1 - A066829(n). [Permutation A245603 has the same property].
(End)
MAPLE
N:= 1000: # to get a(1) to a(N)
Odds, Evens:= selectremove(t -> numtheory:-bigomega(t)::odd, [$1..N]):
for k from 1 to nops(Odds) do A[Odds[k]]:= 2*k od:
for k from 1 to nops(Evens) do A[Evens[k]]:= 2*k-1 od:
seq(A[k], k=1..N); # Robert Israel, Jul 27 2014
MATHEMATICA
m = 100;
odds = Select[Range[m], OddQ[PrimeOmega[#]]&];
evens = Select[Range[m], EvenQ[PrimeOmega[#]]&];
Do[a[odds[[k]]] = 2k, {k, 1, Length[odds]}];
Do[a[evens[[k]]] = 2k-1, {k, 1, Length[evens]}];
Array[a, m] (* Jean-François Alcover, Mar 09 2019, from Maple *)
PROG
(MIT/GNU Scheme) (define (A143692 n) (if (= 1 (A066829 n)) (* 2 (A055038 n)) (-1+ (* 2 (A055037 n)))))
(Haskell)
import Data.List (elemIndex); import Data.Maybe (fromJust)
a243692 = (+ 1) . fromJust . (`elemIndex` a143691_list)
-- Reinhard Zumkeller, Aug 07 2014
CROSSREFS
Inverse: A143691.
Sequence in context: A289726 A308598 A343012 * A337116 A338618 A114792
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Aug 29 2008
EXTENSIONS
Name changed by Antti Karttunen, Jul 27 2014
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 May 29 05:33 EDT 2024. Contains 372921 sequences. (Running on oeis4.)