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 23 results. Next

A191592 Numbers in A191311 but not in A129521.

Original entry on oeis.org

4, 11305, 13981, 23001, 30889, 39865, 68101, 88561, 91001, 93961, 107185, 137149, 152551, 157641, 176149, 204001, 228241, 251251, 276013, 401401, 464185, 493697, 493885, 534061, 563473, 574561, 622909, 631351, 683761, 786961, 915981, 950797, 1106785, 1141141
Offset: 1

Views

Author

Jason Holt, Jun 04 2011

Keywords

Crossrefs

Extensions

More terms from David W. Wilson, Aug 16 2011

A351875 Positive difference of the distinct prime factors of A129521(n).

Original entry on oeis.org

1, 2, 6, 18, 30, 36, 78, 96, 138, 156, 198, 210, 228, 270, 306, 330, 336, 366, 378, 438, 498, 546, 576, 600, 606, 618, 660, 690, 726, 810, 828, 876, 936, 966, 996, 1008, 1068, 1170, 1236, 1278, 1296, 1398, 1428, 1458, 1530, 1608, 1626, 1656, 1758, 1866, 2010, 2028, 2088, 2130
Offset: 1

Views

Author

Wesley Ivan Hurt, Feb 22 2022

Keywords

Examples

			a(4) = 18; A005383(4) - A005382(4) = 37 - 19 = 18.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[350]], PrimeQ[2*# - 1] &] - 1 (* Amiram Eldar, Feb 23 2022 *)

Formula

a(n) = A005383(n) - A005382(n).
a(n) = A005382(n) - 1. - Amiram Eldar, Feb 23 2022

A005382 Primes p such that 2p-1 is also prime.

Original entry on oeis.org

2, 3, 7, 19, 31, 37, 79, 97, 139, 157, 199, 211, 229, 271, 307, 331, 337, 367, 379, 439, 499, 547, 577, 601, 607, 619, 661, 691, 727, 811, 829, 877, 937, 967, 997, 1009, 1069, 1171, 1237, 1279, 1297, 1399, 1429, 1459, 1531, 1609, 1627, 1657, 1759, 1867, 2011
Offset: 1

Views

Author

Keywords

Comments

Sequence gives values of p such Sum_{i=1..p} gcd(p,i) = A018804(p) is prime. - Benoit Cloitre, Jan 25 2002
Let q = 2n-1. For these n (and q), the sum of two cyclotomic polynomials can be written as a product of cyclotomic polynomials and as a cyclotomic polynomial in x^2: Phi(q,x) + Phi(2q,x) = 2 Phi(n,x) Phi(2n,x) = 2 Phi(n,x^2). - T. D. Noe, Nov 04 2003
Primes in A006254. - Zak Seidov, Mar 26 2013
If a(n) is in A168421 then A005383(n) is a twin prime with a Ramanujan prime, A005383(n) - 2. If this sequence has an infinite number of terms in A168421, then the twin prime conjecture can be proved. - John W. Nicholson, Dec 05 2013
Records subsequence of A023509 (n >= 2). - David James Sycamore, May 05 2025

References

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

Crossrefs

Cf. A010051, A000040, A053685 (subsequence), A006254.
Cf. A023509.

Programs

  • Haskell
    a005382 n = a005382_list !! (n-1)
    a005382_list = filter
       ((== 1) . a010051 . (subtract 1) . (* 2)) a000040_list
    -- Reinhard Zumkeller, Oct 03 2012
    
  • Magma
    [n: n in [0..1000] | IsPrime(n) and IsPrime(2*n-1)]; // Vincenzo Librandi, Nov 18 2010
    
  • Maple
    f := proc(Q) local t1,i,j; t1 := []; for i from 1 to 500 do j := ithprime(i); if isprime(2*j-Q) then t1 := [op(t1),j]; fi; od: t1; end; f(1);
    # second Maple program:
    q:= p-> andmap(isprime, [p, 2*p-1]):
    select(q, [$2..2500])[];  # Alois P. Heinz, Dec 16 2024
  • Mathematica
    Select[Prime[Range[300]], PrimeQ[2#-1]&]
  • PARI
    select(p->isprime(2*p-1),primes(500)) \\ Charles R Greathouse IV, Apr 26 2012
    
  • PARI
    forprime(n=2, 10^3, if(ispseudoprime(2*n-1), print1(n, ", "))) \\ Felix Fröhlich, Jun 15 2014

Formula

a(n) = A129521(n) / A005383(n). - Reinhard Zumkeller, Apr 19 2007
a(n) = (A005383(n) + 1)/2. - Zak Seidov, Nov 04 2010

A005383 Primes p such that (p+1)/2 is prime.

Original entry on oeis.org

3, 5, 13, 37, 61, 73, 157, 193, 277, 313, 397, 421, 457, 541, 613, 661, 673, 733, 757, 877, 997, 1093, 1153, 1201, 1213, 1237, 1321, 1381, 1453, 1621, 1657, 1753, 1873, 1933, 1993, 2017, 2137, 2341, 2473, 2557, 2593, 2797, 2857, 2917, 3061, 3217, 3253
Offset: 1

Views

Author

Keywords

Comments

Also, n such that sigma(n)/2 is prime. - Joseph L. Pe, Dec 10 2001; confirmed by Vladeta Jovovic, Dec 12 2002
Primes that are followed by twice a prime, i.e., are followed by a semiprime. (For primes followed by two semiprimes, see A036570.) - Zak Seidov, Aug 03 2013, Dec 31 2015
If A005382(n) is in A168421 then a(n) is a twin prime with a Ramanujan prime, A104272(k) = a(n) - 2. - John W. Nicholson, Jan 07 2016
Starting with 13 all terms are congruent to 1 mod 12. - Zak Seidov, Feb 16 2017
Numbers n such that both n and n+12 are terms are 61, 661, 1201, 4261, 5101, 6121, 6361 (all congruent to 1 mod 60). - Zak Seidov, Mar 16 2017
Primes p for which there exists a prime q < p such that 2q == 1 (mod p). Proof: q = (p + 1)/2. - David James Sycamore, Nov 10 2018
Prime numbers n such that phi(sigma(2n)) = phi(2n), excluding n=3 and n=5; as well as phi(sigma(3n)) = phi(3n), excluding n=3 only. - Richard R. Forberg, Dec 22 2020

Examples

			Both 3 and (3+1)/2 = 2 are primes, both 5 and (5+1)/2 = 3 are primes. - _Zak Seidov_, Nov 19 2012
		

References

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

Crossrefs

A subsequence of A000040 which has A036570 as subsequence.

Programs

  • Haskell
    a005383 n = a005383_list !! (n-1)
    a005383_list = [p | p <- a065091_list, a010051 ((p + 1) `div` 2) == 1]
    -- Reinhard Zumkeller, Nov 06 2012
    
  • MATLAB
    LIMIT = 8000 % Find all members of A005383 less than LIMIT A = primes(LIMIT); n = length(A); %n is number of primes less than LIMIT B = 2*A - 1; C = ones(n, 1)*A; %C is an n X n matrix, with C(i, j) = j-th prime D = B'*ones(1, n); %D is an n X n matrix, with D(i, j) = (i-th prime)*2 - 1 [i, j] = find(C == D); A(j)
    
  • Magma
    [n: n in [1..3300] | IsPrime(n) and IsPrime((n+1) div 2) ]; // Vincenzo Librandi, Sep 25 2012
    
  • Maple
    for n to 300 do
      X := ithprime(n);
    Y := ithprime(n+1);
    Z := 1/2 mod Y;
      if isprime(Z) then print(Y);
    end if:
    end do:
    # David James Sycamore, Nov 11 2018
  • Mathematica
    Select[Prime[Range[1000]], PrimeQ[(# + 1)/2] &] (* Zak Seidov, Nov 19 2012 *)
  • PARI
    A005383_list(n) = select(m->isprime(m\2+1),primes(n)[2..n]) \\ Charles R Greathouse IV, Sep 25 2012
    
  • Python
    from sympy import isprime
    [n for n in range(3, 5000) if isprime(n) and isprime((n + 1)//2)]
    # Indranil Ghosh, Mar 17 2017
    
  • Sage
    [n for n in prime_range(3, 1000) if is_prime((n + 1) // 2)]
    # F. Chapoton, Dec 17 2019

Formula

a(n) = A129521(n)/A005382(n). - Reinhard Zumkeller, Apr 19 2007
A000035(a(n))*A010051(a(n))*A010051((a(n)+1)/2) = 1. - Reinhard Zumkeller, Nov 06 2012
a(n) = 2*A005382(n) - 1. - Zak Seidov, Nov 19 2012
a(n) = A005382(n) + phi(A005382(n)) = A005382(n) + A000010(A005382(n)). - Torlach Rush, Mar 10 2014

Extensions

More terms from David Wasserman, Jan 18 2002
Name changed by Jianing Song, Nov 27 2021

A020136 Fermat pseudoprimes to base 4.

Original entry on oeis.org

15, 85, 91, 341, 435, 451, 561, 645, 703, 1105, 1247, 1271, 1387, 1581, 1695, 1729, 1891, 1905, 2047, 2071, 2465, 2701, 2821, 3133, 3277, 3367, 3683, 4033, 4369, 4371, 4681, 4795, 4859, 5461, 5551, 6601, 6643, 7957, 8321, 8481, 8695, 8911, 9061, 9131
Offset: 1

Views

Author

Keywords

Comments

If q and 2q-1 are odd primes, then n=q*(2q-1) is in the sequence. So for n>1, A005382(n)*(2*A005382(n)-1) form a subsequence (cf. A129521). - Farideh Firoozbakht, Sep 12 2006
Primes q and 2q-1 are a Cunningham chain of the second kind. - Walter Nissen, Sep 07 2009
Composite numbers n such that 4^(n-1) == 1 (mod n). - Michel Lagneau, Feb 18 2012

Crossrefs

Subsequence of A122781.
Contains A001567 (Fermat pseudoprimes to base 2) as a subsequence.

Programs

  • Mathematica
    Select[Range[9200], ! PrimeQ[ # ] && PowerMod[4, # - 1, # ] == 1 &] (* Farideh Firoozbakht, Sep 12 2006 *)
  • PARI
    isok(n) = (Mod(4, n)^(n-1)==1) && !isprime(n) && (n>1); \\ Michel Marcus, Apr 27 2018

A122781 Nonprimes n such that 4^n==4 (mod n).

Original entry on oeis.org

1, 4, 6, 12, 15, 28, 66, 85, 91, 186, 276, 341, 435, 451, 532, 561, 645, 703, 946, 1068, 1105, 1247, 1271, 1387, 1581, 1695, 1729, 1891, 1905, 2044, 2046, 2047, 2071, 2465, 2701, 2821, 2926, 3133, 3277, 3367, 3683, 4033, 4369, 4371, 4681, 4795
Offset: 1

Views

Author

Farideh Firoozbakht, Sep 12 2006

Keywords

Comments

If both numbers q and 2q-1 are prime, then q*(2q-1) is in the sequence. So, A005382(n)*(2*A005382(n)-1) = A129521(n) form a subsequence.

Crossrefs

Contains A020136, A001567, A006935 (except n=2), and A129521 as subsequences.
Cf. A005382.

Programs

  • Maple
    for n from 1 to 5000 do if 4^n mod n = 4 mod n and not isprime(n) then print(n) fi od; # Gary Detlefs, May 14 2012
  • Mathematica
    Select[Range[4800], ! PrimeQ[ # ] && Mod[4^#, # ] == Mod[4, # ] &]
    Join[{1,4},Select[Range[5000],!PrimeQ[#]&&PowerMod[4,#,#]==4&]] (* Harvey P. Dale, Apr 09 2018 *)

A129512 Numbers with at least two pairs of distinct divisors having equal differences.

Original entry on oeis.org

6, 12, 15, 18, 20, 24, 28, 30, 36, 40, 42, 45, 48, 54, 56, 60, 63, 66, 70, 72, 75, 78, 80, 84, 88, 90, 91, 96, 99, 100, 102, 105, 108, 110, 112, 114, 120, 126, 130, 132, 135, 138, 140, 144, 150, 153, 156, 160, 162, 165, 168, 174, 176, 180, 182, 186, 189, 190, 192, 195
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 19 2007

Keywords

Examples

			See example for a(12) = 45 in A129510.
		

Crossrefs

Cf. A129510, A066446, A129511 (complement).
Subsequences: A008588, A008597, A129521, A259366.

Programs

  • Haskell
    import Data.List.Ordered (minus)
    a129512 n = a129512_list !! (n-1)
    a129512_list = minus [1..] a129511_list
    -- Reinhard Zumkeller, Aug 10 2015
    
  • Mathematica
    q[k_] := Count[Tally[Differences /@ Subsets[Divisors[k], {2}] // Flatten][[;; , 2]], ?(# > 1 &)] > 0; Select[Range[200], q] (* _Amiram Eldar, Jan 27 2025 *)
  • PARI
    is(n)=my(d=divisors(n)); for(i=1,#d-2, for(j=i+1,#d-1, for(k=1,#d, if(i!=k && setsearch(d, d[j]-d[i]+d[k]), return(1))))); 0 \\ Charles R Greathouse IV, Aug 26 2015

Formula

A129510(a(n)) < A066446(a(n)).

A191311 Numbers n such that exactly half of the a such that 0

Original entry on oeis.org

4, 6, 15, 91, 703, 1891, 2701, 11305, 12403, 13981, 18721, 23001, 30889, 38503, 39865, 49141, 68101, 79003, 88561, 88831, 91001, 93961, 104653, 107185, 137149, 146611, 152551, 157641, 176149, 188191, 204001, 218791, 226801, 228241
Offset: 1

Views

Author

Jason Holt, Jun 04 2011

Keywords

Comments

Values of n for which half the witnesses in the Fermat primality test are false.
When n=pq with p,q=2p-1 prime, a^(n-1) = 1 (mod p) iff a is a quadratic residue mod q. So A129521 is a subsequence. - Gareth McCaughan, Jun 05 2011
From Robert G. Wilson v, Aug 13 2011: (Start)
Number of terms less than 10^n: 2, 4, 5, 7, 22, 60, 129, 303, 690, 1785, …, .
In reference to the numbers in the b-file: (1) number of terms which have k>0 prime factors: 1, 1058, 139, 512, 339, 102, 6; (2) about half of the terms, 1058, are members of A129521, those which have just two prime factors; (3) except for the first term, all terms are squarefree, except for the first two terms, all terms are odd; and (4) most terms, more than 98.5%, are congruent to 1 modulo 6. (End)

Crossrefs

A063994 gives the number of false witnesses for every n.
A129521 is a subsequence. See also A191592.

Programs

  • Mathematica
    fQ[n_] := Block[{pf = First /@ FactorInteger@ n}, 2Times @@ GCD[n - 1, pf - 1] == n*Times @@ (1 - 1/pf)]; Select[ Range@ 250000, fQ] (* Robert G. Wilson v, Aug 08 2011 *)
  • Python
    import math
    for x in range(2, 1000):
      false_witnesses = 0
      relatively_prime_values = 0
      for y in range(x):
        if math.gcd(y, x) == 1:
          relatively_prime_values += 1
        if (pow(y, x-1, x) == 1):
          false_witnesses += 1
      if false_witnesses * 2 == relatively_prime_values:
        print(x, "is a Fermat Half-Prime")

Formula

Integers, n, such that A063994(n) = 2*A000010(n). - Robert G. Wilson v, Aug 13 2011

Extensions

Edited by N. J. A. Sloane, Jun 07 2011. I made use of a more explicit definition due to Gareth McCaughan, Jun 05 2011.

A259677 Octagonal numbers (A000567) that are semiprimes (A001358).

Original entry on oeis.org

21, 65, 133, 341, 481, 1541, 4033, 5461, 6533, 8321, 11041, 13333, 14981, 31621, 38081, 48133, 56033, 79381, 83333, 97921, 109061, 111361, 133141, 188501, 197633, 206981, 219781, 229633, 256961, 282133, 293281, 328021, 340033, 360533, 416641, 481601, 556421
Offset: 1

Views

Author

Colin Barker, Jul 03 2015

Keywords

Examples

			The octagonal number 21 is in the sequence because 21 = 3 * 7.
		

Crossrefs

Programs

  • Magma
    IsSemiprime:=func; [s: n in [2..500] | IsSemiprime(s) where s is n*(3*n-2) ]; // Vincenzo Librandi, Jul 04 2015
  • Mathematica
    a={}; Do[If[PrimeOmega[n (3 n - 2)]==2, AppendTo[a, n(3 n - 2)]], {n, 1, 200}]; a (* Vincenzo Librandi, Jul 04 2015 *)
    Select[PolygonalNumber[8,Range[500]],PrimeOmega[#]==2&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Sep 15 2019 *)
  • PARI
    pg(m, n) = (n^2*(m-2)-n*(m-4))/2 \\ n-th m-gonal number
    select(n->bigomega(n)==2, vector(2000, n, pg(8, n)))
    

Formula

Equals A000567 intersect A001358.

A226755 Numbers of the form p*q, p and q prime with q=2p-3.

Original entry on oeis.org

9, 35, 77, 209, 299, 527, 989, 1829, 2627, 3239, 3569, 5459, 8777, 9869, 13529, 18527, 20099, 22577, 25199, 31877, 37127, 48827, 55277, 64979, 72389, 73919, 88409, 98789, 107879, 115439, 125249, 137549, 159329, 192509, 200027, 218129, 239777, 277139, 353219
Offset: 1

Views

Author

Keywords

Comments

The smaller prime factor of a(n) = p = sopf(a(n))/3 + 1. The larger prime factor of a(n) = q = 2*sopf(a(n))/3 - 1. Furthermore, 2(sopf(a(n))/3 + 1) is representable as the sum of two primes in at least two ways since 2p = p + p = 3 + q. - Wesley Ivan Hurt, Jun 30 2013

Crossrefs

Programs

  • Mathematica
    fa = FactorInteger; t[n_]:=Length[fa[n]] == 2 && fa[n][[1,2]]== fa[n][[2, 2]] == 1 && 2 fa[n][[1, 1]]-3 == fa[n][[2, 1]]; Select[1+Range[200000], t]
  • PARI
    list(lim)=my(v=List(), q); forprime(p=2, (sqrt(8*lim+9)+3)\4, if(isprime(q=2*p-3), listput(v, p*q))); Vec(v) \\ Charles R Greathouse IV, Nov 19 2013

Extensions

a(1) added by Charles R Greathouse IV, Nov 19 2013
Showing 1-10 of 23 results. Next