|
| |
|
|
A071234
|
|
Smallest prime beginning and ending in 2n+1 or 0 if no such prime exists.
|
|
2
| |
|
|
11, 3, 5, 7, 919, 11, 13, 0, 17, 19, 21121, 23, 0, 27127, 29, 31, 33533, 0, 37, 39139, 41, 43, 0, 47, 49549, 51151, 53, 0, 57457, 59, 61, 63463, 0, 67, 690269, 71, 73, 0, 77377, 79, 81181, 83, 0, 87187, 89, 91291, 93493, 0, 97
(list; graph; refs; listen; history; internal format)
|
|
|
|
OFFSET
| 0,1
|
|
|
COMMENTS
| If the two copies of the 2n+1 are not allowed to share digits, a(1) is not 3, a(2) is not 5 and a(3) is not 7 and a(5) is not 11, which results in A070278.
|
|
|
LINKS
| Alois P. Heinz, Table of n, a(n) for n = 0..10000
|
|
|
EXAMPLE
| a(6060) = 1212121, because it is the smallest prime beginning and ending in 2*6060+1 = 12121.
a(7+5*k) = 0, because 2*(7+5*k)+1 = 15+10*k == 0 (mod 5) is no prime.
|
|
|
MAPLE
| A071234 := proc(n)
local dgsn , p, wrks, doff;
dgsn := convert(2*n+1, base, 10) ;
for i from 1 to 1000000 do
p := ithprime(i) ;
wrks := true;
dgsp := convert(p, base, 10) ;
doff := nops(dgsp)-nops(dgsn) ;
if doff >= 0 then
for d from 1 to nops(dgsn) do
if op(d, dgsp) <> op(d, dgsn) then
wrks := false;
break;
end if;
if op(d+doff, dgsp) <> op(d, dgsn) then
wrks := false;
break;
end if;
end do:
if wrks then
return p
end if;
end if;
end do:
return 0 ;
end proc: # R. J. Mathar, Feb 03 2011
|
|
|
PROG
| (Sage)
def A071234(n):
....s = str(2*n+1)
....if s.endswith('5') and not s == '5': return 0
....for p in Primes():
........ps = str(p)
........if ps.startswith(s) and ps.endswith(s): return p # [D. S. McNeil, Feb 3 2011]
|
|
|
CROSSREFS
| Cf. A070278.
Sequence in context: A070695 A070720 A010189 * A082626 A083968 A082769
Adjacent sequences: A071231 A071232 A071233 * A071235 A071236 A071237
|
|
|
KEYWORD
| nonn,base
|
|
|
AUTHOR
| Amarnath Murthy (amarnath_murthy(AT)yahoo.com), May 18 2002
|
| |
|
|