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

A247380 First differences of A117495.

Original entry on oeis.org

3, 7, 11, 23, 21, 37, 31, 51, 77, 49, 97, 85, 67, 99, 137, 149, 93, 169, 143, 111, 199, 167, 221, 281, 197, 153, 211, 163, 225, 533, 251, 323, 203, 479, 219, 367, 379, 315, 401, 413, 261, 601, 277, 369, 287, 751, 775, 415, 325, 429, 539, 343, 771, 575, 587, 599
Offset: 1

Views

Author

Odimar Fabeny, Sep 15 2014

Keywords

Crossrefs

Programs

  • Maple
    with(numtheory):
    a:= n-> ithprime(n+1)*n-ithprime(n)*(n-1):
    seq(a(n), n=1..60);  # Alois P. Heinz, Sep 15 2014
  • PARI
    a(n)=my(p=prime(n++)); p+n*(nextprime(p+1)-p) \\ Charles R Greathouse IV, Sep 15 2014

Formula

a(n) = A117495(n+1) - A117495(n).

Extensions

More terms from Alois P. Heinz, Sep 15 2014

A036689 Product of a prime and the previous number.

Original entry on oeis.org

2, 6, 20, 42, 110, 156, 272, 342, 506, 812, 930, 1332, 1640, 1806, 2162, 2756, 3422, 3660, 4422, 4970, 5256, 6162, 6806, 7832, 9312, 10100, 10506, 11342, 11772, 12656, 16002, 17030, 18632, 19182, 22052, 22650, 24492, 26406, 27722, 29756, 31862, 32580, 36290, 37056, 38612, 39402, 44310
Offset: 1

Views

Author

Keywords

Comments

Records in A002618. - Artur Jasinski, Jan 23 2008
Also records in A174857. - Vladimir Shevelev, Mar 31 2010

Examples

			2*1, 3*2, 5*4, 7*6, 11*10, 13*12, 17*16, ...
		

Crossrefs

Twice the terms of A008837.
Subsequence of A002378 (oblong numbers).
Column 1 of A257251. (Row 1 of A257252.)
Column 2 of A379010.

Programs

Formula

a(n) = prime(n) * (prime(n) - 1).
a(n) = phi(prime(n)^2) = A000010(A001248(n)).
a(n) = prime(n) * phi(prime(n)). - Artur Jasinski, Jan 23 2008
From Reinhard Zumkeller, Sep 17 2011: (Start)
a(n) = A000040(n) * A006093(n) = A001248(n) - A000040(n).
A006530(a(n)) = A000040(n). (End)
a(n) = A009262(prime(n)). - Enrique Pérez Herrero, May 12 2012
a(n) = prime(n)! mod (prime(n)^2). - J. M. Bergot, Apr 10 2014
a(n) = 2*A008837(n). - Antti Karttunen, May 01 2015
Sum_{n>=1} 1/a(n) = A136141. - Amiram Eldar, Nov 09 2020
From Amiram Eldar, Jan 23 2021: (Start)
Product_{n>=1} (1 + 1/a(n)) = zeta(2)*zeta(3)/zeta(6) (A082695).
Product_{n>=1} (1 - 1/a(n)) = A005596. (End)

Extensions

Deleted two incorrect comments. - N. J. A. Sloane, May 07 2020

A152535 a(n) = n*prime(n) - Sum_{i=1..n} prime(i).

Original entry on oeis.org

0, 1, 5, 11, 27, 37, 61, 75, 107, 161, 181, 247, 295, 321, 377, 467, 563, 597, 705, 781, 821, 947, 1035, 1173, 1365, 1465, 1517, 1625, 1681, 1797, 2217, 2341, 2533, 2599, 2939, 3009, 3225, 3447, 3599, 3833, 4073, 4155, 4575, 4661
Offset: 1

Views

Author

Omar E. Pol, Dec 06 2008

Keywords

Comments

a(n) is also the area under the curve of the function pi(x) from 0 to prime(n). - Omar E. Pol, Nov 13 2013

Examples

			From _Omar E. Pol_, Apr 27 2015: (Start)
For n = 5 the 5th prime is 11 and the sum of first five primes is 2 + 3 + 5 + 7 + 11 = 28, so a(5) = 5*11 - 28 = 27.
Illustration of a(5) = 27:
Consider a diagram in the first quadrant of the square grid in which the number of cells in the n-th horizontal bar is equal to the n-th prime, as shown below:
.      _ _ _ _ _ _ _ _ _ _ _
. 11  |_ _ _ _ _ _ _ _ _ _ _|
.  7  |_ _ _ _ _ _ _|* * * *
.  5  |_ _ _ _ _|* * * * * *
.  3  |_ _ _|* * * * * * * *
.  2  |_ _|* * * * * * * * *
.
a(5) is also the area (or the number of cells, or the number of *'s) under the bar's structure of prime numbers: a(5) = 1 + 4 + 6 + 16 = 27.
(End)
		

Crossrefs

Programs

  • Mathematica
    nn = 100; p = Prime[Range[nn]]; Range[nn] p - Accumulate[p] (* T. D. Noe, May 02 2011 *)
  • PARI
    vector(80, n, n*prime(n) - sum(k=1, n, prime(k))) \\ Michel Marcus, Apr 20 2015
    
  • Python
    from sympy import prime, primerange
    def A152535(n): return (n-1)*(p:=prime(n))-sum(primerange(p)) # Chai Wah Wu, Jan 01 2024
  • Sage
    [n*nth_prime(n) - sum(nth_prime(j) for j in range(1,n+1)) for n in range(1,45)] # Danny Rorabaugh, Apr 18 2015
    

Formula

a(n) = A033286(n) - A007504(n). - Omar E. Pol, Aug 09 2012
a(n) = A046992(A006093(n)). - Omar E. Pol, Apr 21 2015
a(n+1) = Sum_{k=A000124(n-1)..A000217(n)} A204890(k). - Benedict W. J. Irwin, May 23 2016
a(n) = Sum_{k=1..n-1} k*A001223(k). - François Huppé, Mar 16 2022

A340649 a(n) = (n*prime(n+1)) mod prime(n).

Original entry on oeis.org

1, 1, 1, 2, 10, 11, 14, 13, 8, 20, 4, 11, 26, 13, 43, 43, 34, 47, 9, 40, 53, 9, 55, 14, 3, 52, 5, 56, 7, 81, 124, 61, 66, 62, 70, 65, 65, 152, 67, 67, 82, 58, 86, 176, 90, 154, 142, 192, 98, 200, 73, 104, 48, 73, 73, 73, 114, 77, 236, 120, 44, 282, 252, 128
Offset: 1

Views

Author

Simon Strandgaard, Jan 14 2021

Keywords

Examples

			a(1) = (prime(1+1) * 1) mod prime(1) =  3 * 1 mod  2 = 1,
a(2) = (prime(2+1) * 2) mod prime(2) =  5 * 2 mod  3 = 1,
a(3) = (prime(3+1) * 3) mod prime(3) =  7 * 3 mod  5 = 1,
a(4) = (prime(4+1) * 4) mod prime(4) = 11 * 4 mod  7 = 2,
a(5) = (prime(5+1) * 5) mod prime(5) = 13 * 5 mod 11 = 10.
		

Crossrefs

Programs

  • Magma
    [ (n*NthPrime(n+1)) mod NthPrime(n) : n in [1..60]]; // Wesley Ivan Hurt, Apr 23 2021
  • Mathematica
    Table[Mod[Prime[n + 1]*n, Prime[n]],{n, 1, 64}] (* Robert P. P. McKone, Jan 15 2021 *)
  • PARI
    a(n) = prime(n+1)*n % prime(n); \\ Michel Marcus, Jan 15 2021
    
  • Ruby
    require 'prime'
    values = []
    primes = Prime.first(20)
    primes.each_index do |n|
        next if n < 1
        values << (primes[n] * n) % primes[n-1]
    end
    p values
    

Formula

a(n) = A117495(n+1) mod prime(n). - Michel Marcus, Jan 15 2021
Showing 1-4 of 4 results.