|
|
A065845
|
|
Let u be any string of n digits from {0,...,3}; let f(u) = number of distinct primes, not beginning with 0, formed by permuting the digits of u to a base-4 number; then a(n) = max_u f(u).
|
|
11
|
|
|
1, 2, 3, 6, 13, 36, 96, 253, 765, 2683, 7385, 25075, 83150, 293063, 888689, 3161645, 11097301, 40328876, 129951350, 469528189, 1694632516
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
EXAMPLE
|
a(2)=2 because 13 and 31 (written in base 4) are primes (7 and 13).
|
|
MAPLE
|
local b, u, udgs, uperm, a;
b :=4 ;
a := 0 ;
for u from b^(n-1) to b^n-1 do
udgs := convert(u, base, b) ;
prs := {} ;
for uperm in combinat[permute](udgs) do
if op(-1, uperm) <> 0 then
p := add( op(i, uperm)*b^(i-1), i=1..nops(uperm)) ;
if isprime(p) then
prs := prs union {p} ;
end if;
end if;
end do:
a := max(a, nops(prs)) ;
end do:
a ;
end proc:
for n from 1 do
|
|
MATHEMATICA
|
c[x_] := Module[{},
Length[Select[Permutations[x],
First[#] != 0 && PrimeQ[FromDigits[#, 4]] &]]];
Return[Max[Map[c, DeleteDuplicatesBy[Tuples[Range[0, 3], n],
Table[Count[#, i], {i, 0, 3}] &]]]]];
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,more,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|