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.

A282028 If n is prime then a(n) = 2n, otherwise a(n) is the smallest missing number.

Original entry on oeis.org

0, 1, 4, 6, 2, 10, 3, 14, 5, 7, 8, 22, 9, 26, 11, 12, 13, 34, 15, 38, 16, 17, 18, 46, 19, 20, 21, 23, 24, 58, 25, 62, 27, 28, 29, 30, 31, 74, 32, 33, 35, 82, 36, 86, 37, 39, 40, 94, 41, 42, 43, 44, 45, 106, 47, 48, 49, 50, 51, 118, 52, 122, 53, 54, 55, 56, 57, 134, 59, 60, 61, 142, 63, 146, 64, 65
Offset: 0

Views

Author

N. J. A. Sloane, Feb 16 2017

Keywords

Crossrefs

Programs

  • PARI
    first(n) = { my(res = vector(n), i = 1); for(x=1, n-1, if(isprime(x), res[x+1] = 2*x, if(setsearch(Set(res), i), i++); res[x+1]=i; i++)); res; } \\ Iain Fox, Nov 18 2017

Formula

If n is prime, a(n) = 2n, and these points line on the upper straight line in the graph.
If n is not a prime, after n terms we have seen all the numbers from 0 through a(n) and also the doubles of all the primes p in the range a(n)/2 < p < n.
So n = a(n) + pi(n) - pi(a(n)/2). In other words, if n is not a prime then a(n) is the unique solution to a(n) - pi(a(n)/2) = n - pi(n).
This implies that if n is not a prime, a(n) = n*(1 - 1/(2*log(n)) + o(1/log(n))).
These are the points on the lower line, which is not straight but has slope roughly equal to 1.

A143544 Triangle read by rows, T(n,k) = 2 if n is prime, 1 otherwise; 1<=k<=n.

Original entry on oeis.org

1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
Offset: 1

Views

Author

Gary W. Adamson, Aug 23 2008

Keywords

Comments

Row sums = A143545: (1, 4, 6, 4, 10, 6, 14,...) = componentwise addition of (1, 2, 3, 4, 5,...) and A061397: (0, 2, 3, 0, 5, 0, 7,...).

Examples

			First few rows of the triangle =
1;
2, 2;
2, 2, 2;
1, 1, 1, 1;
2, 2, 2, 2, 2;
1, 1, 1, 1, 1, 1;
2, 2, 2, 2, 2, 2, 2;
...
		

Crossrefs

Programs

  • Mathematica
    Table[1 + Boole[PrimeQ[n]], {n, 11}, {k, n}] // Flatten (* Michael De Vlieger, Oct 31 2021 *)

Formula

Triangle read by rows, T(n,k) = 2 if n is prime, 1 otherwise; 1<=k<=n.
T(n, k) = A143536(n, k) + 1. - Georg Fischer, Oct 31 2021

A282462 Integers but with the primes cubed.

Original entry on oeis.org

0, 1, 8, 27, 4, 125, 6, 343, 8, 9, 10, 1331, 12, 2197, 14, 15, 16, 4913, 18, 6859, 20, 21, 22, 12167, 24, 25, 26, 27, 28, 24389, 30, 29791, 32, 33, 34, 35, 36, 50653, 38, 39, 40, 68921, 42, 79507, 44, 45, 46, 103823, 48, 49, 50, 51, 52, 148877, 54, 55, 56
Offset: 0

Views

Author

Vincenzo Librandi, Feb 17 2017

Keywords

Examples

			a(4) = 4 because 4 is composite.
a(5) = 125 because 5 is prime and 5^3 = 125.
		

Crossrefs

Programs

  • Magma
    [0] cat [IsPrime(n) select n^3 else n: n in [1..60]];
  • Mathematica
    Join[{0},If[PrimeQ@#,#^3,#]&/@Range@80]
Showing 1-3 of 3 results.