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-10 of 78 results. Next

A056915 Strong pseudoprimes to bases 2, 3 and 5, i.e., intersection of A001262, A020229, and A020231.

Original entry on oeis.org

25326001, 161304001, 960946321, 1157839381, 3215031751, 3697278427, 5764643587, 6770862367, 14386156093, 15579919981, 18459366157, 19887974881, 21276028621, 27716349961, 29118033181, 37131467521, 41752650241, 42550716781, 43536545821
Offset: 1

Views

Author

Rick L. Shepherd, Feb 12 2002

Keywords

Comments

These first 13 numbers are the only ones less than 25*10^9 which are simultaneously strong pseudoprimes to bases 2, 3 and 5. Taken from the same table - which indicates (only) whether they are also strong pseudoprime (spsp) or pseudoprime (psp) to base 7, 11 and/or 13: 161304001 is spsp to 11; 3215031751 is spsp to base 7 and is psp to both bases 11 and 13; 5764643587 is spsp to base 13; 14386156093 is psp to bases 7, 11 and 13. 15579919981 is psp to base 7 and spsp to base 11; 19887974881 is psp to base 7; and 21276028621 is psp to bases 11 and 13.

References

  • P. Ribenboim, The Little Book of Big Primes. Springer-Verlag, NY, 1991, pp. 82-83.

Crossrefs

Cf. A072276, A001262, A020229, A020231, superset of A074773.

Extensions

B-file and more terms from Charles R Greathouse IV, Aug 14 2010

A055552 Number of base-2 strong pseudoprimes (A001262) less than 10^n.

Original entry on oeis.org

0, 0, 0, 5, 16, 46, 162, 488, 1282, 3291, 8607, 22407, 58892, 156251, 419489, 1135860, 3115246, 8646507, 24220195
Offset: 1

Views

Author

Keywords

References

  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 219.

Crossrefs

Cf. A001262.

Extensions

Corrected by Shyam Sunder Gupta, Mar 04 2002
a(14)-a(15) from Charles R Greathouse IV, Aug 15 2006
a(16)-a(19) from Charles R Greathouse IV, Mar 14 2011

A108797 Number of base-2 strong pseudoprimes (A001262) less than 2^n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 4, 6, 7, 11, 18, 24, 34, 49, 75, 104, 147, 210, 296, 409, 552, 734, 981, 1311, 1736, 2314, 3093, 4139, 5511, 7396, 9835, 13106, 17493, 23270, 31115, 41664, 55763, 74739, 100342, 134559, 180725, 243566, 327731, 441270, 594585, 803252, 1085426, 1468777, 1988905, 2697846, 3662239, 4976375, 6767707, 9212942, 12552513, 17114780, 23355139, 31894014
Offset: 1

Views

Author

Keywords

Examples

			a(12)=3 since 2047, 3277 and 4033 are the 2-SPSPs less than 4096.
		

Crossrefs

Extensions

a(24)-a(64) from Charles R Greathouse IV, Jan 28 2011, based on the calculations of Jan Feitsma.
a(1)=...=a(10)=0 prepended by Max Alekseyev, Apr 23 2013

A301643 Strong pseudo safe-primes: numbers n = 2m+1 with 2^m == +-1 (mod n) and m a strong pseudoprime A001262.

Original entry on oeis.org

715523, 2651687, 2882183, 10032383, 14924003, 15640403, 30278399, 32140859, 45698963, 86727203, 129210083, 202553159, 257330639, 271938803, 274831643, 294056003, 307856267, 332164619, 413008067, 437894243, 447564527, 494832203, 654796019, 689552603, 735119003
Offset: 1

Views

Author

Francois R. Grieu, Mar 25 2018

Keywords

Comments

Equivalently, numbers n = 2m+1 that are not safe primes A005385 even though n and m are strong probable primes (that is, prime or strong pseudoprime A001262). That follows from a result by Fedor Petrov.
All known terms are prime, including the 542622 less than 2^65 (obtained by post-processing Jan Feitsma and William Galway's table).

Examples

			n = 715523 is in the sequence because n = 2m+1 with m = 357761, and 2^m mod n = 715522 which is among 1 or n-1 (the latter), and m is a strong pseudoprime A001262. The latter holds because m = 131*2731 is composite, and m passes the strong probable prime test. The latter holds because when writing m-1 as d*(2^s) with d odd, it holds that 2^d mod m = 1 or there exists an r with 0 <= r < s and 2^(d*(2^r)) == -1 (mod m); specifically, d = 2795, s = 7, 2^2795 mod 357761 = 357760 = m-1, thus 2^(d*(2^r)) == -1 (mod m) for r = 0.
		

Crossrefs

Subsequence of A300193.

Programs

  • Mathematica
    For[m=3,(n=2m+1)<13^8,m+=2,If[MemberQ[{1,n-1},PowerMod[2,m,n]]&&(d=m-1;t=1;While[EvenQ[d],d/=2;++t];If[(x=PowerMod[2,d,m])!=1,While[--t>0&&x!=m-1,x=Mod[x^2,m]]];t>0)&&!PrimeQ[m],Print[n]]]
  • PARI
    is_A001262(n, a=2)={ (bittest(n, 0) && !isprime(n) && n>8) || return; my(s=valuation(n-1, 2)); if(1==a=Mod(a, n)^(n>>s), return(1)); while(a!=-1 && s--, a=a^2); a==-1; } \\ after A001262
    isok(n) = if (n%2, my(m = (n-1)/2, r = Mod(2, n)^m); ((r==1) || (r==-1)) && is_A001262(m)); \\ derived from Michel Marcus, May 07 2018

A338370 Numbers k such that 4^k - 2^k + 1 is a strong pseudoprime to base 2 (A001262).

Original entry on oeis.org

6, 8, 12, 16, 18, 20, 24, 36, 40, 42, 48, 54, 60, 64, 72, 80, 84, 96, 100, 108, 120, 126, 128, 136, 144, 156, 160, 162, 168, 180, 192, 200, 216, 220, 240, 252, 256, 272, 288, 294, 300, 312, 320, 324, 336, 342, 360, 378, 384, 400, 408, 420, 432, 440, 468, 480, 486
Offset: 1

Views

Author

Davide Rotondo, Oct 23 2020

Keywords

Comments

Apparently this sequence is A068563 \ {1, 2, 4, 32}. - Amiram Eldar, Oct 23 2020

Crossrefs

A356866 Smallest Carmichael number (A002997) with n prime factors that is also a strong pseudoprime to base 2 (A001262).

Original entry on oeis.org

15841, 5310721, 440707345, 10761055201, 5478598723585, 713808066913201, 1022751992545146865, 5993318051893040401, 120459489697022624089201, 27146803388402594456683201, 14889929431153115006659489681
Offset: 3

Views

Author

Daniel Suteu, Oct 01 2022

Keywords

Crossrefs

Programs

  • PARI
    carmichael_strong_psp(A, B, k, base) = A=max(A, vecprod(primes(k+1))\2); (f(m, l, p, k, k_exp, congr, u=0, v=0) = my(list=List()); if(k==1, forprime(q=u, v, my(t=m*q); if((t-1)%l == 0 && (t-1)%(q-1) == 0, my(tv=valuation(q-1, 2)); if(tv > k_exp && Mod(base, q)^(((q-1)>>tv)< k_exp && Mod(base, q)^(((q-1)>>tv)<u, u=r); list=concat(list, f(t, L, r, k-1, k_exp, congr, u, v)))))))); list); my(res=f(1, 1, 3, k, 0, 1)); for(v=0, logint(B, 2), res=concat(res, f(1, 1, 3, k, v, -1))); vecsort(Vec(res));
    a(n,base=2) = if(n < 3, return()); my(x=vecprod(primes(n+1))\2,y=2*x); while(1, my(v=carmichael_strong_psp(x,y,n,base)); if(#v >= 1, return(v[1])); x=y+1; y=2*x);

Formula

a(n) >= max(A180065(n), A006931(n)).

A014664 Order of 2 modulo the n-th prime.

Original entry on oeis.org

2, 4, 3, 10, 12, 8, 18, 11, 28, 5, 36, 20, 14, 23, 52, 58, 60, 66, 35, 9, 39, 82, 11, 48, 100, 51, 106, 36, 28, 7, 130, 68, 138, 148, 15, 52, 162, 83, 172, 178, 180, 95, 96, 196, 99, 210, 37, 226, 76, 29, 119, 24, 50, 16, 131, 268, 135, 92, 70, 94, 292, 102, 155, 156, 316
Offset: 2

Views

Author

Keywords

Comments

In other words, a(n), n >= 2, is the least k such that prime(n) divides 2^k-1.
Concerning the complexity of computing this sequence, see for example Bach and Shallit, p. 115, exercise 8.
Also A002326((p_n-1)/2). Conjecture: If p_n is not a Wieferich prime (1093, 3511, ...) then A002326(((p_n)^k-1)/2) = a(n)*(p_n)^(k-1). - Vladimir Shevelev, May 26 2008
If for distinct i,j,...,k we have a(i)=a(j)=...=a(k) then the number N = p_i*p_j*...*p_k is in A001262 and moreover A137576((N-1)/2) = N. For example, a(16)=a(37)=a(255)=52. Therefore we could take N = p_16*p_37*p_255 = 53*157*1613 = 13421773. - Vladimir Shevelev, Jun 14 2008
Also degree of the irreducible polynomial factors for the polynomial (x^p+1)/(x+1) over GF(2), where p is the n-th prime. - V. Raman, Oct 04 2012
Is this the same as the smallest k > 1 not already in the sequence such that p = prime(n) is a factor of 2^k-1 (A270600)? If the answer is yes, is the sequence a permutation of the positive integers > 1? - Felix Fröhlich, Feb 21 2016. Answer: No, it is easy to prove that 6 is missing and obviously 11 appears twice. - N. J. A. Sloane, Feb 21 2016
pi(A112927(m)) is the index at which a given number m first appears in this sequence. - M. F. Hasler, Feb 21 2016

Examples

			2^2 == 1 (mod 3) and so a(2) = 2;
2^4 == 1 (mod 5) and so a(3) = 4;
2^3 == 1 (mod 7) and so a(4) = 3;
2^10 == 1 (mod 11) and so a(5) = 10; etc.
[Conway & Guy, p. 166]: Referring to the work of Euler, 1/13 in base 2 = 0.000100111011...; (cycle length of 12). - _Gary W. Adamson_, Aug 22 2009
		

References

  • E. Bach and Jeffrey Shallit, Algorithmic Number Theory, I.
  • Albert H. Beiler, "Recreations in the Theory of Numbers", Dover, 1966; Table 48, page 98, "Exponents to Which a Belongs, MOD p and MOD p^n.
  • John H. Conway and Richard Guy, "The Book of Numbers", Springer-Verlag, 1996; p. 166: "How does the Cycle Length Change with the Base?". [From Gary W. Adamson, Aug 22 2009]
  • S. K. Sehgal, Group rings, pp. 455-541 in Handbook of Algebra, Vol. 3, Elsevier, 2003; see p. 493.

Crossrefs

Cf. A002326 (order of 2 mod 2n+1), A001122 (full reptend primes in base 2), A065941, A112927.

Programs

  • GAP
    P:=Filtered([1..350],IsPrime);; a:=List([2..Length(P)],n->OrderMod(2,P[n]));; Print(a); # Muniru A Asiru, Jan 29 2019
    
  • Maple
    with(numtheory): [ seq(order(2,ithprime(n)), n=2..60) ];
  • Mathematica
    Reap[Do[p=Prime[i];Do[If[PowerMod[2,k,p]==1,Print[{i,k}];Sow[{i,k}];Goto[ni]],{k,1,10^6}];Label[ni],{i,2,5001}]][[2,1]] (* Zak Seidov, Jan 26 2009 *)
    Table[MultiplicativeOrder[2, Prime[n]], {n, 2, 70}] (* Jean-François Alcover, Dec 10 2015 *)
  • PARI
    a(n)=if(n<0,0,k=1;while((2^k-1)%prime(n)>0,k++);k)
    
  • PARI
    A014664(n)=znorder(Mod(2, prime(n))) \\ Nick Hobson, Jan 08 2007, edited by M. F. Hasler, Feb 21 2016
    
  • PARI
    forprime(p=3, 800, print(factormod((x^p+1)/(x+1), 2, 1)[1, 1])) \\ V. Raman, Oct 04 2012
    
  • Python
    from sympy import n_order, prime
    def A014664(n): return n_order(2,prime(n)) # Chai Wah Wu, Nov 09 2023

Formula

a(n) = (A000040(n)-1)/A001917(n); a(A072190(n)) = A001122(n) - 1. - Benoit Cloitre, Jun 06 2004

Extensions

More terms from Benoit Cloitre, Apr 11 2003

A164368 Primes p with the property: if q is the smallest prime > p/2, then a prime exists between p and 2q.

Original entry on oeis.org

2, 11, 17, 29, 41, 47, 59, 67, 71, 97, 101, 107, 109, 127, 137, 149, 151, 167, 179, 181, 191, 197, 227, 229, 233, 239, 241, 263, 269, 281, 283, 307, 311, 347, 349, 367, 373, 401, 409, 419, 431, 433, 439, 461, 487, 491, 503, 521, 569, 571, 587, 593, 599, 601, 607
Offset: 1

Views

Author

Vladimir Shevelev, Aug 14 2009

Keywords

Comments

The Ramanujan primes possess the following property:
If p = prime(n) > 2, then all numbers (p+1)/2, (p+3)/2, ..., (prime(n+1)-1)/2 are composite.
The sequence equals all primes with this property, whether Ramanujan or not.
All Ramanujan primes A104272 are in the sequence.
Every lesser of twin primes (A001359), beginning with 11, is in the sequence. - Vladimir Shevelev, Aug 31 2009
109 is the first non-Ramanujan prime in this sequence.
A very simple sieve for the generation of the terms is the following: let p_0=1 and, for n>=1, p_n be the n-th prime. Consider consecutive intervals of the form (2p_n, 2p_{n+1}), n=0,1,2,... From every interval containing at least one prime we remove the last one. Then all remaining primes form the sequence. Let us demonstrate this sieve: For p_n=1,2,3,5,7,11,... consider intervals (2,4), (4,6), (6,10), (10,14), (14,22), (22,26), (26,34), ... . Removing from the set of all primes the last prime of each interval, i.e., 3,5,7,13,19,23,31,... we obtain 2,11,17,29, etc. - Vladimir Shevelev, Aug 30 2011
This sequence and A194598 are the mutually wrapping up sequences:
A194598(1) <= a(1) <= A194598(2) <= a(2) <= ...
From Peter Munn, Oct 30 2017: (Start)
The sequence is the list of primes p = prime(k) such that there are no primes between prime(k)/2 and prime(k+1)/2. Changing "k" to "k-1" and therefore "k+1" to "k" produces a definition very similar to A164333's: it differs by prefixing an initial term 3. From this we get a(n+1) = prevprime(A164333(n)) = A151799(A164333(n)) for n >= 1.
The sequence is the list of primes that are not the largest prime less than 2*prime(k) for any k, so that - as a set - it is the complement relative to A000040 of the set of numbers in A059788.
{{2}, A166252, A166307} is a partition.
(End)

Examples

			2 is in the sequence, since then q=2, and there is a prime 3 between 2 and 4. - _N. J. A. Sloane_, Oct 15 2009
		

Crossrefs

Cf. Ramanujan primes, A104272, and related sequences: A164288, A080359, A164294, A193507, A194184, A194186.
A001359, A166252, A166307 are subsets.
Cf. A001262, A001567, A062568, A141232 (all relate to pseudoprimes to base 2).

Programs

  • Maple
    a:= proc(n) option remember; local q, k, p;
          k:= nextprime(`if`(n=1, 1, a(n-1)));
          do q:= nextprime(floor(k/2));
             p:= nextprime(k);
             if p<2*q then break fi;
             k:= p
          od; k
        end:
    seq(a(n), n=1..55);  # Alois P. Heinz, Aug 30 2011
  • Mathematica
    Reap[Do[q=NextPrime[p/2]; If[PrimePi[2*q] != PrimePi[p], Sow[p]], {p, Prime[Range[100]]}]][[2, 1]]
    (* Second program: *)
    fQ[n_] := PrimePi[ 2NextPrime[n/2]] != PrimePi[n];
    Select[ Prime@ Range@ 105, fQ]
  • PARI
    is(n)=nextprime(n+1)<2*nextprime(n/2) && isprime(n) \\ Charles R Greathouse IV, Apr 24 2015

Formula

As a set, this sequence = A000040 \ A059788 = A000040 \ prevprime(2*A000040) = A000040 \ A151799(A005843(A000040)). - Peter Munn, Oct 30 2017

Extensions

Definition clarified and simplified by Jonathan Sondow, Oct 25 2011

A141232 Overpseudoprimes to base 2: composite k such that k = A137576((k-1)/2).

Original entry on oeis.org

2047, 3277, 4033, 8321, 65281, 80581, 85489, 88357, 104653, 130561, 220729, 253241, 256999, 280601, 390937, 458989, 486737, 514447, 580337, 818201, 838861, 877099, 916327, 976873, 1016801, 1082401, 1145257, 1194649, 1207361, 1251949, 1252697, 1325843
Offset: 1

Views

Author

Vladimir Shevelev, Jun 16 2008

Keywords

Comments

Numbers are found by prime factorization of numbers from A001262 and a simple testing of the conditions indicated in comment to A141216.
All composite Mersenne numbers (A001348), Fermat numbers (A000215) and squares of Wieferich primes (A001220) are in this sequence. - Vladimir Shevelev, Jul 15 2008
C. Pomerance proved that this sequence is infinite (see Theorem 4 in the third reference). - Vladimir Shevelev, Oct 29 2011
Odd composite numbers k such that ord(2,k) * ((Sum_{d|k} phi(d)/ord(2,d)) - 1) = k-1, where phi = A000010 and ord(2,d) is the multiplicative order of 2 modulo d. - Jianing Song, Nov 13 2021

Crossrefs

Programs

  • Mathematica
    A137576[n_] := Module[{t}, (t = MultiplicativeOrder[2, 2 n + 1])* DivisorSum[2 n + 1, EulerPhi[#]/MultiplicativeOrder[2, #]&] - t + 1];
    okQ[n_] := n > 1 && CompositeQ[n] && n == A137576[(n-1)/2];
    Reap[For[k = 2, k < 2*10^6, k++, If[okQ[k], Print[k]; Sow[k]]]][[2, 1]] (* Jean-François Alcover, Jan 11 2019, from PARI *)
  • PARI
    f(n)=my(t); sumdiv(2*n+1, d, eulerphi(d)/(t=znorder(Mod(2, d))))*t-t+1; \\ A137576
    isok(n) = (n>1) && !isprime(n) && (n == f((n-1)/2)); \\ Michel Marcus, Oct 05 2018

Formula

Sum_{n:a(n)<=x} 1 <= x^(3/4)(1+o(1)).

Extensions

Name edited by Michel Marcus, Oct 05 2018

A164288 Members of A164368 which are not Ramanujan primes.

Original entry on oeis.org

109, 137, 191, 197, 283, 521, 617, 683, 907, 991, 1033, 1117, 1319, 1493, 1619, 1627, 1697, 1741, 1747, 1801, 1931, 1949, 2011, 2111, 2143, 2153, 2293, 2417, 2539, 2543, 2549, 2591, 2621, 2837, 2927, 2953, 2969, 3079, 3119, 3187, 3203, 3329, 3389, 3407
Offset: 1

Views

Author

Vladimir Shevelev, Aug 12 2009

Keywords

Comments

Every lesser of twin primes (A001359), beginning with 137, which is not in A104272, is in the sequence. [From Vladimir Shevelev, Aug 31 2009]

Examples

			p=137 is the least lesser of twin primes which is not a Ramanujan prime. Therefore it is in the sequence. [From _Vladimir Shevelev_, Aug 31 2009]
		

Crossrefs

Programs

  • Mathematica
    nn = 250;
    A164368 = Select[Prime[Range[2 nn]], PrimePi[2 NextPrime[#/2]] != PrimePi[#]&];
    Rama = Table[0, {nn}]; s = 0; Do[If[PrimeQ[k], s++]; If[PrimeQ[k/2], s--]; If[s < nn, Rama[[s+1]] = k], {k, Prime[3 nn]}];
    A104272 = Rama+1;
    Complement[A164368, A104272] (* Jean-François Alcover, Oct 27 2018, after T. D. Noe in A104272 *)

Formula

Extensions

I added 521. - Vladimir Shevelev, Aug 17 2009
Redefined in terms of A164368 and extended by R. J. Mathar, Aug 18 2009
Showing 1-10 of 78 results. Next