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 21-30 of 99 results. Next

A075432 Primes with no squarefree neighbors.

Original entry on oeis.org

17, 19, 53, 89, 97, 127, 149, 151, 163, 197, 199, 233, 241, 251, 269, 271, 293, 307, 337, 349, 379, 449, 487, 491, 521, 523, 557, 577, 593, 631, 701, 727, 739, 751, 773, 809, 811, 881, 883, 919, 953, 991, 1013, 1049, 1051, 1061, 1063, 1097, 1151, 1171, 1249
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 15 2002

Keywords

Comments

Complement of A075430 in A000040.
From Ludovicus (luiroto(AT)yahoo.com), Dec 07 2009: (Start)
I propose a shorter name: non-Euclidean primes. That is justified by the Euclid's demonstration of the infinitude of primes. It appears that the proportion of non-Euclidean primes respect to primes tend to the limit 1-2A where A = 0.37395581... is Artin's constant. This table calculated by Jens K. Andersen corroborates it:
10^5: 2421 / 9592 = 0.2523978315
10^6: 19812 / 78498 = 0.2523885958
10^7: 167489 / 664579 = 0.2520227091
10^8: 1452678 / 5761455 = 0.2521373507
10^9: 12817966 / 50847534 = 0.2520862860
10^10: 114713084 / 455052511 = 0.2520875750
10^11: 1038117249 / 4118054813 = 0.2520892256
It comes close to the expected 1-2A. (End)
This sequence is infinite by Dirichlet's theorem, since there are infinitely many primes == 17 or 19 (mod 36) and these have no squarefree neighbors. Ludovicus's conjecture about density is correct. Capsule proof: either p-1 or p+1 is divisible by 4, so it suffices to consider the other number (without loss of generality, p+1). For some fixed bound L, p is not divisible by any prime q < L (with finitely many exceptions) so there are q^2 - q possible residue classes for p. The primes in each are uniformly distributed so the probability that p+1 is divisible by q^2 is 1/(q^2 - q). The product of the complements goes to 2A as L increases without bound, and since 2A is an upper bound the limit is sandwiched between. - Charles R Greathouse IV, Aug 27 2014
Primes p such that both p-1 and p+1 are divisible by a square greater than 1. - N. J. A. Sloane, Jul 19 2024

Examples

			p = 17 is a term because 16 = 4^2 and 18=2*3^2 are divisible by squares > 1. - _N. J. A. Sloane_, Jul 19 2024
		

Crossrefs

Intersection of A000040 and A281192.

Programs

  • Haskell
    a075432 n = a075432_list !! (n-1)
    a075432_list = f [2, 4 ..] where
       f (u:vs@(v:ws)) | a008966 v == 1 = f ws
                       | a008966 u == 1 = f vs
                       | a010051' (u + 1) == 0 = f vs
                       | otherwise            = (u + 1) : f vs
    -- Reinhard Zumkeller, May 04 2013
    
  • Maple
    filter:= n -> isprime(n) and not numtheory:-issqrfree(n+1) and not numtheory:-issqrfree(n-1):
    select(filter, [seq(2*i+1, i=1..1000)]); # Robert Israel, Aug 27 2014
  • Mathematica
    lst={}; Do[p=Prime[n]; If[ !SquareFreeQ[Floor[p-1]] && !SquareFreeQ[Floor[p+1]], AppendTo[lst,p]], {n,6!}]; lst (* Vladimir Joseph Stephan Orlovsky, Dec 20 2008 *)
    Select[Prime[Range[300]],!SquareFreeQ[#-1]&&!SquareFreeQ[#+1]&] (* Harvey P. Dale, Apr 24 2014 *)
  • PARI
    is(n)=!issquarefree(if(n%4==1, n+1, n-1)) && isprime(n) \\ Charles R Greathouse IV, Aug 27 2014

Formula

a(n) ~ Cn log n, where C = 1/(1 - 2A) = 1/(1 - Product_{p>2 prime} (1 - 1/(p^2-p))), where A is the constant in A005596. - Charles R Greathouse IV, Aug 27 2014

Extensions

More terms (that were already in the b-file) from Jeppe Stig Nielsen, Apr 23 2020

A088144 Sum of primitive roots of n-th prime.

Original entry on oeis.org

1, 2, 5, 8, 23, 26, 68, 57, 139, 174, 123, 222, 328, 257, 612, 636, 886, 488, 669, 1064, 876, 1105, 1744, 1780, 1552, 2020, 1853, 2890, 1962, 2712, 2413, 3536, 4384, 3335, 5364, 3322, 3768, 4564, 7683, 7266, 8235, 4344, 8021, 6176, 8274
Offset: 1

Views

Author

Ed Pegg Jr, Nov 03 2003

Keywords

Comments

It is a result that goes back to Mirsky that the set of primes p for which p-1 is squarefree has density A, where A denotes the Artin constant (A = Product_{q prime} (1-1/(q*(q-1)))). Numerically A = 0.3739558136.. = A005596. More precisely, Sum_{p <= x} mu(p-1)^2 = Ax/log x + o(x/log x) as x tends to infinity. Conjecture: sum_{p <= x, mu(p-1)=1} 1 = (A/2)x/log x + o(x/log x) and sum_{p <= x, mu(p-1)=-1} 1 = (A/2)x/log x + o(x/log x). - Pieter Moree (moree(AT)mpim-bonn.mpg.de), Nov 03 2003
The number of the primitive roots is A008330(n). - R. K. Guy, Feb 25 2011
If prime(n) == 1 (mod 4), then a(n) = prime(n)*A008330(n)/2. There are also primes of the form prime(n) == 3 (mod 4) where prime(n) | a(n), namely prime(n) = 19, 127, 151, 163, 199, 251,... The list of primes in both modulo-4 classes where prime(n)|a(n) is 5, 13, 17, 19, 29, 37, 41, 53, 61,... - R. K. Guy, Feb 25 2011
a(n) = A076410(n) at n = 1, 3, 7, 55,... (for p = 2, 5, 17, 257... and perhaps only for the Fermat primes). - R. K. Guy, Feb 25 2011

Examples

			For 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, the primitive roots are as follows: {{1}, {2}, {2, 3}, {3, 5}, {2, 6, 7, 8}, {2, 6, 7, 11}, {3, 5, 6, 7, 10, 11, 12, 14}, {2, 3, 10, 13, 14, 15}, {5, 7, 10, 11, 14, 15, 17, 19, 20, 21}, {2, 3, 8, 10, 11, 14, 15, 18, 19, 21, 26, 27}}
		

References

  • C. F. Gauss, Disquisitiones Arithmeticae, Yale, 1965; see p. 52.

Crossrefs

Programs

  • Mathematica
    PrimitiveRootQ[ a_Integer, p_Integer ] := Block[ {fac, res}, fac = FactorInteger[ p - 1 ]; res = Table[ PowerMod[ a, (p - 1)/fac[ [ i, 1 ] ], p ], {i, Length[ fac ]} ]; ! MemberQ[ res, 1 ] ] PrimitiveRoots[ p_Integer ] := Select[ Range[ p - 1 ], PrimitiveRootQ[ #, p ] & ]
    Total /@ Table[PrimitiveRootList[Prime[k]], {k, 1, 45}] (* Updated for Mathematica 13 by Harlan J. Brothers, Feb 27 2023 *)
  • PARI
    a(n)=local(r, p, pr, j); p=prime(n); r=vector(eulerphi(p-1)); pr=znprimroot(p); for(i=1, p-1, if(gcd(i, p-1)==1, r[j++]=lift(pr^i))); vecsum(r) \\ after Franklin T. Adams-Watters's code in A060749, Michel Marcus, Mar 16 2015

A019335 Primes with primitive root 5.

Original entry on oeis.org

2, 3, 7, 17, 23, 37, 43, 47, 53, 73, 83, 97, 103, 107, 113, 137, 157, 167, 173, 193, 197, 223, 227, 233, 257, 263, 277, 283, 293, 307, 317, 347, 353, 373, 383, 397, 433, 443, 463, 467, 503, 523, 547, 557, 563, 577, 587, 593, 607, 613, 617, 647, 653, 673, 677, 683, 727
Offset: 1

Views

Author

Keywords

Comments

To allow primes less than the specified primitive root m (here, 5) to be included, we use the essentially equivalent definition "Primes p such that the multiplicative order of m mod p is p-1". This comment applies to all of A019334-A019421. - N. J. A. Sloane, Dec 02 2019
Appears to be the numbers k such that the sequence 5^n mod k has period length k-1. All terms are congruent to 2 or 3 mod 5. - Gary Detlefs, May 21 2014
From Jianing Song, Apr 27 2019: (Start)
If we define
Pi(N,b) = # {p prime, p <= N, p == b (mod 5)};
Q(N) = # {p prime, p <= N, p in this sequence},
then by Artin's conjecture, Q(N) ~ (20/19)*C*N/log(N) ~ (40/19)*C*(Pi(N,2) + Pi(N,3)), where C = A005596 is Artin's constant.
Conjecture: if we further define
Q(N,b) = # {p prime, p <= N, p == b (mod 5), p in this sequence},
then we have:
Q(N,2) ~ (1/2)*Q(N) ~ (20/19)*C*Pi(N,2);
Q(N,3) ~ (1/2)*Q(N) ~ (20/19)*C*Pi(N,3). (End)

Crossrefs

Programs

  • Mathematica
    pr=5; Select[Prime[Range[200]], MultiplicativeOrder[pr, # ] == #-1 &]
  • PARI
    isok(p) = isprime(p) && (p != 5) && (znorder(Mod(5, p)) == p-1); \\ Michel Marcus, Apr 27 2019

A297408 Where the prime race among 10k+1, ..., 10k+9 changes leader.

Original entry on oeis.org

2, 13, 157, 193, 347, 383, 587, 673, 907, 1163, 1327, 1483, 1907, 1933, 2897, 4723, 5557, 5573, 6037, 6113, 6637, 6673, 7487, 8273, 8317, 8363, 8387, 8443, 8467, 8573, 8647, 8803, 8837, 8933, 9277, 9293, 10067, 10103, 11897, 11923, 12037, 12073, 12107, 12143
Offset: 1

Views

Author

Sean A. Irvine, Dec 29 2017

Keywords

Comments

A007355 appears to be an erroneous version of this sequence.

Crossrefs

Programs

  • PARI
    a297408(limit)={my(v=vector(10),vm=0,ivm=0,imv); forprime(p=2,limit,my(m=p%10);v[m]++;my(mv=vecmax(v,&imv));if(mv>vm,if(imv!=ivm,print1(p,", "); ivm=imv);vm=mv))};
    a297408(12500) \\ Hugo Pfoertner, Jul 25 2021
    
  • Python
    from sympy import nextprime
    from itertools import islice
    def agen():
        c, p, leader = [0 for i in range(10)], 1, None
        while True:
            p = nextprime(p); last = p%10; c[last] += 1; m = max(c)
            if c.count(m) == 1 and c.index(m) == last and last != leader:
                yield p; leader = last
    print(list(islice(agen(), 44))) # Michael S. Branicky, Dec 20 2022

A007353 Where the prime race among 5k+1, ..., 5k+4 changes leader.

Original entry on oeis.org

2, 83, 137, 293, 337, 443, 487, 523, 557, 743, 797, 1213, 1277, 1523, 1657, 1733, 1867, 1973, 2027, 2063, 2797, 2833, 2887, 4733, 5227, 5323, 5437, 5503, 5527, 5623, 5897, 5923, 6007, 6133, 6317, 6353, 6427, 6563, 6607, 6703, 7187, 7283, 7307, 7393, 7477, 8963
Offset: 1

Views

Author

Keywords

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

A007354 Where the prime race among 7k+1, ..., 7k+6 changes leader.

Original entry on oeis.org

2, 17, 131, 227, 733, 829, 929, 997, 1097, 1123, 1237, 1277, 1447, 1487, 1531, 1627, 1811, 1907, 1993, 2141, 2203, 2267, 2441, 2677, 2707, 3209, 3299, 3433, 3547, 3853, 4003, 4021, 4507, 4679, 4787, 4931, 5081, 5113, 7537, 7577, 7649, 7759, 7817, 8039, 8461, 8543
Offset: 1

Views

Author

Keywords

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • PARI
    primerace(mod,limit)={my(v=vector(mod), vm=0, ivm=0, imv); forprime(p=2, limit, my(m=p%mod); v[m+1]++;  v[m+1]++; my(mv=vecmax(v, &imv)); if(mv>vm, if(imv!=ivm, print1(p, ", "); ivm=imv); vm=mv))};
    primerace(7,8600) \\ Hugo Pfoertner, Jul 25 2021

A297406 Where the prime race among 8k+1, ..., 8k+7 changes leader.

Original entry on oeis.org

2, 11, 37, 83, 197, 227, 271, 293, 347, 373, 487, 547, 853, 907, 1069, 1447, 1733, 1831, 1949, 2027, 2053, 2131, 2237, 2251, 2309, 2719, 2749, 3019, 3061, 3083, 3733, 3779, 3877, 3931, 4919, 5179, 5303, 5347, 5407, 6661, 6911, 6949, 6967, 7459, 7789
Offset: 1

Views

Author

Sean A. Irvine, Dec 29 2017

Keywords

Crossrefs

Programs

  • Maple
    X:= Vector(4): X[2]:= 1: m:= 3: p:= 3: count:= 1: R:= 2:
    for i from 2 while count < 100 do
      p:= nextprime(p);
      j:= ((p mod 8)+1)/2;
      X[j]:= X[j]+1;
      mp:= max[index](X);
      if mp <> m and X[mp] > X[m] then
        m:= mp;
        R:= R,p;
        count:= count+1;
       fi
    od:
    R; # Robert Israel, Nov 21 2024

A297407 Where the prime race among 9k+1, ..., 9k+8 changes leader.

Original entry on oeis.org

2, 167, 191, 419, 461, 563, 587, 617, 677, 761, 857, 881, 929, 1427, 1451, 1607, 1667, 1777, 1823, 1867, 1913, 2351, 2399, 2459, 4127, 4583, 5039, 5087, 5171, 7283, 7349, 7517, 7547, 7643, 7691, 7901, 8681, 8837, 8933, 11243, 11903, 11927, 18329, 18371, 19913
Offset: 1

Views

Author

Sean A. Irvine, Dec 29 2017

Keywords

Crossrefs

Programs

  • Maple
    V:= <(0$8)>:
    lead:= 1:
    Res:= NULL:
    count:= 0:
    p:= 1:
    while count < 100 do
      p:= nextprime(p);
      t:= p mod 9;
      V[t]:= V[t]+1;
      if V[t] > V[lead] then
        lead:= t;
        Res:= Res, p;
        count:= count+1;
      fi
    od:
    Res; # Robert Israel, Jan 01 2018

A297410 Where the prime race among 11k+1, ..., 11k+10 changes leader.

Original entry on oeis.org

2, 73, 101, 149, 233, 359, 431, 509, 563, 1051, 1091, 1151, 1259, 1459, 1553, 1811, 2609, 2713, 2741, 4363, 4507, 4561, 4919, 5023, 5189, 6761, 7321, 7433, 7717, 7829, 8039, 8081, 8951, 9043, 9203, 9337, 9851, 9931, 10181, 10457, 11437, 11491, 13099, 19841
Offset: 1

Views

Author

Sean A. Irvine, Dec 29 2017

Keywords

Crossrefs

A297411 Where the prime race among 12k+1, ..., 12k+11 changes leader.

Original entry on oeis.org

2, 17, 79, 101, 163, 197, 211, 263, 281, 379, 401, 443, 461, 479, 631, 677, 739, 809, 907, 953, 1087, 1109, 1171, 1193, 1543, 1607, 1721, 1759, 2063, 2203, 2417, 2543, 2633, 2711, 2731, 2753, 3203, 3221, 3323, 3607, 3803, 3847, 3863, 3943, 4397
Offset: 1

Views

Author

Sean A. Irvine, Dec 29 2017

Keywords

Crossrefs

Previous Showing 21-30 of 99 results. Next