A030145 Primes such that in p^2 the parity of digits alternates.
2, 3, 5, 7, 11, 13, 19, 23, 31, 113, 127, 137, 181, 269, 277, 281, 311, 461, 463, 661, 673, 677, 1019, 1277, 1361, 1973, 2287, 2339, 2377, 2411, 2423, 2689, 2731, 4673, 5023, 5081, 5261, 6563, 6577, 8311, 9013, 9437, 9439, 10181, 10463
Offset: 1
Links
- Giovanni Resta, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
id[n_]:=IntegerDigits[n]; t={}; Do[p=Prime[n]; If[Length[id[p]]==1,AppendTo[t,p], If[Union[Abs[Differences[Boole/@EvenQ[id[p^2]]]]]=={1}, AppendTo[t,p]]], {n,1300}]; t (* Jayanta Basu, May 07 2013 *) pdaQ[n_]:=FreeQ[Differences[Boole[EvenQ[IntegerDigits[n^2]]]],0]; Select[ Prime[ Range[1300]],pdaQ] (* Harvey P. Dale, Jul 30 2019 *)
Formula
a(n)^2 = A030146(n). - Giovanni Resta, Aug 16 2018
Extensions
Offset corrected by Giovanni Resta, Aug 16 2018