A028868
Primes that when squared give numbers with digits in nonascending order.
Original entry on oeis.org
From _David A. Corneth_, Oct 28 2023: (Start)
31 is in the sequence as 31 is prime and 31^2 = 961 which has its digits in nonascending order.
2979 is not in the sequence even though 2979^2 = 8874441 does have digits in nonascending order but 2979 = 3^2 * 331 is not prime. (End)
-
is(n) = my(d = digits(n^2)); d == vecsort(d,,4) && isprime(n) \\ David A. Corneth, Oct 28 2023
-
\\ see link for a faster program
A028866
Squares of primes having digits in nondecreasing order.
Original entry on oeis.org
4, 9, 25, 49, 169, 289, 1369, 4489, 6889, 11449, 27889, 113569, 134689, 146689, 344569, 2778889, 27777888889, 111113555569, 111133556689, 111333666889, 113344668889, 444444888889, 1111133355666889, 1133444466888889
Offset: 1
-
Select[Prime[Range[100]]^2, IntegerDigits[#] == Sort[IntegerDigits[#]] &] (* Alonso del Arte, Jan 18 2017 *)
-
is(n)=my(d=digits(n));d==vecsort(d) && issquare(n,&n) && isprime(n) \\ Charles R Greathouse IV, Jun 05 2013
A028869
Squares of primes with digits in nonascending order.
Original entry on oeis.org
961 = 31^2 is in the sequence since its digits (9, 6, 1) are in descending order.
1369 = 37^2 is not in the sequence, since its digits in descending order are: 9, 6, 3, 1.
-
Select[Prime[Range[100]]^2, IntegerDigits[#] == Sort[IntegerDigits[#], Less] &] (* Alonso del Arte, Aug 12 2016 *)
Showing 1-3 of 3 results.
Comments