cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

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
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 29 2008

Keywords

Comments

a(a(n)) = A143694(n).

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a243692 = (+ 1) . fromJust . (`elemIndex` a143691_list)
    -- Reinhard Zumkeller, Aug 07 2014
  • 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 *)

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)

Extensions

Name changed by Antti Karttunen, Jul 27 2014