login
Consider a number n with m decimal digits, m>9. The sequence lists the numbers n such that the prefix of length m-1 and the suffix of length m-1 are both perfect squares.
3

%I #8 Jun 25 2014 09:46:14

%S 10,11,14,19,40,41,44,49,90,91,94,99,164,364,649,816,1000,1001,1004,

%T 1009,1441,1961,2256,4000,4001,4004,4009,4841,6256,7841,9000,9001,

%U 9004,9009,20256,30256,31369,40961,46241,51849,54761,60841,73969,79216,90256,94096

%N Consider a number n with m decimal digits, m>9. The sequence lists the numbers n such that the prefix of length m-1 and the suffix of length m-1 are both perfect squares.

%C Let x(0)x(1)... x(q-1)x(q) denote the decimal expansion of a number n. The sequence lists the numbers n such that the prefix x(0)x(1)... x(q-1) and the suffix x(1)... x(q-1)x(q) are both a perfect square.

%C The primes of the sequence are 11, 19, 41, 1009, 4001, 7841, 9001, 40961,...

%e 816 is in the sequence because 81 and 16 are squares.

%p with(numtheory):

%p for n from 10 to 20000 do:

%p x:=convert(n, base, 10):n1:=nops(x):

%p s1:=sum('x[i]*10^(i-1) ', 'i'=1..n1-1):

%p s2:=(n-irem(n,10))/10:ss1:=sqrt(s1):ss2:=sqrt(s2):

%p if ss1=floor(ss1) and ss2=floor(ss2)

%p then

%p printf(`%d, `, n):

%p else

%p fi:

%p od:

%o (PARI) isok(n) = (left = n\10) && issquare(left) && (pt = 10^(#Str(n)-1)) && issquare(n - (n\pt)*pt); \\ _Michel Marcus_, Jun 25 2014

%Y Cf. A000290, A046030, A244282.

%K nonn,base

%O 1,1

%A _Michel Lagneau_, Jun 25 2014