OFFSET
1,1
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..1000
Jeremiah Bartz, Bruce Dearden, and Joel Iiams, Classes of Gap Balancing Numbers, arXiv:1810.07895 [math.NT], 2018.
Jeremiah Bartz, Bruce Dearden, and Joel Iiams, Counting families of generalized balancing numbers, The Australasian Journal of Combinatorics (2020) Vol. 77, Part 3, 318-325.
EXAMPLE
419 is prime and numbers 49 and 1 are square.
12659 is prime and numbers 169 and 25 are square.
MATHEMATICA
halfQ[n_, k_] := IntegerQ[Sqrt[FromDigits[IntegerDigits[n][[k ;; -1 ;; 2]]]]];
Select[Range[200000], PrimeQ[#] && halfQ[#, 1] && halfQ[#, 2] &] (* Amiram Eldar, Nov 05 2018 *)
PROG
(Perl) use ntheory ':all'; forprimes { my @d = split(//, $_); if (is_square(join('', map { $d[2*$_] } (0..$#d/2))) && is_square(join('', map { $d[2*$_+1] } (0..@d/2-1)))) { print "$_, " } } 10**6; # Daniel Suteu, Dec 03 2018
(PARI) isok(p) = {if (isprime(p), my (d=digits(p)); if (#d > 1, if (#d % 2, lo = #d\2+1; le = #d\2, le = #d\2; lo = #d\2); issquare(fromdigits(vector(le, k, d[2*k]))) && issquare(fromdigits(vector(lo, k, d[2*k-1]))); ); ); } \\ Michel Marcus, Dec 05 2018
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Marius A. Burtea, Oct 26 2018
STATUS
approved