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

A077800 List of twin primes {p, p+2}.

Original entry on oeis.org

3, 5, 5, 7, 11, 13, 17, 19, 29, 31, 41, 43, 59, 61, 71, 73, 101, 103, 107, 109, 137, 139, 149, 151, 179, 181, 191, 193, 197, 199, 227, 229, 239, 241, 269, 271, 281, 283, 311, 313, 347, 349, 419, 421, 431, 433, 461, 463, 521, 523, 569, 571, 599, 601, 617, 619
Offset: 1

Views

Author

N. J. A. Sloane, Dec 03 2002

Keywords

Comments

Union (with repetition) of A001359 and A006512.

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 870.

Crossrefs

Cf. A065421, A070076, A095958. See A001097 for another version.

Programs

  • Haskell
    a077800 n = a077800_list !! (n-1)
    a077800_list = concat $ zipWith (\p q -> if p == q+2 then [q,p] else [])
                                    (tail a000040_list) a000040_list
    -- Reinhard Zumkeller, Nov 27 2011
    
  • Mathematica
    Sort[ Join[ Select[ Prime[ Range[ 115]], PrimeQ[ # - 2] &], Select[ Prime[ Range[ 115]], PrimeQ[ # + 2] &]]] (* Robert G. Wilson v, Jun 09 2005 *)
    Select[ Partition[ Prime@ Range@ 115, 2, 1], #[[1]] + 2 == #[[2]] &] // Flatten
    Flatten[Select[{#, # + 2} & /@Prime[Range[1000]], PrimeQ[Last[#]]&]] (* Vincenzo Librandi, Nov 01 2012 *)
    Splice[{#,#+2}]& /@ Select[Prime[Range[PrimePi[619]]], PrimeQ[#+2]&] (* Oliver Seipel, Sep 04 2024 *)
  • PARI
    p=2;forprime(q=3,1e3,if(q-p==2,print1(p", "q", "));p=q) \\ Charles R Greathouse IV, Mar 22 2013

Formula

Sum_{n>=1} 1/a(n) is in the interval (1.840503, 2.288490) (Platt and Trudgian, 2020). The conjectured value based on assumptions about the distribution of twin primes is A065421. - Amiram Eldar, Oct 15 2020

A045533 Concatenate the n-th and (n+1)st prime.

Original entry on oeis.org

23, 35, 57, 711, 1113, 1317, 1719, 1923, 2329, 2931, 3137, 3741, 4143, 4347, 4753, 5359, 5961, 6167, 6771, 7173, 7379, 7983, 8389, 8997, 97101, 101103, 103107, 107109, 109113, 113127, 127131, 131137
Offset: 1

Views

Author

N. J. A. Sloane, Dec 11 1999

Keywords

Crossrefs

Cf. A077800, A095958 (subsequence), A030461 (primes).

Programs

  • Haskell
    a045533 n = a045533_list !! (n-1)
    a045533_list = f $ map show a000040_list :: [Integer] where
       f (t:ts@(t':_)) = read (t ++ t') : f ts
    -- Reinhard Zumkeller, Apr 20 2012
    
  • Magma
    [Seqint(Intseq(NthPrime(n+1)) cat Intseq(NthPrime(n))): n in [1..50 ] ]; // Marius A. Burtea, Mar 21 2019
  • Mathematica
    #[[1]]*10^IntegerLength[#[[2]]]+#[[2]]&/@Partition[Prime[Range[40]],2,1] (* Harvey P. Dale, Jun 06 2015 *)
  • PARI
    a(n) = eval(concat(Str(prime(n)), Str(prime(n+1)))); \\ Michel Marcus, May 11 2014
    

Formula

a(n) = prime(n)*(10^floor(log_10(prime(n+1)))+1) + prime(n+1). - Conner L. Delahanty, May 10 2014

Extensions

Offset changed to 1, in agreement with (almost?) all references to this sequence, by M. F. Hasler

A153353 List of pairs of concatenated adjacent primes [p(n),p(n+1)] such that the concatenation is divisible by n.

Original entry on oeis.org

23, 57, 127131, 937941, 2087320879, 6557965581, 925039925051, 14073611407383, 89811798981191, 94647139464723, 1553629915536303, 122504623122504633, 200602291200602313, 495401873495401911, 133201458751133201458773
Offset: 1

Views

Author

Gil Broussard, Dec 24 2008

Keywords

Comments

The corresponding values of n are listed in A125085.
Subset of A045533. [R. J. Mathar, Jan 03 2009]

Examples

			23 is a term because 2 and 3 are adjacent primes and 23 is divisible by 1 (the position of 2 in the sequence of primes).
127131 is a term because 127 and 131 are adjacent primes and 127131 is divisible by 31 (the position of 127 in the sequence of primes).
		

Crossrefs

Programs

  • Maple
    A055642 := proc(n) max(1,ilog10(n)+1) ; end: cat2 := proc(a,b) a*10^A055642(b)+b ; end: A045533 := proc(n) cat2(ithprime(n),ithprime(n+1)) ; end: for n from 1 to 800000 do if A045533(n) mod n = 0 then printf("%d,",A045533(n)) ; fi; od: # R. J. Mathar, Jan 03 2009
  • Mathematica
    p = q = 2; c = 0; lst = {}; Do[c++; q = NextPrime@q; r = FromDigits@ Flatten[{IntegerDigits@ p, IntegerDigits@ q}]; If[Mod[r, c] == 0, AppendTo[lst, r]; Print[{c, r}]]; c++; q = NextPrime@ q; p = q, {n, 174254000}]; lst (* Robert G. Wilson v, Jan 23 2009 *)

Extensions

3 more terms from R. J. Mathar, Jan 03 2009
a(9)-a(14) from Robert G. Wilson v, Jan 23 2009
a(15) from Donovan Johnson, Aug 08 2010

A158619 Twin prime pairs concatenated in binary representation.

Original entry on oeis.org

11101, 101111, 10111101, 1000110011, 1110111111, 101001101011, 111011111101, 10001111001001, 11001011100111, 11010111101101, 1000100110001011, 1001010110010111, 1011001110110101, 1011111111000001, 1100010111000111
Offset: 1

Views

Author

Jonathan Vos Post, Mar 22 2009

Keywords

Comments

Binary analog of A095958.

Examples

			a(1) = 11101 because 11_2 = lower of first twin prime pair = 3, and 101_2 = higher of first twin prime pair = 5.
		

Crossrefs

Programs

  • Maple
    A001359 := proc(n) option remember ; if n = 1 then 3; else a := nextprime(procname(n-1)) ; while not isprime(a+2) do a := nextprime(a) ; od: RETURN(a) ; fi: end: A006512 := proc(n) A001359(n)+2 ; end: A007088 := proc(n) bdgs := convert(n,base,2) ; add( op(i,bdgs)*10^(i-1),i=1..nops(bdgs)) ; end: cat2 := proc(a,b) bdgs := max(1, 1+ilog10(b)) ; a*10^bdgs+b ; end: A158619 := proc(n) cat2(A007088(A001359(n)),A007088(A006512(n))) ; end: seq(A158619(n),n=1..30) ; # R. J. Mathar, Apr 16 2009

Formula

a(n) = A007088(A001359(n)) CONCATENATE A007088(A006512(n)) = A007088(A001359(n)) CONCATENATE A007088(A001359(n)+2).

Extensions

More terms from R. J. Mathar, Apr 16 2009

A268145 Twin prime pairs concatenated to their average in decimal representation (with the lesser twin prepended and the greater twin appended).

Original entry on oeis.org

345, 567, 111213, 171819, 293031, 414243, 596061, 717273, 101102103, 107108109, 137138139, 149150151, 179180181, 191192193, 197198199, 227228229, 239240241, 269270271, 281282283, 311312313, 347348349, 419420421, 431432433, 461462463, 521522523, 569570571, 599600601
Offset: 1

Views

Author

Mikk Heidemaa, Jan 27 2016

Keywords

Comments

The lesser prime of a twin prime pair is prepended and the greater prime is appended to their average (nonprime, interprime).
a(n) mod 3 = 0, (See A095958).

Examples

			a(1)=345: the lesser prime {3} of the first twin prime pair {3, 5} is prepended and the greater prime {5} is appended to their average {4}.
a(3)=111213: the lesser {11} of the 3rd twin prime pair {11, 13} is prepended and the greater prime {13} is appended to their average {12}.
		

Crossrefs

Programs

  • Mathematica
    UpToN[k_]:=FromDigits//@ StringJoin//@ ToString/@ {#-1, #, #+1} &/@ Select[ Table[ Prime[n]+1, {n, 2, PrimePi[k]}], PrimeQ[#+1] &]; UpToN[10000]

A107309 Concatenation of twin primes in reverse order.

Original entry on oeis.org

53, 75, 1311, 1917, 3129, 4341, 6159, 7371, 103101, 109107, 139137, 151149, 181179, 193191, 199197, 229227, 241239, 271269, 283281, 313311, 349347, 421419, 433431, 463461, 523521, 571569, 601599, 619617, 643641, 661659, 811809, 823821, 829827, 859857, 883881, 10211019, 10331031, 10511049, 10631061, 10931091, 11531151
Offset: 0

Views

Author

Parthasarathy Nambi, May 20 2005

Keywords

Examples

			The twin primes 41 and 43 are concatenated in reverse order to give 4341, which is the sixth term in the sequence.
		

Crossrefs

Cf. A095958.

Programs

  • Mathematica
    f[{a_,b_}]:=FromDigits[Join[IntegerDigits[b],IntegerDigits[a]]]; f/@Select[Partition[Prime[Range[200]],2,1],#[[2]]-#[[1]]==2&] (* Harvey P. Dale, Jan 01 2011 *)

Extensions

More terms from Harvey P. Dale, Jan 01 2011

A268146 Twin prime pairs concatenated to their average in decimal representation (the greater twin prepended, the lesser appended).

Original entry on oeis.org

543, 765, 131211, 191817, 313029, 434241, 616059, 737271, 103102101, 109108107, 139138137, 151150149, 181180179, 193192191, 199198197, 229228227, 241240239, 271270269, 283282281, 313312311, 349348347, 421420419, 433432431, 463462461, 523522521, 571570569, 601600599
Offset: 1

Views

Author

Mikk Heidemaa, Jan 27 2016

Keywords

Comments

The greater prime of a twin prime pair is prepended and the lesser one is appended to their average (nonprime, interprime).
a(n) mod 3 = 0, (See A095958).

Examples

			a(1)=543: the greater prime {5} of the first twin prime pair {3, 5} is prepended and the lesser prime {3} is appended to their average {4}.
		

Crossrefs

Programs

  • Mathematica
    UpToN[k_]:=FromDigits//@ StringJoin//@ ToString/@ {#+1, #, #-1} &/@ Select[ Table[ Prime[n]+1, {n, 2, PrimePi[k]}], PrimeQ[#+1] &]; UpToN[10000]
Showing 1-7 of 7 results.