login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A065844 Let u be any string of n digits from {0,1,2}; 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, 2, 4, 7, 19, 42, 102, 252, 532, 1226, 3681, 9100, 24858, 61943, 161857, 392935, 1167208, 3125539, 8879693, 23143081, 63028550 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Table of n, a(n) for n=1..22.

EXAMPLE

a(2)=2 because 12 and 21 (written in base 3) are primes (5 and 7).

MAPLE

A065844 := proc(n)

    local b, u, udgs, uperm, a;

    b :=3 ;

    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, A065844(n)) ;

end do: # R. J. Mathar, Apr 23 2016

MATHEMATICA

c[x_] := Module[{},

   Length[Select[Permutations[x],

     First[#] != 0 && PrimeQ[FromDigits[#, 3]] &]]];

A065844[n_] := Module[{i},

   Return[Max[Map[c, DeleteDuplicatesBy[Tuples[Range[0, 2], n],

       Table[Count[#, i], {i, 0, 2}] &]]]]];

Table[A065844[n], {n, 1, 13}] (* Robert Price, Mar 30 2019 *)

CROSSREFS

Cf. A065843, A065845, A065846, A065847, A065848, A065849, A065850, A065851, A065852, A065853

Sequence in context: A014266 A032441 A238184 * A131199 A112059 A093094

Adjacent sequences:  A065841 A065842 A065843 * A065845 A065846 A065847

KEYWORD

base,nonn,more

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 24 16:41 EST 2020. Contains 331208 sequences. (Running on oeis4.)