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

A071696 Greater members of twin prime pairs of form (4*k+1,4*k+3), k>0.

Original entry on oeis.org

7, 19, 31, 43, 103, 139, 151, 199, 271, 283, 463, 523, 571, 619, 643, 811, 823, 859, 883, 1051, 1063, 1231, 1279, 1291, 1303, 1483, 1699, 1723, 1879, 1951, 1999, 2083, 2131, 2143, 2239, 2311, 2383, 2551, 2659, 2731, 2791, 2803, 2971
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 04 2002

Keywords

Comments

Corresponding lesser members: A071695(n).
A010051(a(n)) * A010051(a(n)-2) = 1. - Reinhard Zumkeller, Nov 10 2013

Crossrefs

Cf. Subsequence of A002145.

Programs

  • Haskell
    a071696 n = a071696_list !! (n-1)
    a071696_list = [p | p <- tail a002145_list, a010051' (p - 2) == 1]
    -- Reinhard Zumkeller, Nov 10 2013
  • Mathematica
    Select[Partition[Prime[Range[500]],2,1],#[[2]]-#[[1]]==2&&IntegerQ[ (#[[1]]-1)/4]&][[All,2]] (* Harvey P. Dale, Aug 27 2021 *)
    Select[Table[4k+{1,3},{k,750}],AllTrue[#,PrimeQ]&][[;;,2]] (* Harvey P. Dale, Sep 10 2024 *)

A071698 Lesser members of twin prime pairs of form (4*k+3, 4*k+5), k >= 0.

Original entry on oeis.org

3, 11, 59, 71, 107, 179, 191, 227, 239, 311, 347, 419, 431, 599, 659, 827, 1019, 1031, 1091, 1151, 1319, 1427, 1451, 1487, 1607, 1619, 1667, 1787, 1871, 1931, 2027, 2087, 2111, 2267, 2339, 2591, 2687, 2711, 2999, 3119, 3167, 3251, 3299
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 04 2002

Keywords

Comments

Corresponding greater members: A071699(n).

Crossrefs

Cf. A010051, subsequence of A004767.

Programs

  • Haskell
    a071698 n = a071698_list !! (n-1)
    a071698_list = [x | x <- [3, 7 ..], a010051' x == 1, a010051' (x+2) == 1]
    -- Reinhard Zumkeller, Aug 05 2014
    
  • Magma
    [4*k+3:k in [0..1000]|IsPrime(4*k+3) and IsPrime(4*k+5)]; // Marius A. Burtea, Nov 06 2019
  • Mathematica
    Transpose[Select[Table[4n+{3,5},{n,0,1000}],AllTrue[#,PrimeQ]&]][[1]] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jan 16 2015 *)

Formula

a(n) = 2*A241557(n+1)-1. - Hilko Koning, Nov 06 2019

A072010 In prime factorization of n replace all primes of form k*4+1 with k*4+3 and primes of form k*4+3 with k*4+1.

Original entry on oeis.org

1, 2, 1, 4, 7, 2, 5, 8, 1, 14, 9, 4, 15, 10, 7, 16, 19, 2, 17, 28, 5, 18, 21, 8, 49, 30, 1, 20, 31, 14, 29, 32, 9, 38, 35, 4, 39, 34, 15, 56, 43, 10, 41, 36, 7, 42, 45, 16, 25, 98, 19, 60, 55, 2, 63, 40, 17, 62, 57, 28, 63, 58, 5, 64, 105, 18, 65, 76, 21, 70, 69
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 05 2002

Keywords

Comments

a(3^n) = 1; a(2^n) = 2^n;
a(n)>2 is prime iff n=m*3^i (i>=0), a(n)=a(m) and (m,a(m)) or (a(m),m) is a twin prime pair of form ((4*k+1),(4*k+3)), a(m)*m=A071697(j)=A071695(j)*A071696(j) for some j.

Examples

			a(26928) = a(2^4*3^2*11*17) = a(2)^4 * a(3)^2 * a(11) * a(17)
= 2^4 * 1^2 * 9 * 19 = 2736.
		

Crossrefs

Cf. A002144, A002145, A072012(n) = a(a(n)).
For a(n) = n see A072011.
Cf. A027746.

Programs

  • Haskell
    a072010 1 = 1
    a072010 n = product $ map f $ a027746_row n where
       f 2 = 2
       f p = p + 2 * (2 - p `mod` 4)
    -- Reinhard Zumkeller, Apr 09 2012
  • Mathematica
    a[1] = 1; a[p_?PrimeQ] = p + 2*(2 - Mod[p, 4]); a[n_] := Times @@ (a[#[[1]]]^#[[2]] & ) /@ FactorInteger[n]; Table[a[n], {n, 1, 71}] (* Jean-François Alcover, May 04 2012 *)

Formula

Multiplicative with a(p) = p + 2*(2 - p mod 4), p prime.

A071697 Product of twin primes of form (4*k+1,4*k+3), k>0.

Original entry on oeis.org

35, 323, 899, 1763, 10403, 19043, 22499, 39203, 72899, 79523, 213443, 272483, 324899, 381923, 412163, 656099, 675683, 736163, 777923, 1102499, 1127843, 1512899, 1633283, 1664099, 1695203, 2196323, 2883203, 2965283, 3526883, 3802499, 3992003, 4334723, 4536899
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 04 2002

Keywords

Crossrefs

Programs

  • Magma
    [16*n^2+16*n+3: n in [1..700]| IsPrime(4*n+1) and IsPrime(4*n+3)]; // Vincenzo Librandi, Feb 24 2015
  • PARI
    lista(nn) = {forprime(p=3, nn, if ((((p-1) % 4) == 0) && isprime(p+2), print1(p*(p+2), ", ")););} \\ Michel Marcus, Feb 24 2015
    

Formula

a(n) = A071695(n)*A071696(n).

Extensions

More terms from Michel Marcus, Feb 24 2015

A112591 a(n) = prime(n) XOR prime(n + 1).

Original entry on oeis.org

1, 6, 2, 12, 6, 28, 2, 4, 10, 2, 58, 12, 2, 4, 26, 14, 6, 126, 4, 14, 6, 28, 10, 56, 4, 2, 12, 6, 28, 14, 252, 10, 2, 30, 2, 10, 62, 4, 10, 30, 6, 10, 126, 4, 2, 20, 12, 60, 6, 12, 6, 30, 10, 506, 6, 10, 2, 26, 12, 2, 62, 22, 4, 14, 4, 118, 26, 10, 6, 60, 6, 8, 26, 14, 4, 250, 8, 28, 8
Offset: 1

Views

Author

Sandeep Chellappen (sandeep.chellappen(AT)gmail.com), Dec 18 2005

Keywords

Comments

When represented in binary, this sequence represents the uncommon bits in two consecutive prime numbers.
a(n) = 2 for indices of the lesser twin primes of the form 4k + 1, A071695. - Michel Marcus, Apr 17 2020

Examples

			a(2) = 6 ; since prime(2) = 3, which is 11 in binary, prime(3) = 5, which is 101 in binary; and 011 XOR 101 = 110, which is 6 in decimal.
		

Crossrefs

Programs

  • Maple
    A112591 := proc(n) local ndual,n2dual,nxor,i ; ndual := convert(ithprime(n),base,2) ; n2dual := convert(ithprime(n+1),base,2) ; nxor := [] ; i := 1 ; while i <= nops(ndual) do nxor := [op(nxor), abs(op(i,ndual)-op(i,n2dual)) ] ; i := i+1 ; od ; while i <= nops(n2dual) do nxor := [op(nxor), op(i,n2dual) ] ; i := i+1 ; od ; add( op(i,nxor)*2^(i-1),i=1..nops(nxor)) ; end: for n from 1 to 80 do printf("%d,",A112591(n)) ; od ; # R. J. Mathar, Mar 07 2007
    with(Bits):seq(Xor(ithprime(n),ithprime(n+1)),n=1..50) # Gary Detlefs, Aug 03 2013
  • Mathematica
    BitXor@@#&/@Partition[Prime[Range[80]], 2, 1] (* Harvey P. Dale, May 04 2018 *)
  • PARI
    a(n) = bitxor(prime(n),prime(n+1)); \\ Joerg Arndt, Aug 04 2013
    
  • Scala
    val prime: LazyList[Int] = 2 #:: LazyList.from(3).filter(i => prime.takeWhile { j => j * j <= i }.forall { k => i % k != 0 })
    (0 to 127).map(n => prime(n) ^ prime(n + 1)) // Alonso del Arte, Apr 18 2020

Extensions

More terms and better name from Christopher M. Herron (cmh285(AT)psu.edu), Apr 25 2006

A072028 Swap twin prime pairs of form (4*k+1,4*k+3) in prime factorization of n.

Original entry on oeis.org

1, 2, 3, 4, 7, 6, 5, 8, 9, 14, 11, 12, 13, 10, 21, 16, 19, 18, 17, 28, 15, 22, 23, 24, 49, 26, 27, 20, 31, 42, 29, 32, 33, 38, 35, 36, 37, 34, 39, 56, 43, 30, 41, 44, 63, 46, 47, 48, 25, 98, 57, 52, 53, 54, 77, 40, 51, 62, 59, 84, 61, 58, 45, 64, 91, 66
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 07 2002

Keywords

Examples

			a(65) = a(5*13) = a(5)*a(13) = a(4*1+1)*a(13) = (4*1+3)*13 = 7*13 = 91.
		

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := If[p < 5, p, If[(m = Mod[p, 4]) == 1 && PrimeQ[p + 2], p + 2, If[m == 3 && PrimeQ[p - 2], p - 2, p]]]^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Feb 26 2024 *)
  • PARI
    a(n) = {my(f = factor(n)); prod(i = 1, #f~, p = f[i,1]; if(p < 5, p, if(p%4 == 1 && isprime(p+2), p+2, if(p%4 == 3 && isprime(p-2), p-2, p)))^f[i,2]);} \\ Amiram Eldar, Feb 26 2024

Formula

Multiplicative with a(p) = (if p mod 4 = 1 and p+2 is prime then p+2 else (if p mod 4 = 3 and p-2 is prime then p-2 else p)), p prime.
a(a(n)) = n, a self-inverse permutation of natural numbers.
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Product_{(p < q) swapped pair} ((p^2-p)*(q^2-q)/((p^2-q)*(q^2-p))) = 1.0627249749498993391... . - Amiram Eldar, Feb 26 2024

A082542 a(n) = prime(n) + 2 - (prime(n) mod 4).

Original entry on oeis.org

2, 2, 6, 6, 10, 14, 18, 18, 22, 30, 30, 38, 42, 42, 46, 54, 58, 62, 66, 70, 74, 78, 82, 90, 98, 102, 102, 106, 110, 114, 126, 130, 138, 138, 150, 150, 158, 162, 166, 174, 178, 182, 190, 194, 198, 198, 210, 222, 226, 230, 234, 238, 242, 250, 258, 262, 270, 270, 278
Offset: 1

Views

Author

Reinhard Zumkeller, May 02 2003

Keywords

Comments

For k > 1: a(k+1) = a(k) if and only if prime(k) == 1 modulo 4 and prime(k+1) = prime(k) + 2, see A071695 and A071696.

Examples

			a(2) = 2 because the second prime is 3, and 3 + 2 - 3 = 2.
a(3) = 6 because the third prime is 5, and 5 + 2 - 1 = 6.
a(4) = 6 because the fourth prime is 7, and 7 + 2 - 3 = 6.
		

Crossrefs

Programs

  • Magma
    [2 + NthPrime(n) - (NthPrime(n) mod 4): n in [1..60]]; // G. C. Greubel, Nov 14 2018
  • Mathematica
    Table[Prime[n] + 2 - Mod[Prime[n], 4], {n, 60}] (* Alonso del Arte, Feb 23 2015 *)
    #+2-Mod[#,4]&/@Prime[Range[60]] (* Harvey P. Dale, Aug 24 2025 *)
  • PARI
    vector(60, n, 2 + prime(n) - lift(Mod(prime(n),4))) \\ G. C. Greubel, Nov 14 2018
    

Formula

a(n) = A000040(n) + A070750(n).
a(n+1) = p + (-1/p) = p + (-1)^((p-1)/2), where p is the n-th odd prime and (-1/p) denotes the value of Legendre symbol. - Lekraj Beedassy, Mar 17 2005
a(n) = (A000040(n) OR 3) - 1. - Jon Maiga, Nov 14 2018
From Amiram Eldar, Dec 24 2022: (Start)
a(n) = A100484(n) - A076342(n).
Product_{n>=1} a(n)/prime(n) = 2/Pi (A060294). (End)

A072011 Numbers k such that A072010(k) = k.

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 35, 64, 70, 128, 140, 256, 280, 323, 512, 560, 646, 899, 1024, 1120, 1225, 1292, 1763, 1798, 2048, 2240, 2450, 2584, 3526, 3596, 4096, 4480, 4900, 5168, 7052, 7192, 8192, 8960, 9800, 10336, 10403, 11305
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 05 2002

Keywords

Comments

If A072010(n) = n then also A072010(n*3^i) = n and A072010(n*2^j) = n*2^j.
For m=(4*k+1)*(4*k+3), product of twin prime pairs: A072010(m) = m, as well as for values m in the free monoid generated by the range of A071697.

Examples

			395675 is a term as f(395675) = f(323*1225) = f((17*19)*(5*7)^2) = f(17*19)*(f(5*7))^2 = f(17)*f(19)*(f(5)*f(7))^2 = 19*17*(7*5)^2 = 323*1225 = 395675 for f = A072010.
		

Crossrefs

A205172 Primes p == 5 (mod 8) such that p + 2 is also prime.

Original entry on oeis.org

5, 29, 101, 149, 197, 269, 461, 821, 1061, 1229, 1277, 1301, 1877, 1949, 1997, 2141, 2237, 2309, 2381, 2549, 2789, 3389, 3461, 3557, 3581, 3821, 3917, 4157, 4229, 4421, 4517, 4637, 5021, 5477, 5501, 5741, 6197, 6269, 6701, 6869, 7349, 7589, 7757, 7877
Offset: 1

Views

Author

Robert G. Wilson v, Jan 22 2012

Keywords

Comments

The lesser of twin primes == 5 (mod 8).

Crossrefs

Programs

  • Maple
    select(t -> isprime(t) and isprime(t+2), [seq(i,i=5..10000,8)]);# Robert Israel, Nov 25 2019
  • Mathematica
    Select[ Prime@ Range@ 1000, Mod[#, 8] == 5 && PrimeQ[# + 2] &]
  • PARI
    forprime(p=1, 7900, if(Mod(p, 8)==5 && ispseudoprime(p+2), print1(p, ", "))) \\ Felix Fröhlich, Nov 25 2019

A071701 Number of twin prime pairs <= n of form (4*k+1,4*k+3), k>0.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 04 2002

Keywords

Comments

As for A071538 the convention is followed that a twin prime pair is <= n if its smaller member is <= n.

Examples

			a(30)=3, since (29,31) is included along with (5,7) and (17,19).
		

Crossrefs

a(n) = A071538(n) - A071702(n), cf. A071695, A071696.
Showing 1-10 of 14 results. Next