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!)
A102600 Largest prime which can be formed from digits of n^2, or 0, if no prime. 1
0, 0, 0, 61, 5, 3, 0, 0, 0, 0, 211, 41, 691, 691, 5, 5, 829, 43, 631, 0, 41, 0, 59, 67, 5, 67, 97, 487, 41, 0, 691, 4201, 809, 6151, 2521, 691, 9631, 4441, 521, 601, 8161, 761, 8941, 9631, 5, 6211, 2029, 43, 4201, 5, 601, 4027, 8209, 691, 5023, 6133, 439, 6343, 8431, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
LINKS
FORMULA
a(n) = A101991(n^2). - Michel Marcus, Oct 05 2013
EXAMPLE
a(11)=211 because 211 is the largest prime which can be made from digits of 11*11=121: {1,1,2}.
MAPLE
f:= proc(n) local L, N, d, i, j, S, s, p;
L:= convert(n^2, base, 10);
N:= nops(L);
for d from N to 1 by -1 do
S:= sort(combinat:-permute(L, d));
for i from nops(S) to 1 by -1 do
s:= S[i];
p:= add(s[j]*10^(d-j), j=1..d);
if isprime(p) then return p fi
od od;
0
end proc:
map(f, [$1..100]); # Robert Israel, Jan 10 2024
MATHEMATICA
a[n_]:=Max[0, Select[FromDigits/@Permutations[IntegerDigits[n^2], {1, IntegerLength[n^2]}], PrimeQ]]; Table[a[n], {n, 60}] (* James C. McMahon, Jan 09 2024 *)
CROSSREFS
Cf. A101991.
Sequence in context: A051322 A345224 A198189 * A316918 A077331 A106426
KEYWORD
base,easy,nonn,look
AUTHOR
Zak Seidov, Jan 29 2005
EXTENSIONS
Data corrected for n={18,33,39,57} by James C. McMahon, Jan 10 2024.
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 March 28 08:19 EDT 2024. Contains 371236 sequences. (Running on oeis4.)