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.

A065134 Remainder when n is divided by the number of primes not exceeding n.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Oct 15 2001

Keywords

Comments

Also remainder when the number of nonprimes is divided by the number of primes (not exceeding n).

Examples

			n = 2: Pi[2] = 1,Mod[1,1] = 0, the first term = a(2) = 0; n = 100: Pi[100] = 25, Mod[100,25] = 0 = a(100); n = 20: Pi[20] = 8, Mod[20,8] = 4 = a(20).
		

Crossrefs

Programs

  • Mathematica
    Table[Last@ QuotientRemainder[n, PrimePi[n]], {n, 2, 91}] (* Michael De Vlieger, Jul 04 2016 *)
  • PARI
    { for (n=2, 1000, write("b065134.txt", n, " ", n%primepi(n)) ) } \\ Harry J. Smith, Oct 11 2009

Formula

a(n) = n (mod pi(n)).

Extensions

Term a(1) removed so OFFSET changed from 1,5 to 2,4 by Harry J. Smith, Oct 11 2009
Since OFFSET is 2,4; Term a(1) removed and a(91) added by Harry J. Smith, Oct 11 2009

A065864 Remainder when n is divided by the number of nonprimes not exceeding n.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Nov 26 2001

Keywords

Examples

			For n=100, pi(100)=25, so a(100) = 100 mod (100-25) = 25.
		

Crossrefs

Programs

  • Mathematica
    Table[Mod[n, n - PrimePi@ n], {n, 78}] (* or *)
    Table[Mod[n, Count[Range@ n, k_ /; ! PrimeQ@ k]], {n, 78}] (* Michael De Vlieger, Jan 01 2017 *)
  • PARI
    { for (n = 1, 1000, a=n%(n - primepi(n)); write("b065864.txt", n, " ", a) ) } \\ Harry J. Smith, Nov 02 2009

Formula

a(n) = n mod (n-pi(n)) = n mod (n-A000720(n)) = n mod A062298(n).

A065863 Remainder when n-th prime is divided by the number of nonprimes not exceeding n.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 2, 3, 3, 5, 1, 2, 6, 3, 2, 3, 9, 6, 1, 11, 8, 9, 13, 14, 1, 16, 13, 12, 14, 13, 7, 5, 5, 1, 5, 1, 7, 7, 5, 5, 11, 7, 17, 13, 11, 7, 19, 25, 23, 19, 17, 17, 19, 23, 23, 23, 23, 19, 25, 23, 25, 29, 37, 35, 31, 29, 43, 43, 47, 43, 47, 47, 3, 2, 1, 53, 53, 55, 2, 3, 6, 1, 11, 6
Offset: 1

Views

Author

Labos Elemer, Nov 26 2001

Keywords

Examples

			For n=25, prime(25)=97, n - pi(n) = 25 - 9 = 16, a(25)=1 because 97 = 6*16 + 1.
		

Crossrefs

Programs

  • Mathematica
    Table[Mod[Prime[n],n-PrimePi[n]],{n,90}] (* Harvey P. Dale, Aug 04 2015 *)
  • PARI
    a(n) = { prime(n)%(n - primepi(n)) } \\ Harry J. Smith, Nov 02 2009

Formula

a(n) = prime(n) mod (n - pi(n)) = A000040(n) mod A062298(n).

A065135 Numbers m such that prime(m) = pi(m)*k + 1 for some k.

Original entry on oeis.org

3, 4, 6, 7, 10, 11, 14, 21, 37, 45, 47, 53, 55, 63, 75, 81, 101, 115, 121, 125, 136, 183, 209, 230, 271, 313, 319, 327, 348, 377, 399, 425, 460, 575, 581, 738, 786, 792, 850, 881, 917, 1076, 1110, 1152, 1246, 1519, 1740, 2062, 2074, 2119, 2144, 2327, 2361
Offset: 1

Views

Author

Labos Elemer, Oct 15 2001

Keywords

Comments

Solutions to A000040(x) mod A000720(x) = 1.
Values satisfying A065133(x) = 1.

Examples

			m = 581 is a term because prime(581) = 4211 = 106*40 + 1 = 40*pi(581) + 1.
		

Crossrefs

Programs

  • Mathematica
    seq[lim_] := Module[{r = Range[2, lim], p}, p = PrimePi[r]; 1 + Position[Mod[Prime[r], p], 1] // Flatten]; seq[2400] (* Amiram Eldar, Mar 13 2025 *)
  • PARI
    isok(m) = if (m>1, prime(m) % primepi(m) == 1); \\ Michel Marcus, Mar 04 2022
    
  • PARI
    list(lim) = {my(k = 1); forprime(p = 3, lim, k++; if(p % primepi(k) == 1, print1(k, ", ")));} \\ Amiram Eldar, Mar 13 2025

A065859 Remainder when the n-th prime is divided by the n-th composite number.

Original entry on oeis.org

2, 3, 5, 7, 1, 1, 3, 4, 7, 11, 11, 16, 19, 19, 22, 1, 5, 5, 7, 7, 7, 11, 13, 17, 21, 23, 23, 23, 21, 23, 35, 35, 39, 39, 47, 47, 49, 53, 55, 2, 5, 1, 5, 4, 5, 4, 13, 19, 20, 19, 17, 17, 16, 23, 26, 29, 29, 28, 31, 29, 28, 35, 46, 47, 43, 44, 55, 58, 65, 64, 65, 65, 70, 73, 73, 71
Offset: 1

Views

Author

Labos Elemer, Nov 26 2001

Keywords

Examples

			n=100, p(100)=541, c(100)=133, a(100)=9 because 541 = 4*133 + 9.
		

Crossrefs

Programs

  • Mathematica
    a[n]=Mod[p(n), c(n)]=Mod[A000040(n), A002808(n)]
    With[{nn=80},Module[{prs=Prime[Range[nn]],comps},comps=Take[Complement[ Range[2,Prime[nn]+1],prs],Length[prs]];Mod[#[[1]],#[[2]]]&/@ Thread[ {prs,comps}]]] (* Harvey P. Dale, Apr 18 2012 *)
  • PARI
    Composite(n) = { local(k); k=n + primepi(n) + 1; while (k != n + primepi(k) + 1, k = n + primepi(k) + 1); return(k) } { for (n = 1, 1000, a=prime(n)%Composite(n); write("b065859.txt", n, " ", a) ) } \\ Harry J. Smith, Nov 01 2009

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