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

A030457 Numbers k such that k concatenated with k+1 is prime.

Original entry on oeis.org

2, 6, 8, 12, 36, 42, 50, 56, 62, 68, 78, 80, 90, 92, 96, 102, 108, 120, 126, 138, 150, 156, 180, 186, 188, 192, 200, 216, 242, 246, 252, 270, 276, 278, 300, 308, 312, 318, 330, 338, 342, 350, 362, 368, 378, 390, 402, 410, 416, 420, 426, 428, 432
Offset: 1

Views

Author

Keywords

Comments

k is not congruent to 1 (mod 2), 1 (mod 3), or 4 (mod 5). - Charles R Greathouse IV, Apr 16 2012

Examples

			1213 is prime, therefore 12 is a term.
		

Crossrefs

Cf. A010051, A001704, A068700 (subsequence).
Numbers k such that k concatenated with k+m is prime: this sequence (m=1), A032617 (m=2), A032618 (m=3), A032619 (m=4), A032620 (m=5), A032621 (m=6), A032622 (m=7), A032623 (m=8), A032624 (m=9).

Programs

  • Haskell
    a030457 n = a030457_list !! (n-1)
    a030457_list = filter ((== 1) . a010051' . a001704) [1..]
    -- Reinhard Zumkeller, Jun 27 2015, Apr 26 2011
    
  • Magma
    [n: n in [1..500] | IsPrime(Seqint(Intseq(n+1) cat Intseq(n)))]; // Vincenzo Librandi, Jul 23 2016
    
  • Maple
    concat:=proc(a,b) local bb: bb:=nops(convert(b,base,10)): 10^bb*a+b end proc: a:=proc(n) if isprime(concat(n,n+1))=true then n else end if end proc: seq(a(n),n=0..500); # Emeric Deutsch, Nov 23 2007
  • Mathematica
    Select[ Range[500], PrimeQ[ ToExpression[ StringJoin[ ToString[#], ToString[#+1]]]]&] (* Jean-François Alcover, Nov 18 2011 *)
    Select[Range[500],PrimeQ[FromDigits[Join[IntegerDigits[#], IntegerDigits[ #+1]]]]&] (* Harvey P. Dale, Dec 23 2015 *)
    Position[#[[1]]*10^IntegerLength[#[[2]]]+#[[2]]&/@Partition[Range[ 500], 2,1],?PrimeQ]//Flatten (* _Harvey P. Dale, Jul 14 2019 *)
  • PARI
    for(n=1,10^5,if(isprime(eval(concat(Str(n),n+1))),print1(n,", "))); /* Joerg Arndt, Apr 27 2011 */
    
  • Python
    from sympy import isprime
    def ok(n): return isprime(int(str(n)+str(n+1)))
    print([k for k in range(500) if ok(k)]) # Michael S. Branicky, Apr 19 2023

A054211 Numbers k such that k concatenated with k-1 is prime.

Original entry on oeis.org

4, 10, 22, 24, 34, 42, 58, 70, 78, 88, 100, 102, 108, 112, 114, 124, 148, 154, 160, 172, 180, 192, 198, 202, 208, 210, 214, 238, 244, 262, 264, 268, 270, 282, 294, 300, 304, 312, 328, 330, 334, 340, 342, 354, 372, 384, 390, 394, 412, 414, 420, 424, 444, 454
Offset: 1

Views

Author

Patrick De Geest, Feb 15 2000

Keywords

Comments

A010051(A127423(a(n))) = 1. - Reinhard Zumkeller, Jun 27 2015
All terms are even. - Michel Marcus, Oct 14 2016

Crossrefs

Programs

  • Haskell
    a054211 n = a054211_list !! (n-1)
    a054211_list = filter ((== 1) . a010051' . a127423) [1..]
    -- Reinhard Zumkeller, Jun 27 2015 Jul 15 2012
    
  • Mathematica
    ncpQ[{a_,b_}]:=PrimeQ[FromDigits[Flatten[IntegerDigits[{b,a}]]]]; Transpose[ Select[Partition[Range[500],2,1],ncpQ]][[2]] (* Harvey P. Dale, Nov 25 2012 *)
    Select[Range[500],PrimeQ[#*10^IntegerLength[#-1]+#-1]&] (* Harvey P. Dale, Mar 16 2019 *)
  • PARI
    isok(n) = isprime(eval(Str(n, n-1))); \\ Michel Marcus, Oct 14 2016

A102478 Numbers n such that the concatenations (2*n),(2*n-1) and (2*n),(2*n+1) give twin primes.

Original entry on oeis.org

21, 39, 51, 54, 90, 96, 135, 150, 156, 165, 171, 195, 210, 261, 270, 306, 330, 411, 420, 441, 501, 570, 615, 636, 741, 771, 816, 885, 1050, 1095, 1341, 1371, 1536, 1599, 1704, 1821, 1914, 2121, 2226, 2286, 2370, 2394, 2499, 2811, 2859, 2916, 3051, 3129, 3714
Offset: 1

Views

Author

Pierre CAMI, Feb 24 2005

Keywords

Examples

			2*21=42, 4241 and 4243 are twin primes so a(1)=21
2*39=78, 7877 and 7879 are twin primes so a(2)=39
		

Crossrefs

Cf. A068700.

Programs

  • Haskell
    a102478 = flip div 2 . a068700  -- Reinhard Zumkeller, Jun 27 2015
  • Mathematica
    concatQ[n_]:=Module[{idn=IntegerDigits[2n],concatidn},concatidn=FromDigits[Join[idn,idn]];And@@PrimeQ[{concatidn-1,concatidn+1}]]; Select[Range[4000],concatQ] (* Harvey P. Dale, Feb 07 2012 *)

Formula

a(n) = A068700(n) / 2. - Reinhard Zumkeller, Jun 27 2015

Extensions

Edited by Charles R Greathouse IV, Apr 29 2010
Showing 1-3 of 3 results.