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.

Previous Showing 31-40 of 57 results. Next

A087611 a(n) = (prime(n) - 1) mod n.

Original entry on oeis.org

0, 0, 1, 2, 0, 0, 2, 2, 4, 8, 8, 0, 1, 0, 1, 4, 7, 6, 9, 10, 9, 12, 13, 16, 21, 22, 21, 22, 21, 22, 2, 2, 4, 2, 8, 6, 8, 10, 10, 12, 14, 12, 18, 16, 16, 14, 22, 30, 30, 28, 28, 30, 28, 34, 36, 38, 40, 38, 40, 40, 38, 44, 54, 54, 52, 52, 62, 64, 1, 68, 68, 70, 1, 2, 3, 2, 3, 6, 5, 8
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 11 2003

Keywords

Crossrefs

Cf. A023143 (indices of 0's).

Programs

  • Magma
    [((NthPrime(n) -1) mod n): n in [1..100]]; // Vincenzo Librandi, Apr 06 2011
    
  • PARI
    a(n) = (prime(n)-1) % n; \\ Kevin Ryde, Feb 03 2023

A099851 Numbers k such that A099850(k) is divisible by k.

Original entry on oeis.org

1, 3, 16, 57, 112, 160, 272, 404, 20924, 147153, 274617, 4409708, 24881389, 34850872, 39808233, 186610952, 980830465, 1777956414
Offset: 1

Views

Author

Mark Hudson (mrmarkhudson(AT)hotmail.com), Oct 27 2004

Keywords

Examples

			A099850(1)=0, which is divisible by 1.
A099850(3)=3, which is divisible by 3.
A099850(16)=48, which is divisible by 16.
		

Crossrefs

Extensions

a(12)-a(18) from Donovan Johnson, Dec 14 2009

A245071 a(n) = 12n - prime(n).

Original entry on oeis.org

10, 21, 31, 41, 49, 59, 67, 77, 85, 91, 101, 107, 115, 125, 133, 139, 145, 155, 161, 169, 179, 185, 193, 199, 203, 211, 221, 229, 239, 247, 245, 253, 259, 269, 271, 281, 287, 293, 301, 307, 313, 323, 325, 335, 343, 353, 353, 353, 361, 371, 379, 385, 395, 397, 403, 409, 415, 425
Offset: 1

Views

Author

Freimut Marschner, Jul 21 2014

Keywords

Comments

Prime(n) > n for n > 0. Let prime(n) = k*n with k as an even integer constant, for example, k = 12; then a(n) = k*n - prime(n) is a sequence of odd integers that are positive as long as k*n > prime(n). This is the case up to a(40072) = 11. If k*n < prime(n) then a(n) < 0, a(40073) = -5 up to a(40083) = -5. From a(40084) = 5 up to a(40121) = 5, a(n) > 0 again, but a(n) < 0 for n >= 40122. For k = 12 the table shows this result compared with floor(prime(n)/n) and (prime(n) mod n) <= (prime(n+1) mod (n+1)) for n >= 1. Observations:
(1) If k > floor(prime(n)/n) then a(n) is positive.
(2) If k <= floor(prime(n)/n) and (prime(n) mod n) < (prime(n+1) mod (n+1)) and n > 1 then a(n) is negative.
(3) If k <= floor(prime(n)/n) and (prime(n) mod n) > (prime(n+1) mod (n+1)) then a(n) is positive.
.
n prime(n) floor(prime(n)/n) (prime(n) mod n) a(n)
40072 480853 12 5 11
40073 480881 12 23 -5
40083 481001 11 40079 -5
40084 481003 11 40074 5
40121 481447 12 5 5
40122 481469 12 13 -5

Examples

			a(3) = 12*3 - prime(3) = 36 - 5 = 31.
		

Crossrefs

A000040 (prime(n)), A038605 (floor(prime(n)/n)), A004648 (prime(n) mod n), A038606 (Least k such that k-th prime > n * k), A038607 (the smallest prime number k such that k > n*pi(k)), A102281 (the largest number m such that m = pi(n*m)).

Programs

  • Mathematica
    Table[12n - Prime[n], {n, 60}] (* Alonso del Arte, Jul 27 2014 *)
  • PARI
    vector(133, n, 12*n-prime(n) )

Formula

a(n) = 12*n - prime(n).

A360789 Least prime p such that p mod primepi(p) = n.

Original entry on oeis.org

2, 3, 5, 7, 379, 23, 401, 61, 59, 29, 67, 71, 467, 79, 83, 179, 431, 89, 176557, 191, 24419, 491, 97, 101, 499, 1213, 3169, 3191, 523, 229, 3187, 223, 3203, 8609, 3163, 251, 176509, 257, 24509, 263, 3253, 269, 547, 3347, 1304867, 293
Offset: 0

Views

Author

Robert G. Wilson v, Feb 20 2023

Keywords

Comments

Inspired by A048891.

Examples

			For n=0, prime p=2 has p mod primepi(p) = 2 mod 1 = 0 so that a(0) = 2.
For n=4, no prime has p mod primepi(p) = 4 until reaching p=379 which is 379 mod 75 = 4, so that a(4) = 379.
		

Crossrefs

Programs

  • Maple
    V:= Array(0..100): count:= 0:
    p:= 1:
    for k from 1 while count < 101 do
      p:= nextprime(p);
      v:= p mod k;
      if v <= 100 and V[v] = 0 then V[v]:= p; count:= count+1 fi;
    od:
    convert(V,list); # Robert Israel, Feb 28 2023
  • Mathematica
    t[_] := 0; p = 2; pi = 1; While[p < 1400000, m = Mod[p, pi]; If[m < 100 && t[m] == 0, t[m] = p]; p = NextPrime@p; pi++]; t /@ Range[0, 99]
  • PARI
    a(n)={my(k=n); forprime(p=prime(n+1), oo, k++; if(p%k ==n, return(p)))} \\ Andrew Howroyd, Feb 21 2023
    
  • Python
    from sympy import prime, nextprime
    def A360789(n):
        p, m = prime(n+1), n+1
        while p%m != n:
            p = nextprime(p)
            m += 1
        return p # Chai Wah Wu, Mar 18 2023

Formula

a(n) = prime(A073325(n+1)). - Kevin Ryde, Feb 21 2023

A363751 Numbers k such that prime(k) mod k is prime.

Original entry on oeis.org

3, 4, 7, 8, 9, 13, 15, 16, 18, 20, 22, 24, 26, 28, 30, 31, 32, 33, 34, 36, 38, 39, 40, 42, 43, 44, 45, 47, 48, 49, 50, 51, 52, 53, 55, 57, 59, 60, 65, 66, 69, 72, 73, 74, 76, 78, 82, 84, 86, 88, 90, 92, 96, 98, 100, 102, 106, 108, 112, 116, 120, 126, 128, 130
Offset: 1

Views

Author

Nicholas Leonard, Jun 19 2023

Keywords

Examples

			9 is a term of this sequence as prime(9) mod 9 = 5, which is prime.
		

Crossrefs

Programs

  • Mathematica
    Table[If[PrimeQ[Mod[Prime[k], k]], k, Nothing], {k, 1, 100}]
  • PARI
    isok(k) = isprime(prime(k) % k); \\ Michel Marcus, Jun 19 2023
  • Python
    from sympy import prime, isprime
    a363751=[]
    for k in range(1,101):
        if isprime(prime(k)%k):
            a363751.append(k)
    

Formula

a(n) = A000720(A363752(n)).

A363752 Primes prime(k) such that prime(k) mod k is prime.

Original entry on oeis.org

5, 7, 17, 19, 23, 41, 47, 53, 61, 71, 79, 89, 101, 107, 113, 127, 131, 137, 139, 151, 163, 167, 173, 181, 191, 193, 197, 211, 223, 227, 229, 233, 239, 241, 257, 269, 277, 281, 313, 317, 347, 359, 367, 373, 383, 397, 421, 433, 443, 457, 463, 479, 503, 521, 541
Offset: 1

Views

Author

Nicholas Leonard, Jun 19 2023

Keywords

Examples

			The 9th prime is 23 and 23 mod 9 = 5, which is prime, so 23 is a term.
		

Crossrefs

Programs

  • Mathematica
    Table[If[PrimeQ[Mod[Prime[k], k]], Prime[k], Nothing], {k, 1, 100}]
  • Python
    from sympy import prime, isprime
    a363752=[]
    for k in range(1, 101):
        if isprime(prime(k)%k):
            a363752.append(prime(k))

Formula

a(n) = A000040(A363751(n)).

A065521 a(n) = floor(prime(n) / n) * n - prime(n) mod n.

Original entry on oeis.org

2, 1, 1, 1, 9, 11, 11, 13, 13, 11, 13, 35, 37, 41, 43, 43, 43, 47, 47, 49, 53, 53, 55, 55, 53, 55, 59, 61, 65, 67, 121, 125, 127, 133, 131, 137, 139, 141, 145, 147, 149, 155, 153, 159, 163, 169, 165, 161, 165, 171, 175, 177, 183, 181, 183, 185, 187, 193, 195, 199
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 27 2001

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Floor[Prime[n]/n]n-Mod[Prime[n],n],{n,60}] (* Harvey P. Dale, Dec 27 2019 *)
  • PARI
    { for (n=1, 1000, a=floor(prime(n) / n) * n - prime(n) % n; write("b065521.txt", n, " ", a) ) } \\ Harry J. Smith, Oct 20 2009
    
  • PARI
    a(n) = n*(prime(n)\n) - (prime(n) % n); \\ Michel Marcus, Jun 18 2018

Formula

a(n) = A038605(n) * n - A004648(n).

A072623 Numbers n such that A065863(n) = 1, i.e., prime(n) mod (n - Pi(n)) = 1.

Original entry on oeis.org

4, 5, 6, 11, 19, 25, 34, 36, 75, 82, 87, 90, 94, 237, 604, 609, 614, 1583, 1592, 10466, 10467, 10498, 10504, 10505, 70501, 70511, 180227, 180294, 180358, 180443, 180447, 466078, 8103422, 21058343, 21058649, 143052872, 143052877, 143053068
Offset: 1

Views

Author

Labos Elemer, Jun 26 2002

Keywords

Comments

A004648, A065134 and A065863 behave similarly; they grow relatively slowly and drop suddenly at unexpected values of n. Parity of A004648 behaves most regularly.
Each cluster of entries exceeds the previous cluster by a power of e.

Examples

			For the cluster started at n = 10466 the remainders of A065863(n) are as follows: {9089, 9092, 9117, 9127, 9148, 9159, 1, 1, 9180, 9183, 9182, 9179, 9172, 9169, 9168, 9177, 9176, 9178, 9183, 9192, 43}. It behaves like A004648 or A065134.
		

Crossrefs

Programs

  • Mathematica
    Do[ If[ Mod[ Prime[n], n-PrimePi[n]] == 1, Print[n]], {n, 1, 150000000}]
    (* Second program: *)
    Position[Table[Mod[Prime[n], n - PrimePi[n]], {n, 10^6}], 1] // Flatten (* Michael De Vlieger, Jul 30 2017 *)

Extensions

Edited by Robert G. Wilson v, Jun 27 2002

A072624 a(n) = prime(n^2) mod n^2.

Original entry on oeis.org

0, 3, 5, 5, 22, 7, 31, 55, 14, 41, 56, 107, 164, 17, 77, 83, 145, 199, 271, 341, 437, 73, 100, 179, 262, 319, 416, 519, 594, 697, 846, 993, 25, 93, 131, 259, 369, 497, 575, 699, 879, 989, 1085, 1259, 1409, 1533, 1799, 1961, 2183, 2307, 2519, 23, 188, 329, 514
Offset: 1

Views

Author

Labos Elemer, Jun 28 2002

Keywords

Examples

			For n = 10: a(10) = prime(100) mod 100 = 541 mod 100 = 41.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Mod[Prime[n^2], n^2]; Array[a, 100] (* Amiram Eldar, Mar 17 2025 *)
  • PARI
    a(n) = prime(n^2) % (n^2); \\ Amiram Eldar, Mar 17 2025

Formula

a(n) = A004648(n^2).

A096197 a(n) = (1+prime(n)) mod n.

Original entry on oeis.org

0, 0, 0, 0, 2, 2, 4, 4, 6, 0, 10, 2, 3, 2, 3, 6, 9, 8, 11, 12, 11, 14, 15, 18, 23, 24, 23, 24, 23, 24, 4, 4, 6, 4, 10, 8, 10, 12, 12, 14, 16, 14, 20, 18, 18, 16, 24, 32, 32, 30, 30, 32, 30, 36, 38, 40, 42, 40, 42, 42, 40, 46, 56, 56, 54, 54, 64, 66, 3, 0, 70, 0, 3, 4, 5, 4, 5, 8, 7, 10, 15
Offset: 1

Views

Author

Labos Elemer, Jul 26 2004

Keywords

Comments

Graph is similar to that of A004648.

Crossrefs

Programs

  • Magma
    [(NthPrime(n)+1) mod(n): n in [1..90]]; // Vincenzo Librandi, Sep 11 2014
    
  • Mathematica
    Table[Mod[Prime[n] + 1, n], {n, 100}] (* Vincenzo Librandi, Sep 11 2014 *)
  • PARI
    lista(nn) = {forprime(p=2, n, print1((p+1) % primepi(p), ", "););} \\ Michel Marcus, Sep 11 2014
Previous Showing 31-40 of 57 results. Next