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.

Showing 1-3 of 3 results.

A066253 a(n) = A066249(A066249(n)).

Original entry on oeis.org

5, 3, 7, 1, 8, 2, 6, 4, 9, 10, 11, 12, 13, 18, 16, 22, 14, 30, 15, 42, 17, 46, 28, 60, 19, 70, 20, 72, 36, 82, 21, 100, 40, 108, 23, 112, 24, 136, 25, 148, 52, 150, 26, 166, 58, 178, 27, 192, 29, 222, 66, 228, 31, 232, 32, 240, 33, 250, 78, 262, 34, 306, 35, 312, 88, 336
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 09 2001

Keywords

Comments

Permutation of natural numbers.

Crossrefs

Cf. A066249.

Programs

  • Mathematica
    seq[nmax_] := Module[{p = Prime[Range[nmax]], s}, s = Riffle[Take[Complement[Range[2, p[[-1]]], p] - 1, Length[p]], p - 1]; s[[TakeWhile[s, # <= Length[s] &]]]]; seq[100] (* Amiram Eldar, Mar 19 2025 *)

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).

A129131 Alternately write composite and prime numbers.

Original entry on oeis.org

4, 2, 6, 3, 8, 5, 9, 7, 10, 11, 12, 13, 14, 17, 15, 19, 16, 23, 18, 29, 20, 31, 21, 37, 22, 41, 24, 43, 25, 47, 26, 53, 27, 59, 28, 61, 30, 67, 32, 71, 33, 73, 34, 79, 35, 83, 36, 89, 38, 97, 39, 101, 40, 103, 42, 107, 44, 109, 45, 113, 46, 127, 48, 131, 49, 137, 50, 139, 51
Offset: 1

Views

Author

Edwin F. Sampang, Mar 30 2007

Keywords

Comments

a(2n-1) = A073846(2n+1), a(2n) = A073846(2n).

Examples

			Lowest composite number is 4, lowest prime number is 2, next composite number after 4 is 6, next prime number after 2 is 3 and so on.
		

Crossrefs

Cf. A000040 (prime numbers), A002808 (composite numbers), A073846 (alternate nonprime and prime numbers).

Programs

  • Magma
    P:=[ n : n in [2..150] | IsPrime(n) ]; C:=[ n : n in [2..70] | not IsPrime(n) ]; &cat[ [C[k], P[k] ]: k in [1..Minimum(#C, #P)] ]; // Klaus Brockhaus, Mar 31 2007
  • Mathematica
    f[n_]:=Module[{prs=Prime[Range[n]],comps},comps=Rest[Complement[Range[n+ Length[prs]+1], prs]];Riffle[comps,prs]] (* Harvey P. Dale, May 10 2011 *)

Formula

a(n) = A066249(n) + 1. - Filip Zaludek, Dec 10 2016

Extensions

Edited and extended by Klaus Brockhaus, Mar 31 2007
Showing 1-3 of 3 results.