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

A095116 a(n) = prime(n) + n - 1.

Original entry on oeis.org

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

Views

Author

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

Keywords

Comments

Positions of second occurrences of n in A165634: A165634(a(n)) = n. [Reinhard Zumkeller, Sep 23 2009]
a(n) = b(n)-th highest positive integer not equal to any a(k), 1 <= k <= n-1, where b(n) = primes = A000040(n). a(1) = 2, a(n) = a(n-1) + A000040(n) - A000040(n-1) + 1 for n >= 2. a(1) = 2, a(n) = a(n-1) + A001223(n-1) + 1 for n >= 2. a(n) = A014688(n) - 1. [Jaroslav Krizek, Oct 28 2009]
Comment from N. J. A. Sloane, Mar 28 2024 (Start):
On March 23 2024, Davide Rotondo sent me an email with the following conjecture. (I've simplified it a bit.)
For a positive integer n, define a sequence b by b(0) = n; b(i) = n - pi(b(i-1)) for i >= 1, where pi(x) = number of primes <= x.
The conjecture is that after some initial terms, b becomes periodic with period length 1 or 2, and the n for which the period is 2 are 3 together with the present sequence, that is, 2, 3, 4, 7, 10, 15, 18, 23, 26, 31, 38, 41, 48, ... (End)
Proof from Robert Israel, Mar 26 2024 (Start):
This is simply a consequence of the fact that if x < y, 0 <= pi(y) - pi(x) <= y - x and the inequality on the right is strict if y-x > 1 except for the case of 1 and 3.
Thus we start with b(0) - b(1) = pi(n). While |b(i) - b(i+1)| > 2 we get |b(i+1) - b(i+2)| = |pi(b(i+1)) - pi(b(i+2))| < |b(i) - b(i+1)|.
Eventually we must either reach |b(j+1) - b(j)| = 0 or |b(j+1) - b(j)| = 1.
If we reach 0, i.e. b(j+1) = b(j), then clearly b(k) = b(j) for all k > j.
If b(j+1) = b(j) + 1 = n - pi(b(j)), then b(j+2) = n - pi(b(j)+1) = b(j+1) or b(j+1)-1.
If b(j+1) = b(j) - 1, then b(j+2) = n - pi(b(j)-1) = b(j+1) or b(j+1)+1.
Thus from this point on we either get a 2-cycle or a 1-cycle. (End)

Crossrefs

Complement of A095117.
Essentially the same sequence as A014690.

Programs

Formula

a(n) = A014690(n-1), n > 1. [R. J. Mathar, Sep 05 2008]

A135681 a(n)=n if n=1 or if n=prime. Otherwise, n=4 if n is even and n=1 if n is odd.

Original entry on oeis.org

1, 2, 3, 4, 5, 4, 7, 4, 1, 4, 11, 4, 13, 4, 1, 4, 17, 4, 19, 4, 1, 4, 23, 4, 1, 4, 1, 4, 29, 4, 31, 4, 1, 4, 1, 4, 37, 4, 1, 4, 41, 4, 43, 4, 1, 4, 47, 4, 1, 4, 1, 4, 53, 4, 1, 4, 1, 4, 59, 4, 61, 4, 1, 4, 1, 4, 67, 4, 1, 4, 71, 4, 73
Offset: 1

Views

Author

Mohammad K. Azarian, Dec 01 2007

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := If[PrimeQ[n] || n == 1, n, If[EvenQ[n], 4, 1] ]; Table[a[n], {n,1,25}] (* G. C. Greubel, Oct 26 2016 *)

A135682 a(n)=n if n=1 or if n=prime. Otherwise, n=4 if n is even and n=7 if n is odd.

Original entry on oeis.org

1, 2, 3, 4, 5, 4, 7, 4, 7, 4, 11, 4, 13, 4, 7, 4, 17, 4, 19, 4, 7, 4, 23, 4, 7, 4, 7, 4, 29, 4, 31, 4, 7, 4, 7, 4, 37, 4, 7, 4, 41, 4, 43, 4, 7, 4, 47, 4, 7, 4, 7, 4, 53, 4, 7, 4, 7, 4, 59, 4, 61, 4, 7, 4, 7, 4, 67, 4, 7, 4, 71, 4, 73
Offset: 1

Views

Author

Mohammad K. Azarian, Dec 01 2007

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := If[PrimeQ[n] || n == 1, n, If[EvenQ[n], 4, 7] ]; Table[a[n], {n,1,25}] (* G. C. Greubel, Oct 26 2016 *)

A135684 a(n)=11 if n is a prime number. Otherwise, a(n)=n.

Original entry on oeis.org

1, 11, 11, 4, 11, 6, 11, 8, 9, 10, 11, 12, 11, 14, 15, 16, 11, 18, 11, 20, 21, 22, 11, 24, 25, 26, 27, 28, 11, 30, 11, 32, 33, 34, 35, 36, 11, 38, 39, 40, 11, 42, 11, 44, 45, 46, 11, 48, 49, 50, 51, 52, 11, 54, 55, 56, 57, 58, 11
Offset: 1

Views

Author

Mohammad K. Azarian, Dec 01 2007

Keywords

Crossrefs

Programs

  • Magma
    [IsPrime(n) select 11 else n: n in [1..70]]; // Vincenzo Librandi, Feb 22 2013
  • Mathematica
    Table[If[PrimeQ[n], 11, n], {n, 70}] (* Vincenzo Librandi, Feb 22 2013 *)

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)
Showing 1-6 of 6 results.