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”).

A181608
Smallest positive number such that, enclosed by prime(n) gives a prime, or zero if no such prime exists.
1
0, 1, 0, 2, 3, 3, 1, 2, 6, 1, 2, 3, 1, 5, 1, 3, 1, 2, 5, 1, 6, 2, 3, 1, 3, 12, 15, 4, 3, 1, 3, 1, 1, 8, 6, 3, 14, 5, 3, 6, 3, 26, 7, 2, 3, 21, 3, 3, 15, 9, 7, 1, 3, 16, 6, 1, 7, 15, 5, 9, 2, 4, 12, 12, 5, 4, 5, 8, 4, 3, 13, 1, 2, 2, 6, 6, 1, 6, 4, 3, 4, 2, 9, 5, 5, 1, 10, 6, 1, 3, 1, 6, 5, 9, 2, 3, 1, 6, 3, 5, 2, 4, 7, 4, 14, 3, 3, 3, 3
OFFSET
1,4
LINKS
EXAMPLE
a(5)=3 since prime(5)=11 and 11311 is prime.
MAPLE
read("transforms") ;
A181608 := proc(n) local p, k, l ; if n= 1 or n = 3 then return 0 ; end if; p := ithprime(n) ; for k from 0 do l := digcat2(digcat2(p, k), p) ; if isprime(%) then return k; end if; end do: end proc: # R. J. Mathar, Jan 30 2011
MATHEMATICA
Table[p = Prime[n]; If[Mod[10, p] == 0, 0, k = 0; While[!PrimeQ[FromDigits[Join[IntegerDigits[p], IntegerDigits[k], IntegerDigits[p]]]], k++]; k], {n, 109}]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Carmine Suriano, Jan 30 2011
STATUS
approved