OFFSET
1,1
COMMENTS
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..95
MATHEMATICA
palindromicBases[n_] := Module[{p}, Table[p = IntegerDigits[n, b]; If[p == Reverse[p], {b, p}, Sequence @@ {}], {b, 2, n - 2}]]; lst = {}; Do[ If[ Length@ palindromicBases@ Prime@ n == 0, AppendTo[lst, Prime@n]], {n, 22189}]; lst[[ # ]] & /@ Select[ Range@ Length@ lst - 1, lst[[ # ]] + 2 == lst[[ # + 1]] &]
f[n_] := Block[{k = 2}, While[id = IntegerDigits[n, k]; id != Reverse@ id, k++ ]; k]; lst = {2}; Do[p = Prime@ n; If[ f@p == p - 1, AppendTo[lst, p]; Print@p], {n, 128149}]; lst[[ # ]] & /@ Select[Range@11284, lst[[ # ]] + 2 == lst[[ # + 1]] &]
nbQ[n_]:=NoneTrue[Table[IntegerDigits[n, b], {b, 2, n-2}], #==Reverse[#]&] && NoneTrue[ Table[IntegerDigits[n+2, b], {b, 2, n}], #==Reverse[#]&]; Select[ Select[Partition[Prime[Range[26000]], 2, 1], #[[2]]-#[[1]]==2&][[All, 1]], nbQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 03 2021 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert G. Wilson v, Mar 09 2008
STATUS
approved