login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A342874 Numbers k such that the k-th and (k+1)-st primes have the same digits. 1
293, 2106, 2161, 2763, 3698, 3793, 3812, 3922, 3959, 4000, 4205, 4224, 4260, 4728, 4953, 5065, 5283, 5617, 5700, 5751, 5932, 6326, 6333, 6422, 6539, 6623, 7375, 7475, 7501, 7533, 7542, 8306, 8568, 8751, 8777, 8994, 9102, 9259, 9354, 9480, 10389, 10700, 10791 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Subsequence of A109182.
LINKS
EXAMPLE
prime(293) = 1913, while prime(294) = 1931. Thus, 293 is in this sequence.
MAPLE
q:= n-> (f-> is(f(n)=f(n+1)))(t-> sort(convert(ithprime(t), base, 10))):
select(q, [$1..15000])[]; # Alois P. Heinz, Mar 28 2021
MATHEMATICA
Select[Range[10000], Sort[IntegerDigits[Prime[#]]] == Sort[IntegerDigits[Prime[# + 1]]] &]
PROG
(PARI) upto(n) = {my(t = 1, res = List(), q = 2); forprime(p = 3, oo, if((p - q)%9 == 0 && vecsort(digits(q)) == vecsort(digits(p)), listput(res, t); ); q = p; t++; if(t > n, return(res) ) ) } \\ David A. Corneth, Mar 29 2021
(Python)
from sympy import nextprime
from itertools import count, islice
def agen():
p, pdigs, q, qdigs = 2, ["2"], 3, ["3"]
for k in count(1):
if pdigs == qdigs: yield k
p, q = q, nextprime(q)
pdigs, qdigs = qdigs, sorted(str(q))
print(list(islice(agen(), 43))) # Michael S. Branicky, Nov 27 2022
CROSSREFS
Cf. A109182.
Sequence in context: A109562 A023305 A109182 * A241047 A085502 A108828
KEYWORD
nonn,base
AUTHOR
Tanya Khovanova, Mar 28 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 08:45 EDT 2024. Contains 371782 sequences. (Running on oeis4.)