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-5 of 5 results.

A014574 Average of twin prime pairs.

Original entry on oeis.org

4, 6, 12, 18, 30, 42, 60, 72, 102, 108, 138, 150, 180, 192, 198, 228, 240, 270, 282, 312, 348, 420, 432, 462, 522, 570, 600, 618, 642, 660, 810, 822, 828, 858, 882, 1020, 1032, 1050, 1062, 1092, 1152, 1230, 1278, 1290, 1302, 1320, 1428, 1452, 1482, 1488, 1608
Offset: 1

Views

Author

Keywords

Comments

With an initial 1 added, this is the complement of the closure of {2} under a*b+1 and a*b-1. - Franklin T. Adams-Watters, Jan 11 2006
Also the square root of the product of twin prime pairs + 1. Two consecutive odd numbers can be written as 2k+1,2k+3. Then (2k+1)(2k+3)+1 = 4(k^2+2k+1) = 4(k+1)^2, a perfect square. Since twin prime pairs are two consecutive odd numbers, the statement is true for all twin prime pairs. - Cino Hilliard, May 03 2006
Or, single (or isolated) composites. Nonprimes k such that neither k-1 nor k+1 is nonprime. - Juri-Stepan Gerasimov, Aug 11 2009
Numbers n such that sigma(n-1) = phi(n+1). - Farideh Firoozbakht, Jul 04 2010
Aside from the first term in the sequence, all remaining terms have digital root 3, 6, or 9. - J. W. Helkenberg, Jul 24 2013
Numbers n such that n^2-1 is a semiprime. - Thomas Ordowski, Sep 24 2015
Every term but the first is a multiple of 6. - Harvey P. Dale, Mar 31 2023

References

  • Archimedeans Problems Drive, Eureka, 30 (1967).

Crossrefs

A068507 is the intersection of A002182 and this sequence.

Programs

  • GAP
    a:=1+Filtered([1..2000],p->IsPrime(p) and IsPrime(p+2)); # Muniru A Asiru, May 20 2018
  • Haskell
    a014574 n = a014574_list !! (n-1)
    a014574_list = [x | x <- [2,4..], a010051 (x-1) == 1, a010051 (x+1) == 1]
    -- Reinhard Zumkeller, Apr 11 2012
    
  • Maple
    P := select(isprime,[$1..1609]): map(p->p+1,select(p->member(p+2,P),P)); # Peter Luschny, Mar 03 2011
    A014574 := proc(n) option remember; local p ; if n = 1 then 4 ; else p := nextprime( procname(n-1) ) ; while not isprime(p+2) do p := nextprime(p) ; od ; return p+1 ; end if ; end proc: # R. J. Mathar, Jun 11 2011
  • Mathematica
    Select[Table[Prime[n] + 1, {n, 260}], PrimeQ[ # + 1] &] (* Ray Chandler, Oct 12 2005 *)
    Mean/@Select[Partition[Prime[Range[300]],2,1],Last[#]-First[#]==2&] (* Harvey P. Dale, Jan 16 2014 *)
  • Maxima
    A014574(n) := block(
        if n = 1 then
            return(4),
        p : A014574(n-1) ,
        for k : 2 step 2 do (
            if primep(p+k-1) and primep(p+k+1) then
                return(p+k)
        )
    )$ /* R. J. Mathar, Mar 15 2012 */
    
  • PARI
    p=2;forprime(q=3,1e4,if(q-p==2,print1(p+1", "));p=q) \\ Charles R Greathouse IV, Jun 10 2011
    

Formula

a(n) = (A001359(n) + A006512(n))/2 = 2*A040040(n) = A054735(n)/2 = A111046(n)/4.
a(n) = A129297(n+4). - Reinhard Zumkeller, Apr 09 2007
A010051(a(n) - 1) * A010051(a(n) + 1) = 1. Reinhard Zumkeller, Apr 11 2012
a(n) = 6*A002822(n-1), n>=2. - Ivan N. Ianakiev, Aug 19 2013
a(n)^4 - 4*a(n)^2 = A062354(a(n)^2 - 1). - Raphie Frank, Oct 17 2013

Extensions

Offset changed to 1 by R. J. Mathar, Jun 11 2011

A040040 Average of twin prime pairs (A014574), divided by 2. Equivalently, 2*a(n)-1 and 2*a(n)+1 are primes.

Original entry on oeis.org

2, 3, 6, 9, 15, 21, 30, 36, 51, 54, 69, 75, 90, 96, 99, 114, 120, 135, 141, 156, 174, 210, 216, 231, 261, 285, 300, 309, 321, 330, 405, 411, 414, 429, 441, 510, 516, 525, 531, 546, 576, 615, 639, 645, 651, 660, 714, 726, 741, 744, 804, 810, 834, 849, 861, 894
Offset: 1

Views

Author

Keywords

Comments

Intersection of A005097 and A006254. - Zak Seidov, Mar 18 2005
The only possible pairs for 2a(n)+-1 are prime/prime (this sequence), not prime/not prime (A104278), prime/notprime (A104279) and not prime/prime (A104280), ... this sequence + A104280 + A104279 + A104278 = the odd numbers.
These numbers are never k mod (2k+1) or (k+1) mod (2k+1) with 2k+1 < a(n). - Jon Perry, Sep 04 2012
Excluding the first term, all remaining terms have digital root 3, 6 or 9. - J. W. Helkenberg, Jul 24 2013
Positive numbers x such that the difference between x^2 and adjacent squares are prime (both x^2-(x-1)^2 and (x+1)^2-x^2 are prime). - Doug Bell, Aug 21 2015

Crossrefs

Cf. A001359, A006512, A014574, A054735, A111046, A045753 (even terms halved), A002822 (terms divided by 3).
Cf. A221310.

Programs

  • Haskell
    a040040 = flip div 2 . a014574  -- Reinhard Zumkeller, Nov 17 2015
  • Maple
    P := select(isprime,[$1..1789]): map(p->(p+1)/2, select(p->member(p+2,P),P)); # Peter Luschny, Mar 03 2011
  • Mathematica
    Select[Range[900], And @@ PrimeQ[{-1, 1} + 2# ] &] (* Ray Chandler, Oct 12 2005 *)
  • PARI
    p=2; forprime(b=3, 1e4, if(b-p==2, print1((p+1)/2", ")); p=b) \\ Altug Alkan, Nov 10 2015
    

Formula

a(n) = A014574(n)/2 = A054735(n+1)/4 = A111046(n+1)/8.
For n > 1, a(n) = 3*A002822(n-1). - Jason Kimberley, Nov 06 2015
A260689(a(n),1) = A264526(a(n)) = 1. - Reinhard Zumkeller, Nov 17 2015
From Michael G. Kaarhus, Aug 19 2022: (Start)
a(n) = (A001359(n) + 1)/2.
a(n) = (A006512(n) - 1)/2.
For n > 1, a(n) = A167379(n-1) * 3/2. (End)

Extensions

More terms from Cino Hilliard, Oct 21 2002
Title corrected by Daniel Forgues, Jun 01 2009
Edited by Daniel Forgues, Jun 21 2009
Comment corrected by Daniel Forgues, Jul 12 2009

A054735 Sums of twin prime pairs.

Original entry on oeis.org

8, 12, 24, 36, 60, 84, 120, 144, 204, 216, 276, 300, 360, 384, 396, 456, 480, 540, 564, 624, 696, 840, 864, 924, 1044, 1140, 1200, 1236, 1284, 1320, 1620, 1644, 1656, 1716, 1764, 2040, 2064, 2100, 2124, 2184, 2304, 2460, 2556, 2580, 2604, 2640, 2856, 2904
Offset: 1

Views

Author

Enoch Haga, Apr 22 2000

Keywords

Comments

(p^q)+(q^p) calculated modulo pq, where (p,q) is the n-th twin prime pair. Example: (599^601)+(601^599) == 1200 mod (599*601). - Sam Alexander, Nov 14 2003
El'hakk makes the following claim (without any proof): (q^p)+(p^q) = 2*cosh(q arctanh( sqrt( 1-((2/p)^2) ) )) + 2cosh(p arctanh( sqrt( 1-((2/q)^2) ) )) mod p*q. - Sam Alexander, Nov 14 2003
Also: Numbers N such that N/2-1 and N/2+1 both are prime. - M. F. Hasler, Jan 03 2013
Excluding the first term, all remaining terms have digital root 3, 6 or 9. - J. W. Helkenberg, Jul 24 2013
Except for the first term, this sequence is a subsequence of A005101 (Abundant numbers) and of A008594 (Multiples of 12). - Ivan N. Ianakiev, Jul 04 2021

Examples

			a(3) = 24 because the twin primes 11 and 13 add to 24.
		

Crossrefs

Programs

  • Haskell
    a054735 = (+ 2) . (* 2) . a001359  -- Reinhard Zumkeller, Feb 10 2015
  • Maple
    ZL:=[]:for p from 1 to 1451 do if (isprime(p) and isprime(p+2)) then ZL:=[op(ZL),p+(p+2)]; fi; od; print(ZL); # Zerinvary Lajos, Mar 07 2007
    A054735 := proc(n)
    2*A001359(n)+2;
    end proc: # R. J. Mathar, Jan 06 2013
  • Mathematica
    Select[Table[Prime[n] + 1, {n, 230}], PrimeQ[ # + 1] &] *2 (* Ray Chandler, Oct 12 2005 *)
    Total/@Select[Partition[Prime[Range[300]],2,1],#[[2]]-#[[1]]==2&] (* Harvey P. Dale, Oct 23 2022 *)
  • PARI
    is_A054735(n)={!bittest(n,0)&&isprime(n\2-1)&&isprime(n\2+1)} \\ M. F. Hasler, Jan 03 2013
    
  • PARI
    pp=1;forprime(p=1,1482, if( p==pp+2, print1(p+pp,", ")); pp=p) \\ Following a suggestion by R. J. Cano, Jan 05 2013
    

Formula

a(n) = 2*A014574(n) = 4*A040040(n) = A111046(n)/2.
a(n) = 12*A002822(n-1) for all n > 1. - M. F. Hasler, Dec 12 2019

Extensions

Additional comments from Ray Chandler, Nov 16 2003
Broken link fixed by M. F. Hasler, Jan 03 2013

A243914 Even numbers which are twice the sum of a twin prime pair, but cannot be expressed as the sum of 2 distinct twin prime pairs.

Original entry on oeis.org

16, 24, 792, 1392
Offset: 1

Views

Author

Lear Young, Jun 14 2014

Keywords

Comments

Subsequence of A111046 (twice A054735).
It seems that this sequence is probably finite (there are no further terms below 10^7).

Examples

			a(1) = 16 = 2*(3+5).
16 is in the sequence since it is twice the sum of twin primes 3 and 5, but cannot be expressed as the sum of 2 distinct twin pairs.
36 is not in the sequence because although it is the sum of twin primes 17 and 19, it can also be expressed as the sum of pairs (5, 7) and (11, 13).
		

Crossrefs

Programs

  • Maple
    with(SignalProcessing): # requires at least Maple 17
    N:= 10^6; # to check primes up to N
    Primes:= select(isprime,{seq(2*i+1,i=1..N)}):
    Twins:= Primes intersect map(t-> t-2,Primes):
    nT:= nops(Twins);
    T:= Array(1..(Twins[nT]+1)/2, datatype=float[8]);
    for i from 1 to nT do T[(Twins[i]+1)/2]:= 1 od:
    TTwins:= Convolution(T,T);
    map(t -> 4*(t+1), select(n -> round(TTwins[n])=1,[$1..(nT+1)/2])); # Robert Israel, Jun 15 2014
  • PARI
    isok(isum1, vsum2) = {for (k=1, #vsum2, ksum2 = vsum2[k]; if (ksum2 > one, break;); if (isum1 - ksum2 != ksum2, if (vecsearch(vsum2, isum1 - ksum2), return (0)););); return (1);}
    lista() = {v = readvec("b014574.txt"); vsum1 = 4*v; vsum2 = 2*v; maxs2 = vecmax(vsum2); for (i=1, #v, isum1 = vsum1[i]; if (isum1 < maxs2, if (isok(isum1, vsum2), print1(isum1, ", "));););} \\ Michel Marcus, Jun 15 2014
    
  • PARI
    l1=l2=List();a=select(p->isprime(p+2),primes(1000));for(i=1,#a-1,if(i<#a/4,listput(l1,4*a[i]+4));for(j=i+1,#a,listput(l2,2*(a[i]+a[j])+4)));print(setminus(Set(l1),Set(l2))) \\ Lear Young, Jun 15 2014

A255229 Integers n such that n^2 - 1 is the difference of the squares of twin primes.

Original entry on oeis.org

5, 7, 11, 13, 17, 31, 41, 43, 49, 77, 83, 101, 109, 119, 133, 179, 203, 263, 277, 283, 307, 311, 329, 353, 377, 407, 413, 419, 431, 437, 463, 473, 493, 577, 581, 619, 629, 703, 757, 791, 811, 907, 911, 913, 991, 1001, 1037, 1061, 1103, 1121, 1249, 1289, 1337, 1373, 1441, 1457, 1487, 1523, 1597, 1651, 1781
Offset: 1

Views

Author

Neri Gionata, Feb 18 2015

Keywords

Examples

			31^2 - 1 = 241^2 - 239^2, and (239, 241) is a twin prime pair, so 31 is in the sequence.
		

Crossrefs

Cf. A088486 (corresponding lesser twin primes), A111046.

Programs

  • Mathematica
    lst={};f[n_]:=Sqrt[Prime[n]^2-NextPrime[Prime[n],-1]^2+1];
    Do[If[Prime[n]-NextPrime[Prime[n],-1]==2&&IntegerQ[f[n]],AppendTo[lst,f[n]]],{n,3,10^5}];lst (* Ivan N. Ianakiev, Mar 30 2015 *)
  • PARI
    lista(nn) = {forprime(p=3, nn, q = precprime(p-1); if (((p-q) == 2) && issquare(d=p^2-q^2+1), print1(sqrtint(d), ", ")); ); } \\ Michel Marcus, Feb 18 2015
Showing 1-5 of 5 results.