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.

A357096 Least number whose set of decimal digits coincides with the set of decimal digits of prime(n).

This page as a plain text file.
%I A357096 #93 Sep 13 2022 09:33:26
%S A357096 2,3,5,7,1,13,17,19,23,29,13,37,14,34,47,35,59,16,67,17,37,79,38,89,
%T A357096 79,10,103,107,109,13,127,13,137,139,149,15,157,136,167,137,179,18,19,
%U A357096 139,179,19,12,23,27,29,23,239,124,125,257,236,269,127,27,128,238,239
%N A357096 Least number whose set of decimal digits coincides with the set of decimal digits of prime(n).
%e A357096 prime(5) = 11 and 1 have the same set of digits {1}, and 1 is the smallest such number, hence a(5) = 1.
%p A357096 f:= proc(p) local L,i;
%p A357096   L:= sort(convert(convert(convert(p,base,10),set),list));
%p A357096   if L[1] = 0 then L[1]:= L[2]; L[2]:= 0 fi;
%p A357096   add(L[-i]*10^(i-1),i=1..nops(L)) end proc:
%p A357096 seq(f(ithprime(i)),i=1..100); # _Robert Israel_, Sep 12 2022
%t A357096 a[n_] := Module[{d = Union[IntegerDigits[Prime[n]]]}, If[d[[1]] == 0, d[[1;;2]] = d[[2;;1;;-1]]]; FromDigits[d]]; Array[a, 100] (* _Amiram Eldar_, Sep 13 2022 *)
%o A357096 (PARI) a(n)=my(v=vecsort(digits(prime(n)),,8),w=v);if(v[1]==0,j=#v;w=if(j>2,v[3..j],[]);w=concat(Vecrev(v[1..2]),w));fromdigits(w)
%o A357096 (Python)
%o A357096 from sympy import prime
%o A357096 def a(n):
%o A357096     s = "".join(sorted(set(str(prime(n)))))
%o A357096     return int(s) if "0" not in s else int(s[1] + "0" + s[2:])
%o A357096 print([a(n) for n in range(1, 63)]) # _Michael S. Branicky_, Sep 12 2022
%Y A357096 Cf. A179239, A179308.
%K A357096 nonn,base
%O A357096 1,1
%A A357096 _Jean-Marc Rebert_, Sep 12 2022