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 51-60 of 433 results. Next

A111206 Semi-Sophie Germain semiprimes: semiprimes which are the product of Sophie Germain primes.

Original entry on oeis.org

4, 6, 9, 10, 15, 22, 25, 33, 46, 55, 58, 69, 82, 87, 106, 115, 121, 123, 145, 159, 166, 178, 205, 226, 249, 253, 262, 265, 267, 319, 339, 346, 358, 382, 393, 415, 445, 451, 466, 478, 502, 519, 529, 537, 562, 565, 573, 583, 586, 655, 667, 699, 717, 718, 753, 838
Offset: 1

Views

Author

Christopher M. Tomaszewski (cmt1288(AT)comcast.net), Oct 24 2005

Keywords

Comments

Define an n-almost Sophie Germain almost-prime to be an n-almost prime all the prime factors of which are Sophie Germain primes. Note the contrast between this terminology and that of Sophie Germain n-almost primes, they are different.

Examples

			a(4) = 10 because 10 is the 4th semiprime both the prime factors of which are Sophie Germain primes.
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[If[Plus@@Last/@FactorInteger[n]==2,a=First/@FactorInteger[n];b=a[[1]];k=0;If[Length[a]==2,c=a[[2]];If[ !PrimeQ[2*c+1],k=1]];If[PrimeQ[2*b+1]&&k==0,AppendTo[lst,n]]],{n,7!}];lst (* Vladimir Joseph Stephan Orlovsky, Feb 27 2009 *)
    Module[{nn=100,sgp},sgp=Select[Prime[Range[100]],PrimeQ[2#+1]&];Select[ Union[ Times@@@Tuples[sgp,2]],#<=10nn&]] (* Harvey P. Dale, May 08 2019 *)
  • PARI
    list(lim)=my(v=List(),u=v,t); forprime(p=2,lim\2, if(isprime(2*p+1), listput(u,p))); for(i=1,#u, for(j=1,i, t=u[i]*u[j]; if(t>lim, break); listput(v,t))); Set(v) \\ Charles R Greathouse IV, Feb 05 2017

Extensions

Extended by Ray Chandler, Oct 31 2005

A124485 Numbers n such that 2n-1 and 4n-1 are primes.

Original entry on oeis.org

2, 3, 6, 12, 15, 21, 27, 42, 45, 57, 66, 87, 90, 96, 117, 120, 126, 141, 147, 180, 210, 216, 222, 246, 255, 297, 321, 327, 330, 342, 360, 372, 381, 405, 456, 477, 507, 510, 516, 525, 552, 612, 615, 645, 705, 720, 726, 741, 750, 756, 780, 792, 801, 867, 906, 945
Offset: 1

Views

Author

Artur Jasinski, Nov 04 2006

Keywords

Crossrefs

Cf. A005384 (Sophie Germain primes).

Programs

  • GAP
    Filtered([1..1000],p->IsPrime(2*p-1) and IsPrime(4*p-1)); # Muniru A Asiru, Jul 19 2018
  • Maple
    select(k->isprime(2*k-1) and isprime(4*k-1),[$1..1000]); # Muniru A Asiru, Jul 19 2018
  • Mathematica
    Select[Range[1000], And @@ PrimeQ /@ ({2, 4}*# - 1) &] (* Ray Chandler, Nov 21 2006 *)

Formula

a(n) = (A005384(n+1) + 1)/2. - Hilko Koning, Jul 19 2018

Extensions

Extended by Ray Chandler, Nov 21 2006

A209253 Number of ways to write 2n-1 as the sum of a Sophie Germain prime and a practical number.

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 3, 3, 4, 3, 5, 2, 3, 4, 4, 4, 5, 2, 3, 5, 2, 4, 7, 4, 2, 6, 2, 5, 6, 2, 2, 6, 1, 3, 7, 4, 3, 7, 4, 5, 8, 2, 3, 8, 3, 3, 8, 4, 4, 7, 4, 5, 8, 3, 4, 7, 1, 5, 9, 5, 3, 9, 3, 4, 8, 4, 3, 9, 3, 5, 8, 2, 2, 9, 4, 3, 8, 4, 4, 10, 1, 3, 10, 5, 4, 10, 4, 3, 9, 5, 5, 10, 4
Offset: 1

Views

Author

Zhi-Wei Sun, Jan 14 2013

Keywords

Comments

Conjecture: a(n)>0 for all n>1.
This has been verified for n up to 5*10^6.

Examples

			a(40)=1 since 2*40-1=23+56 with 23 a Sophie Germain prime and 56 a practical number.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=f[n]=FactorInteger[n]
    Pow[n_,i_]:=Pow[n,i]=Part[Part[f[n],i],1]^(Part[Part[f[n],i],2])
    Con[n_]:=Con[n]=Sum[If[Part[Part[f[n],s+1],1]<=DivisorSigma[1,Product[Pow[n,i],{i,1,s}]]+1,0,1],{s,1,Length[f[n]]-1}]
    pr[n_]:=pr[n]=n>0&&(n<3||Mod[n,2]+Con[n]==0)
    a[n_]:=a[n]=Sum[If[PrimeQ[2Prime[k]+1]==True&&pr[2n-1-Prime[k]]==True,1,0],{k,1,PrimePi[2n-1]}]
    Do[Print[n," ",a[n]],{n,1,100}]

A002174 Values taken by reduced totient function psi(n).

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 12, 16, 18, 20, 22, 24, 28, 30, 32, 36, 40, 42, 44, 46, 48, 52, 54, 56, 58, 60, 64, 66, 70, 72, 78, 80, 82, 84, 88, 90, 92, 96, 100, 102, 104, 106, 108, 110, 112, 116, 120, 126, 128, 130, 132, 136, 138, 140, 144, 148, 150, 156, 160, 162, 164, 166, 168
Offset: 1

Views

Author

Keywords

Comments

If p is a Sophie Germain prime (A005384), then 2p is here. - T. D. Noe, Aug 13 2008
Terms of A002322, sorted and multiple values taken just once. - Vladimir Joseph Stephan Orlovsky, Jul 21 2009
a(2445343) = 10^7, suggesting that Luca & Pomerance's lower bound may be closer to the truth than the upper bound. The fit exponent log a(n)/log n - 1 = 0.0957... in this case. - Charles R Greathouse IV, Jul 02 2017

References

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

Crossrefs

Programs

  • Mathematica
    lst={}; Do[AppendTo[lst, CarmichaelLambda[n]], {n, 6*7!}]; lst; Take[Union[lst], 123] (* Vladimir Joseph Stephan Orlovsky, Jul 21 2009 *)
    (* warning: there seems to be no guarantee that no terms near the end are omitted! - Joerg Arndt, Dec 23 2014 *)
    TakeWhile[Union@ Table[CarmichaelLambda@ n, {n, 10^6}], # <= 168 &] (* Michael De Vlieger, Mar 19 2016 *)
  • PARI
    list(lim)=my(v=List([1]),u,t); forprime(p=3,lim\3+1, u=List(); listput(u,p-1); while((t=u[#u]*p)<=lim, listput(u,t)); for(j=1,#v, for(i=1,#u, t=lcm(u[i],v[j]); if(t<=lim && t!=v[j], listput(v,t)))); v=List(Set(v))); forprime(p=lim\3+2,lim+1, listput(v,p-1)); v=List(Set(v)); for(i=1,#v, t=2*v[i]; if(t>lim, break); listput(v,t); while((t*=2)<=lim, listput(v,t))); Set(v) \\ Charles R Greathouse IV, Jun 23 2017
    
  • PARI
    is(n)=if(n%2, return(n==1)); my(f=factor(n),pe); for(i=1,#f~, if(n%(f[i,1]-1)==0, next); pe=f[i,1]^f[i,2]; forstep(q=2*pe+1,n+1,2*pe, if(n%(q-1)==0 && isprime(q), next(2))); return(0)); 1 \\ Charles R Greathouse IV, Jun 25 2017

Formula

n (log n)^0.086 << a(n) << n (log n)^0.36 where << is the Vinogradov symbol, see Luca & Pomerance. - Charles R Greathouse IV, Dec 28 2013

Extensions

More terms from T. D. Noe, Aug 13 2008

A059761 Initial primes of Cunningham chains of first type with length exactly 2. Primes in A059453 that survive as primes only one "2p-1 iteration", forming chains of exactly 2 terms.

Original entry on oeis.org

3, 29, 53, 113, 131, 173, 191, 233, 239, 251, 281, 293, 419, 431, 443, 491, 593, 641, 653, 659, 683, 743, 761, 809, 911, 953, 1013, 1049, 1103, 1223, 1289, 1499, 1559, 1583, 1601, 1733, 1973, 2003, 2069, 2129, 2141, 2273, 2339, 2351, 2393, 2399, 2543
Offset: 1

Views

Author

Labos Elemer, Feb 20 2001

Keywords

Comments

Primes p such that {(p-1)/2, p, 2p+1, 4p+3} = {composite, prime, prime, composite}.

Examples

			53 is a term because 26 and 215 are composites, and 53 and 107 are primes.
		

Crossrefs

Programs

  • Mathematica
    ccftQ[p_]:=Boole[PrimeQ[{(p-1)/2,p,2 p+1,4 p+3}]]=={0,1,1,0}; Select[ Prime[ Range[400]],ccftQ] (* Harvey P. Dale, Jun 19 2021 *)

A054639 Queneau numbers: numbers n such that the Queneau-Daniel permutation {1, 2, 3, ..., n} -> {n, 1, n-1, 2, n-2, 3, ...} is of order n.

Original entry on oeis.org

1, 2, 3, 5, 6, 9, 11, 14, 18, 23, 26, 29, 30, 33, 35, 39, 41, 50, 51, 53, 65, 69, 74, 81, 83, 86, 89, 90, 95, 98, 99, 105, 113, 119, 131, 134, 135, 146, 155, 158, 173, 174, 179, 183, 186, 189, 191, 194, 209, 210, 221, 230, 231, 233, 239
Offset: 1

Views

Author

Gilles Esposito-Farese (gef(AT)cpt.univ-mrs.fr), May 17 2000

Keywords

Comments

The troubadour Arnaut Daniel composed sestinas based on the permutation 123456 -> 615243, which cycles after 6 iterations.
Roubaud quotes the number 141, but the corresponding Queneau-Daniel permutation is only of order 47 = 141/3.
This appears to coincide with the numbers n such that a type-2 optimal normal basis exists for GF(2^n) over GF(2). But are these two sequences really the same? - Joerg Arndt, Feb 11 2008
The answer is Yes - see Theorem 2 of the Dumas reference. [Jean-Guillaume Dumas (Jean-Guillaume.Dumas(AT)imag.fr), Mar 20 2008]
From Peter R. J. Asveld, Aug 17 2009: (Start)
a(n) is the n-th T-prime (Twist prime). For N >= 2, the family of twist permutations is defined by
p(m,N) == +2m (mod 2N+1) if 1 <= m < k = ceiling((N+1)/2),
p(m,N) == -2m (mod 2N+1) if k <= m < N.
N is T-prime if p(m,N) consists of a single cycle of length N.
The twist permutation is the inverse of the Queneau-Daniel permutation.
N is T-prime iff p=2N+1 is a prime number and exactly one of the following three conditions holds;
(1) N == 1 (mod 4) and +2 generates Z_p^* (the multiplicative group of Z_p) but -2 does not,
(2) N == 2 (mod 4) and both +2 and -2 generate Z_p^*,
(3) N == 3 (mod 4) and -2 generate Z_p^* but +2 does not. (End)
The sequence name says the permutation is of order n, but P. R. J. Asveld's comment says it's an n-cycle. Is there a proof that those conditions are equivalent for the Queneau-Daniel permutation? (They are not equivalent for any arbitrary permutation; e.g., (123)(45)(6) has order 6 but isn't a 6-cycle.) More generally, I have found that for all n <= 9450, (order of Queneau-Daniel permutation) = (length of orbit of 1) = A003558(n). Does this hold for all n? - David Wasserman, Aug 30 2011

Examples

			For N=6 and N=7 we obtain the permutations (1 2 4 5 3 6) and (1 2 4 7)(3 6)(5): 6 is T-prime, but 7 is not. - _Peter R. J. Asveld_, Aug 17 2009
		

References

  • Raymond Queneau, Note complémentaire sur la Sextaine, Subsidia Pataphysica 1 (1963), pp. 79-80.
  • Jacques Roubaud, Bibliothèque Oulipienne No 65 (1992) and 66 (1993).

Crossrefs

Not to be confused with Queneau's "s-additive sequences", see A003044.
A005384 is a subsequence.
Union of A163782 (Josephus_2-primes) and A163781 (dual Josephus_2-primes); also the union of A163777 (Archimedes_0-primes) and A163778 (Archimedes_1-primes); also the union of A071642/2 (shuffle primes) and A163776/2 (dual shuffle primes). - Peter R. J. Asveld, Aug 17 2009
Cf. A216371, A003558 (for which a(n) == n).

Programs

  • Maple
    QD:= proc(n) local i;
      if n::even then map(op,[seq([n-i,i+1],i=0..n/2-1)])
      else map(op, [seq([n-i,i+1],i=0..(n-1)/2-1),[(n+1)/2]])
      fi
    end proc:
    select(n -> GroupTheory:-PermOrder(Perm(QD(n)))=n, [$1..1000]); # Robert Israel, May 01 2016
  • Mathematica
    a[p_] := Sum[Cos[2^n Pi/((2 p + 1) )], {n, 1, p}];
    Select[Range[500],Reduce[a[#] == -1/2, Rationals] &] (* Gerry Martens, May 01 2016 *)
  • PARI
    is(n)=
    {
        if (n==1, return(1));
        my( m=n%4 );
        if ( m==4, return(0) );
        my(p=2*n+1, r=znorder(Mod(2,p)));
        if ( !isprime(p), return(0) );
        if ( m==3 && r==n, return(1) );
        if ( r==2*n, return(1) ); \\ r == 1 or 2
        return(0);
    }
    for(n=1,10^3, if(is(n),print1(n,", ")) );
    \\ Joerg Arndt, May 02 2016

Formula

a(n) = (A216371(n)-1)/2. - L. Edson Jeffery, Dec 18 2012
a(n) >> n log n, and on the Bateman-Horn-Stemmler conjecture a(n) << n log^2 n. I imagine a(n) ≍ n log n, and numerics suggest that perhaps a(n) ~ kn log n for some constant k (which seems to be around 1.122). - Charles R Greathouse IV, Aug 02 2023

A233547 a(n) = |{0 < k < n/2: phi(k)*phi(n-k) - 1 and phi(k)*phi(n-k) + 1 are both prime}|, where phi(.) is Euler's totient function.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 2, 1, 3, 4, 3, 2, 3, 2, 3, 1, 1, 2, 1, 5, 2, 3, 1, 2, 1, 1, 3, 4, 5, 4, 3, 2, 3, 2, 5, 2, 5, 5, 3, 5, 3, 1, 5, 3, 7, 6, 3, 2, 4, 7, 5, 1, 4, 6, 6, 5, 2, 4, 6, 9, 9, 6, 8, 5, 8, 8, 6, 6, 9, 4, 8, 6, 8, 5, 7, 9, 7, 9, 5, 7, 3, 9, 5, 6, 7, 7, 10, 5, 12, 7, 5, 7, 5, 7, 5, 7, 8, 4, 7, 13
Offset: 1

Views

Author

Zhi-Wei Sun, Dec 12 2013

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 5.
(ii) For any n > 3, sigma(k)*phi(n-k) - 1 and sigma(k)*phi(n-k) + 1 are both prime for some 0 < k < n, where sigma(k) is the sum of all (positive) divisors of k.
(iii) For any n > 5 not equal to 35, there is a positive integer k < n such that phi(k)*phi(n-k) - 1 is a Sophie Germain prime.
Note that part (i) implies the twin prime conjecture. We have verified it for n up to 10^7.

Examples

			a(6) = 1 since phi(1)*phi(5) = 1*4 = 4 with 4 - 1 and 4 + 1 twin primes.
a(8) = 1 since phi(1)*phi(7) = 1*6 = 6 with 6 - 1 and 6 + 1 twin primes.
a(16) = 1 since phi(2)*phi(14) = 1*6 = 6 with 6 - 1 and 6 + 1 twin primes.
a(17) = 1 since phi(3)*phi(14) = 2*6 = 12 with 12 - 1 and 12 + 1 twin primes.
a(19) = 1 since phi(1)*phi(18) = 1*6 = 6 with 6 - 1 and 6 + 1 twin primes.
a(23) = 1 since phi(2)*phi(21) = 1*12 = 12 with 12 - 1 and 12 + 1 twin primes.
a(25) = 1 since phi(11)*phi(14) = 10*6 = 60 with 60 - 1 and 60 + 1 twin primes.
a(26) = 1 since phi(7)*phi(19) = 6*18 = 108 with 108 - 1 and 108 + 1 twin primes.
a(42) = 1 since phi(14)*phi(28) = 6*12 = 72 with 72 - 1 and 72 +1 twin primes.
a(52) = 1 since phi(14)*phi(38) = 6*18 = 108 with 108 - 1 and 108 + 1 twin primes.
		

Crossrefs

Programs

  • Mathematica
    TQ[n_]:=PrimeQ[n-1]&&PrimeQ[n+1]
    a[n_]:=Sum[If[TQ[EulerPhi[k]*EulerPhi[n-k]],1,0],{k,1,(n-1)/2}]
    Table[a[n],{n,1,100}]

A035096 a(n) is the smallest k such that prime(n)*k+1 is prime.

Original entry on oeis.org

1, 2, 2, 4, 2, 4, 6, 10, 2, 2, 10, 4, 2, 4, 6, 2, 12, 6, 4, 8, 4, 4, 2, 2, 4, 6, 6, 6, 10, 2, 4, 2, 6, 4, 8, 6, 10, 4, 14, 2, 2, 6, 2, 4, 18, 4, 10, 12, 24, 12, 2, 2, 6, 2, 6, 6, 8, 6, 4, 2, 6, 2, 4, 6, 6, 26, 6, 10, 6, 10, 14, 2, 6, 4, 12, 12, 24, 6, 8, 4, 2, 10, 2, 4, 10, 2, 8, 30
Offset: 1

Views

Author

Keywords

Comments

These arithmetic progressions have prime differences. Note that both the terms of generated by this k values and the differences are primes as well.
This is one possible generalization of "the least prime problem in special arithmetic progressions" when n in the nk+1 form is replaced by n-th prime number.
Note that Dirichlet's theorem on primes in arithmetic progressions implies that a(n) always exists. - Max Alekseyev, Jul 11 2008
If a(n)=2, prime(n) is a Sophie Germain prime (A005384). Among the first 10^6 terms, the largest is a(330408) = 234. - Zak Seidov, Jan 28 2012

Examples

			a(15)=6 because the 15th prime is 47, and the smallest k such that 47k+1 is prime is k=6, for which 47k+1=283.
		

Crossrefs

Smallest k such that k*n+1 is prime is A034693.
Sophie Germain primes are in A005384.
Cf. A000040, A035095. - Zak Seidov, Dec 27 2013
Cf. A117673.

Programs

  • Magma
    S:=[];
    k:=1;
    for n in [1..90] do
      while not IsPrime(k*NthPrime(n)+1) do
           k:=k+1;
      end while;
      Append(~S, k);
      k:=1;
    end for;
    S; // Bruno Berselli, Apr 18 2013
    
  • Mathematica
    Reap[Sow[1]; Do[p = Prime[n]; k = 2; While[! PrimeQ[k*p + 1], k = k + 2]; Sow[k], {n, 2, 10^4}]][[2, 1]] (* Zak Seidov, Jan 28 2012 *)
    f[n_] := Block[{p = Prime@ n}, q = 1 + 2p; While[ !PrimeQ@ q, q += 2p]; (q - 1)/p]; f[1] = 1; Array[f, 88] (* Robert G. Wilson v, Dec 27 2014 *)
  • PARI
    a(n) = if(n == 1, 1, my(t = 2*prime(n), m = t + 1); while(!isprime(m), m += t); 2*(m - 1)/t); \\ Amiram Eldar, Mar 19 2025

Formula

a(n) = (A035095(n)-1)/A000040(n). - Zak Seidov, Dec 27 2013

A059788 a(n) = largest prime < 2*prime(n).

Original entry on oeis.org

3, 5, 7, 13, 19, 23, 31, 37, 43, 53, 61, 73, 79, 83, 89, 103, 113, 113, 131, 139, 139, 157, 163, 173, 193, 199, 199, 211, 211, 223, 251, 257, 271, 277, 293, 293, 313, 317, 331, 337, 353, 359, 379, 383, 389, 397, 421, 443, 449, 457, 463, 467, 479, 499, 509, 523
Offset: 1

Views

Author

Labos Elemer, Feb 22 2001

Keywords

Comments

Also, smallest member of the first pair of consecutive primes such that between them is a composite number divisible by the n-th prime. - Amarnath Murthy, Sep 25 2002
Except for its initial term, A006992 is a subsequence based on iteration of n -> A151799(2n). The range of this sequence is a subset of A065091. - M. F. Hasler, May 08 2016

Examples

			n=18: p(18)=61, so a(18) is the largest prime below 2*61=122, which is 113.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    A059788 := proc(n)
        prevprime(2*ithprime(n)) ;
    end proc:
    seq(A059788(n),n=1..50) ; # R. J. Mathar, May 08 2016
  • Mathematica
    a[n_] := Prime[PrimePi[2Prime[n]]]
    NextPrime[2*Prime[Range[100]], -1] (* Zak Seidov, May 08 2016 *)
  • PARI
    a(n) = precprime(2*prime(n)); \\ Michel Marcus, May 08 2016

Formula

a(n) = A007917(A100484(n)). - R. J. Mathar, May 08 2016

A156592 Product p*q of two primes with q = 2*p + 1.

Original entry on oeis.org

10, 21, 55, 253, 1081, 1711, 3403, 5671, 13861, 15931, 25651, 34453, 60031, 64261, 73153, 108811, 114481, 126253, 158203, 171991, 258121, 351541, 371953, 392941, 482653, 518671, 703891, 822403, 853471, 869221, 933661, 1034641, 1104841
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 10 2009

Keywords

Comments

Subsequence of A068443.
Products of Sophie Germain primes p with their corresponding safe primes 2p+1. The smallest prime factor of a(n) is (a(n) - phi(a(n)))/3 and the largest prime factor of a(n) is 2(a(n) - phi(a(n)))/3 + 1. - Wesley Ivan Hurt, Oct 03 2013

Crossrefs

Cf. A005384, A005385. Subset of A001358.

Programs

Formula

a(n) = A005384(n)*A005385(n).
Previous Showing 51-60 of 433 results. Next