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.

A066248 a(n) = if n+1 is prime then A049084(n+1)*2 else A066246(n+1)*2 - 1.

Original entry on oeis.org

2, 4, 1, 6, 3, 8, 5, 7, 9, 10, 11, 12, 13, 15, 17, 14, 19, 16, 21, 23, 25, 18, 27, 29, 31, 33, 35, 20, 37, 22, 39, 41, 43, 45, 47, 24, 49, 51, 53, 26, 55, 28, 57, 59, 61, 30, 63, 65, 67, 69, 71, 32, 73, 75, 77, 79, 81, 34, 83, 36, 85, 87, 89, 91, 93, 38, 95, 97, 99, 40, 101, 42
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 09 2001

Keywords

Comments

Permutation of natural numbers; inverse: A066249.

Crossrefs

Programs

  • Mathematica
    a[n_] := If[PrimeQ[n+1], 2 * PrimePi[n+1], 2 * (n - PrimePi[n+1]) - 1]; Array[a, 100] (* Amiram Eldar, Mar 19 2025 *)

Formula

a(n) = A026238(n+1)*2 - A066247(n+1).