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).
LINKS
Abhiram R Devesh, Python Code for generating this sequence
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
KEYWORD
nonn,more
AUTHOR
Abhiram R Devesh, Oct 18 2014
STATUS
approved