A028868 Primes that when squared give numbers with digits in nonascending order.
2, 3, 29, 31
Offset: 1
Examples
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)
Links
- David A. Corneth, PARI program
Programs
-
PARI
is(n) = my(d = digits(n^2)); d == vecsort(d,,4) && isprime(n) \\ David A. Corneth, Oct 28 2023
-
PARI
\\ see link for a faster program
Extensions
Name clarified by Jon E. Schoenfield, Oct 27 2023
Comments