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).

This page as a plain text file.
%I A065844 #44 Jun 23 2024 21:42:05
%S A065844 1,2,2,4,7,19,42,102,252,532,1226,3681,9100,24858,61943,161857,392935,
%T A065844 1167208,3125539,8879693,23143081,63028550,161146767,480399716,
%U A065844 1325189141,3815350317,10255072974
%N 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).
%C A065844 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
%e A065844 a(2)=2 because 12 and 21 (written in base 3) are primes (5 and 7).
%p A065844 A065844 := proc(n)
%p A065844     local b,u,udgs,uperm,a;
%p A065844     b :=3 ;
%p A065844     a := 0 ;
%p A065844     for u from b^(n-1) to b^n-1 do
%p A065844         udgs := convert(u,base,b) ;
%p A065844         prs := {} ;
%p A065844         for uperm in combinat[permute](udgs) do
%p A065844             if op(-1,uperm) <> 0 then
%p A065844                 p := add( op(i,uperm)*b^(i-1),i=1..nops(uperm)) ;
%p A065844                 if isprime(p) then
%p A065844                     prs := prs union {p} ;
%p A065844                 end if;
%p A065844             end if;
%p A065844         end do:
%p A065844         a := max(a,nops(prs)) ;
%p A065844     end do:
%p A065844     a ;
%p A065844 end proc:
%p A065844 for n from 1 do
%p A065844     print(n,A065844(n)) ;
%p A065844 end do: # _R. J. Mathar_, Apr 23 2016
%t A065844 c[x_] := Module[{},
%t A065844    Length[Select[Permutations[x],
%t A065844      First[#] != 0 && PrimeQ[FromDigits[#, 3]] &]]];
%t A065844 A065844[n_] := Module[{i},
%t A065844    Return[Max[Map[c, DeleteDuplicatesBy[Tuples[Range[0, 2], n],
%t A065844        Table[Count[#, i], {i, 0, 2}] &]]]]];
%t A065844 Table[A065844[n], {n, 1, 13}] (* _Robert Price_, Mar 30 2019 *)
%Y A065844 Cf. A055729, A065843, A065845, A065846, A065847, A065848, A065849, A065850, A065851, A065852, A065853
%K A065844 base,nonn,more
%O A065844 1,2
%A A065844 _Sascha Kurz_, Nov 24 2001
%E A065844 3 more terms from _Sean A. Irvine_, Sep 06 2009
%E A065844 Definition corrected by _David A. Corneth_, Apr 23 2016
%E A065844 a(23)-a(24) from _Michael S. Branicky_, May 30 2024
%E A065844 a(25) confirmed by _Michael S. Branicky_, Jun 03 2024
%E A065844 a(26) from _Michael S. Branicky_, Jun 08 2024
%E A065844 a(27) from _Michael S. Branicky_, Jun 23 2024