OFFSET
1,1
COMMENTS
It would be interesting to investigate such numbers w.r.t. higher powers and larger n.
LINKS
Klaus Brockhaus, Table of n, a(n) for n = 1..1000
EXAMPLE
The smallest such number is 41, since it is both the sum of two squares (i.e., 4^2, 5^2) and the concatenation of two squares (i.e., 2^2, 1^2).
3649 also belongs to this sequence because it is sum of two squares (i.e., 60^2, 7^2) and the concatenation of two squares (i.e., 6^2, 7^2).
MATHEMATICA
(* find numbers that can be split as the SUM of two powers (squares, cubes, etc.) and also as CONCATENATION of the same powers *)
siamesePowers[n_, power_] := Module[
{listOfSumOfPowers, a, b, i, listOfConcatenatedPowers},
listOfSumOfPowers = Outer[Plus, Table[{i^power}, {i, 1, n}], Table[{i^power}, {i, 1, n}]] // Flatten;
concatNumbers[a_, b_] := IntegerDigits[{a, b}] // Flatten // FromDigits;
listOfConcatenatedPowers := Outer[concatNumbers, Table[i^power, {i, 1, n}], Table[i^power, {i, 1, n}]] // Flatten;
(* The intersection of these 2 lists is the set of our special Siamese numbers *)
Intersection[listOfSumOfPowers, listOfConcatenatedPowers]
]
siamesePowers[30, 2] (* Generate the first 30 such numbers for squares *)
PROG
(Magma) z:=65; T:=Sort([ s: a in [b..z], b in [1..z] | s le z^2 where s is a^2+b^2 ]); SplitToSquares:=function(n); V:=[]; S:=Intseq(n); for j in [1..#S-1] do A:=[ S[k]: k in [1..j] ]; a:=Seqint(A); B:=[ S[k]: k in [j+1..#S] ]; b:=Seqint(B); if a gt 0 and A[#A] gt 0 and IsSquare(a) and IsSquare(b) then Append(~V, [<b, a>]); end if; end for; return V; end function; U:=[ p: j in [1..#T] | P ne [] where P is SplitToSquares(p) where p is T[j] ]; [ U[j]: j in [1..#U] | j eq 1 or U[j-1] ne U[j] ]; // Klaus Brockhaus, Jun 19 2011
(PARI) is_A191867(n) = for(p=10, n, issquare(n\p) && issquare(n%p) && n%p*10>=p && return(is_A000404(n)); p=p*10-1) \\ M. F. Hasler, Jun 19 2011
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Raghavendra Ugare, Jun 18 2011
STATUS
approved