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-8 of 8 results.

A143350 Triangle read by rows, replace column 1 of triangle A143349 with A095116, 1<=k<=n.

Original entry on oeis.org

2, 4, -1, 7, -1, -1, 10, -2, -1, 0, 15, -2, -1, 0, -1, 18, -3, -2, 0, -1, 1, 23, -3, -2, 0, -1, 1, -1, 26, -4, -2, 0, -1, 1, -1, 0, 31, -4, -3, 0, -1, 1, -1, 0, 0, 38, -5, -3, 0, -2, 1, -1, 0, 0, 1, 41, -5, -3, 0, -2, 1, -1, 0, 0, 1, -1, 48, -6, -4, 0, -2, 2, -1, 0, 0, 1, -1, 0, 53, -6, -4, 0, -2, 2, -1, 0, 0, 1, -1, 0, -1, 56, -7, -4, 0, -2, 2, -2, 0, 0
Offset: 1

Views

Author

Gary W. Adamson, Aug 10 2008

Keywords

Comments

Triangle A143349 = a type of Mobius transform which converts sequences to triangles with row sums = the same sequence. In this case, we convert p(n) to triangle A143349 having row sums = p(n), the primes.
We begin with p(n), adding (n-1) = A095116: (2, 4, 7, 10, 15, 18, 23,...). We then replace column 1 of triangle A143349 with A095116 resulting in A143350 with row sums = p(n).

Examples

			First few rows of the triangle =
2;
4, -1;
7, -1, -1;
10, -2, -1, 0;
15, -2, -1, 0, -1;
18, -3, -2, 0, -1, 1;
23, -3, -2, 0, -1, 1, -1;
26, -4, -2, 0, -1, 1, -1, 0;
31, -4, -3, 0, -1, 1, -1, 0, 0;
38, -5, -3, 0, -2, 1, -1, 0, 0, 1;
...
		

Crossrefs

Formula

Triangle read by rows, replace column 1 of triangle A143349 with A095116, 1<=k<=n. A143349 = p(n)+(n-1) & A143349 = a type of Mobius transform.

A095117 a(n) = pi(n) + n, where pi(n) = A000720(n) is the number of primes <= n.

Original entry on oeis.org

0, 1, 3, 5, 6, 8, 9, 11, 12, 13, 14, 16, 17, 19, 20, 21, 22, 24, 25, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 39, 40, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 54, 55, 57, 58, 59, 60, 62, 63, 64, 65, 66, 67, 69, 70, 71, 72, 73, 74, 76, 77, 79, 80, 81, 82, 83, 84, 86, 87, 88, 89, 91
Offset: 0

Views

Author

Dean Hickerson, following a suggestion of Leroy Quet, May 28 2004

Keywords

Comments

Positions of first occurrences of n in A165634: A165634(a(n))=n for n>0. - Reinhard Zumkeller, Sep 23 2009
There exists at least one prime number p such that n < p <= a(n) for n >= 2. For example, 2 is in (2, 3], 5 in (3, 5], 5 in (4, 6], ..., and primes 73, 79, 83 and 89 are in (71, 91] (see Corollary 1 in the paper by Ya-Ping Lu attached in the links section). - Ya-Ping Lu, Feb 21 2021

Crossrefs

Complement of A095116.

Programs

  • Haskell
    a095117 n = a000720 n + toInteger n  -- Reinhard Zumkeller, Apr 17 2012
    
  • Maple
    with(numtheory): seq(n+pi(n),n=1..90); # Emeric Deutsch, May 02 2007
  • Mathematica
    Table[ PrimePi@n + n, {n, 0, 71}] (* Robert G. Wilson v, Apr 22 2007 *)
  • PARI
    a(n) = n + primepi(n); \\ Michel Marcus, Feb 21 2021
    
  • Python
    from sympy import primepi
    def a(n): return primepi(n) + n
    print([a(n) for n in range(72)]) # Michael S. Branicky, Feb 21 2021

Formula

a(0) = 0; for n>0, a(n) = a(n-1) + (if n is prime then 2, else 1). - Robert G. Wilson v, Apr 22 2007; corrected by David James Sycamore, Aug 16 2018

Extensions

Edited by N. J. A. Sloane, Jul 02 2008 at the suggestion of R. J. Mathar

A014690 a(n) = n + prime(n+1).

Original entry on oeis.org

4, 7, 10, 15, 18, 23, 26, 31, 38, 41, 48, 53, 56, 61, 68, 75, 78, 85, 90, 93, 100, 105, 112, 121, 126, 129, 134, 137, 142, 157, 162, 169, 172, 183, 186, 193, 200, 205, 212, 219, 222, 233, 236, 241, 244, 257, 270, 275, 278, 283, 290, 293, 304, 311, 318, 325, 328
Offset: 1

Views

Author

Keywords

Comments

In sequence of odd primes add 1 to first prime, add 2 to 2nd prime, add 3 to 3rd prime and so on.

Crossrefs

Essentially the same sequence as A095116.

Programs

  • Mathematica
    a[n_]:=Prime[n+1]+n (* Zak Seidov, May 05 2005 *)
    With[{nn=60},Prime[Range[2,nn+1]]+Range[nn]] (* Harvey P. Dale, Oct 02 2015 *)

Extensions

More terms from Erich Friedman

A165634 Start with x=1 and repeat: if x is a prime number then (append i and then x, with x=prime(i)) else (only append x), continue with x:=x+1.

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 3, 5, 6, 4, 7, 8, 9, 10, 5, 11, 12, 6, 13, 14, 15, 16, 7, 17, 18, 8, 19, 20, 21, 22, 9, 23, 24, 25, 26, 27, 28, 10, 29, 30, 11, 31, 32, 33, 34, 35, 36, 12, 37, 38, 39, 40, 13, 41, 42, 14, 43, 44, 45, 46, 15, 47, 48, 49, 50, 51, 52, 16, 53, 54, 55, 56, 57, 58, 17, 59
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 23 2009

Keywords

Comments

All positive integers occur exactly twice: A095117 and A095116 give positions of first and second occurrences.

Examples

			1,(1,2),(2,3),4,(3,5),6,(4,7),8,9,10,(5,11),12, ... .
		

Crossrefs

Programs

  • Haskell
    a165634 n = a165634_list !! (fromInteger n - 1)
    a165634_list = concatMap (\x ->
       if a010051 x == 1 then [a049084 x, x] else [x]) [1..]
    -- Reinhard Zumkeller, Apr 17 2012

A340716 Lexicographically earliest sequence of positive integers with as many distinct values as possible such that for any n > 0, a(n + pi(n)) = a(n) (where pi(n) = A000720(n) corresponds to the number of prime numbers <= n).

Original entry on oeis.org

1, 2, 2, 3, 2, 3, 4, 2, 3, 5, 4, 2, 3, 5, 6, 4, 2, 7, 3, 5, 6, 4, 8, 2, 7, 9, 3, 5, 6, 4, 10, 8, 2, 7, 9, 3, 5, 11, 6, 4, 12, 10, 8, 2, 7, 9, 3, 13, 5, 11, 6, 4, 14, 12, 10, 15, 8, 2, 7, 9, 16, 3, 13, 5, 11, 6, 4, 17, 14, 12, 10, 15, 8, 2, 18, 7, 9, 19, 16, 3
Offset: 1

Views

Author

Rémy Sigrist, Jan 17 2021

Keywords

Comments

The condition "with as many distinct values as possible" means here that for any distinct m and n, provided the orbits of m and n under the map x -> x + pi(x) do not merge, then a(m) <> a(n).
This sequence has similarities with A003602 (A003602(2*n) = A003602(n)) and with A163491 (A163491(n+ceiling(n/2)) = A163491(n)).

Examples

			The first terms, alongside n + pi(n), are:
  n   a(n)  n + pi(n)
  --  ----  ---------
   1     1          1
   2     2          3
   3     2          5
   4     3          6
   5     2          8
   6     3          9
   7     4         11
   8     2         12
   9     3         13
  10     5         14
  11     4         16
  12     2         17
		

Crossrefs

See A003602, A163491 and A340717 for similar sequences.

Programs

  • PARI
    u=0; for (n=1, #a=vector(80), if (a[n]==0, a[n]=u++); print1 (a[n]", "); m=n+primepi(n); if (m<=#a, a[m]=a[n]))

Formula

a(n) = 2 iff n belongs to A061535.
a(A095116(n)) = n + 1.

A123128 Add n to the n-th difference between consecutive primes.

Original entry on oeis.org

2, 4, 5, 8, 7, 10, 9, 12, 15, 12, 17, 16, 15, 18, 21, 22, 19, 24, 23, 22, 27, 26, 29, 32, 29, 28, 31, 30, 33, 44, 35, 38, 35, 44, 37, 42, 43, 42, 45, 46, 43, 52, 45, 48, 47, 58, 59, 52, 51, 54, 57, 54, 63, 60, 61, 62, 59, 64, 63, 62, 71, 76, 67, 66, 69, 80, 73, 78, 71, 74, 77
Offset: 1

Views

Author

Herman Jamke (hermanjamke(AT)fastmail.fm), Sep 30 2006

Keywords

Crossrefs

Programs

  • Magma
    [n + NthPrime(n+1) - NthPrime(n): n in [1..80]]; // G. C. Greubel, Aug 03 2021
    
  • Mathematica
    With[{nn=80},Total/@Thread[{Differences[Prime[Range[nn]]],Range[nn-1]}]] (* Harvey P. Dale, Jun 02 2014 *)
  • PARI
    for(n=1,100,print1(prime(n+1)-prime(n)+n,","))
    
  • Sage
    [n + nth_prime(n+1) - nth_prime(n) for n in (1..80)] # G. C. Greubel, Aug 03 2021

Formula

a(n) = n + (prime(n+1) - prime(n)) = n + A001223(n).
From G. C. Greubel, Aug 03 2021: (Start)
a(n) = A014690(n) - prime(n) = A095116(n+1) - prime(n).
a(n) = prime(n+1) - A014689(n). (End)

A123129 a(n) = ( n + prime(n+1) - prime(n) )^(n-1).

Original entry on oeis.org

1, 4, 25, 512, 2401, 100000, 531441, 35831808, 2562890625, 5159780352, 2015993900449, 17592186044416, 129746337890625, 20822964865671168, 3243919932521508681, 136880068015412051968, 288441413567621167681
Offset: 1

Views

Author

Herman Jamke (hermanjamke(AT)fastmail.fm), Sep 30 2006

Keywords

Crossrefs

Programs

  • Mathematica
    Table[(n +Prime[n+1] -Prime[n])^(n-1), {n, 1, 30}] (* G. C. Greubel, Aug 04 2021 *)
  • PARI
    for(n=1, 25, print1( (prime(n+1) -prime(n) +n)^(n-1), ","))
    
  • Sage
    [(n + nth_prime(n+1) - nth_prime(n))^(n-1) for n in (1..30)] # G. C. Greubel, Aug 04 2021

Formula

a(n) = ( n + prime(n+1) - prime(n) )^(n-1) = ( n + A001223(n) )^(n-1).
From G. C. Greubel, Aug 04 2021: (Start)
a(n) = (A014690(n) - prime(n))^(n-1) = (A095116(n+1) - prime(n))^(n-1).
a(n) = (prime(n+1) - A014689(n))^(n-1). (End)

A230846 1 + A075526(n).

Original entry on oeis.org

2, 2, 3, 3, 5, 3, 5, 3, 5, 7, 3, 7, 5, 3, 5, 7, 7, 3, 7, 5, 3, 7, 5, 7, 9, 5, 3, 5, 3, 5, 15, 5, 7, 3, 11, 3, 7, 7, 5, 7, 7, 3, 11, 3, 5, 3, 13, 13, 5, 3, 5, 7, 3, 11, 7, 7, 7, 3, 7, 5, 3, 11, 15, 5, 3, 5, 15, 7, 11, 3, 5, 7, 9, 7, 7, 5, 7, 9, 5, 9, 11, 3, 11, 3, 7, 5, 7, 9, 5, 3, 5, 13, 9, 5, 9, 5, 7
Offset: 1

Views

Author

Omar E. Pol, Nov 01 2013

Keywords

Comments

Partial sums give A095116.

Examples

			On the first quadrant of the square grid consider a diagram in which the n-th horizontal bar contains A006093(n) cells and in which the number of cells in the vertical bars gives A000720 as shown below. a(n) is the sum of the length of the n-th horizontal boundary segment and the length of the n-th vertical boundary segment between the structure formed by the horizontal bars and the structure formed by the vertical bars, hence a(n) = A075526(n) + 1. The total length of the boundary segments from [0, 0] after n-th stage is A095116(n).
.    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
30  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
28  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | |
22  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | |
18  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | |
16  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | |
12  |_ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | | | | | |
10  |_ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | | | | | | | |
6   |_ _ _ _ _ _| | | | | | | | | | | | | | | | | | | | | | | | |
4   |_ _ _ _| | | | | | | | | | | | | | | | | | | | | | | | | | |
2   |_ _| | | | | | | | | | | | | | | | | | | | | | | | | | | | |
1   |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|
.
.    0 1 2 2 3 3 4 4 4 4 5 5 6 6 6 6 7 7 8 8 8 8 9 9 9 9 9 9 10 10
.
		

Crossrefs

Essentially the same as A076368.
Showing 1-8 of 8 results.