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.

A034808 Concatenation of 'prevprime(k) and k' is a prime.

This page as a plain text file.
%I A034808 #23 Aug 13 2024 22:54:04
%S A034808 3,9,37,39,51,63,87,89,111,117,123,153,157,163,173,177,183,207,211,
%T A034808 213,217,219,239,249,257,263,267,269,273,277,279,289,321,323,327,333,
%U A034808 337,339,343,359,369,379,407,423,439,441,459,471,473,477,479,489,497,513
%N A034808 Concatenation of 'prevprime(k) and k' is a prime.
%C A034808 Since there are primes in the sequence, and concat(p,p) = p*(10^x+1) is always composite, it is clear that here the variant 2 (A151799(n) < n) of the prevprime function is used, rather than the variant 1 (A007917(n) <= n). - _M. F. Hasler_, Sep 09 2015
%H A034808 Harvey P. Dale, <a href="/A034808/b034808.txt">Table of n, a(n) for n = 1..1000</a>
%e A034808 n=333 -> previous prime is 331, thus '331333' is a prime.
%t A034808 coQ[n_]:=PrimeQ[FromDigits[Flatten[IntegerDigits[{NextPrime[n,-1],n}]]]]; Select[Range[3,513],coQ[#]&] (* _Jayanta Basu_, May 30 2013 *)
%t A034808 Select[Range[2,550],PrimeQ[NextPrime[#,-1]*10^IntegerLength[#]+#]&] (* _Harvey P. Dale_, Nov 22 2020 *)
%o A034808 (Python)
%o A034808 from sympy import isprime, prevprime
%o A034808 def aupto(m):
%o A034808   return [k for k in range(3, m+1) if isprime(int(str(prevprime(k))+str(k)))]
%o A034808 print(aupto(513)) # _Michael S. Branicky_, Mar 09 2021
%o A034808 (PARI) isok(n)=n>2 && isprime(fromdigits(concat(digits(precprime(n-1)), digits(n)))) \\ _Andrew Howroyd_, Aug 13 2024
%Y A034808 Cf. A034809-A034821.
%Y A034808 Cf. A151799, A007917.
%K A034808 nonn,base
%O A034808 1,1
%A A034808 _Patrick De Geest_, Oct 15 1998
%E A034808 Offset changed by _Andrew Howroyd_, Aug 13 2024