login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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; 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 (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
A065845 := proc(n)
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
print(n, A065845(n)) ;
end do: # R. J. Mathar, Apr 23 2016
MATHEMATICA
c[x_] := Module[{},
Length[Select[Permutations[x],
First[#] != 0 && PrimeQ[FromDigits[#, 4]] &]]];
A065845[n_] := Module[{i},
Return[Max[Map[c, DeleteDuplicatesBy[Tuples[Range[0, 3], n],
Table[Count[#, i], {i, 0, 3}] &]]]]];
Table[A065845[n], {n, 1, 10}] (* Robert Price, Mar 30 2019 *)
CROSSREFS
Sequence in context: A171878 A117403 A002877 * A137273 A135967 A290248
KEYWORD
base,more,nonn
AUTHOR
Sascha Kurz, Nov 24 2001
EXTENSIONS
3 more terms from Sean A. Irvine, Sep 06 2009
Definition corrected by David A. Corneth, Apr 23 2016
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 4 04:21 EDT 2024. Contains 372226 sequences. (Running on oeis4.)