login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A249012
Smallest prime such that the multisets of the next n and the following n prime gaps are equal.
2
3, 5, 3, 23, 11, 13, 23, 263, 304349, 5644939, 151, 5644927, 18068879
OFFSET
1,1
COMMENTS
Smallest prime(k) such that the multiset of the n prime gaps after prime(k) equals the multiset of the n prime gaps after prime(n+k).
EXAMPLE
a(4)=23 as the prime gaps {2, 4, 6, 6} get repeated for (23, 29, 31, 37, 41) and (41, 43, 47, 53, 59).
a(6)=13 as the prime gaps {4, 2, 4, 6, 6, 2} get repeated for (13, 17, 19, 23, 29, 31, 37) and (37, 41, 43, 47, 53, 59, 61).
MAPLE
A249012 := proc(n)
local j, gapsetp, gapsetq;
for j from 1 do
gapsetp := [seq(ithprime(j+i)-ithprime(j+i-1), i=1..n)] ;
gapsetq := [seq(ithprime(j+n+i)-ithprime(j+n+i-1), i=1..n)] ;
if sort(gapsetp) = sort(gapsetq) then
return ithprime(j) ;
end if;
end do:
end proc:
for n from 1 do
print(A249012(n)) ;
end do: # R. J. Mathar, Nov 17 2014
PROG
(PARI) test(p, n)=my(v=vector(n, i, -p+(p=nextprime(p+1))), u=vector(n, i, -p+(p=nextprime(p+1)))); vecsort(u)==vecsort(v)
a(n)=forprime(p=3, , if(test(p, n), return(p))) \\ Charles R Greathouse IV, Oct 21 2014
CROSSREFS
Cf. A249011 (similar but with exactly the same prime gaps).
Sequence in context: A094466 A134771 A080349 * A249908 A195418 A366857
KEYWORD
nonn,more
AUTHOR
Abhiram R Devesh, Oct 18 2014
STATUS
approved