cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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 to a base-3 number; then a(n) = max_u f(u).

Original entry on oeis.org

1, 2, 2, 4, 7, 19, 42, 102, 252, 532, 1226, 3681, 9100, 24858, 61943, 161857, 392935, 1167208, 3125539, 8879693, 23143081, 63028550, 161146767, 480399716, 1325189141, 3815350317, 10255072974
Offset: 1

Views

Author

Sascha Kurz, Nov 24 2001

Keywords

Comments

a(25) >= 1325189141 via permutations of numbers with eight 0's, nine 1's and eight 2's. If some permutation class gives a larger number of primes then it's smallest element is lexicographically larger than 1000000001111111111111222. Permutation class 1000000011111111222222222 gives fewer primes than 1325189141. - David A. Corneth, May 31 2024

Examples

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

Crossrefs

Programs

  • 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 *)

Extensions

3 more terms from Sean A. Irvine, Sep 06 2009
Definition corrected by David A. Corneth, Apr 23 2016
a(23)-a(24) from Michael S. Branicky, May 30 2024
a(25) confirmed by Michael S. Branicky, Jun 03 2024
a(26) from Michael S. Branicky, Jun 08 2024
a(27) from Michael S. Branicky, Jun 23 2024