A061844 Squares that remain squares if you decrease every digit by 1.
1, 36, 3136, 24336, 5973136, 71526293136, 318723477136, 264779654424693136, 24987377153764853136, 31872399155963477136, 58396845218255516736, 517177921565478376336, 252815272791521979771662766736, 518364744896318875336864648336, 554692513628187865132829886736
Offset: 1
Examples
13225 = 115^2 and 24336 = 156^2.
Links
- JungHwan Min, Table of n, a(n) for n = 1..78
Programs
-
Maple
A:= {1}: for d from 1 to 96 do r:= (10^d-1)/9; f:= subs(X=10,factors((X^d-1)/(X-1))[2]); q:= map(t -> op(map(s -> [s[1],t[2]*s[2]], ifactors(t[1])[2])),f); divs:= {1}; for t in q do divs:= map(x -> seq(x*t[1]^j,j=0..t[2]),divs) od; for t in select(s -> s^2 > r, divs) do x:= (t + r/t)/2; if ilog10(x^2) = d-1 and x^2 > 2*10^(d-1) and not has(convert(x^2,base,10),0) then A:= A union {x^2}; fi od od: sort(convert(A,list)); # Robert Israel, Dec 30 2015
-
Mathematica
For[digits = 1, digits <= 30, digits++, n = (10^digits - 1)/9; divList = Select[Divisors[n], (#1 >= Sqrt[n])&]; For[j = 1, j <= Length[divList], j++, x = (divList[[j]] + n/divList[[j]])/2; y = (divList[[j]] - n/divList[[j]])/2; dx = IntegerDigits[x^2]; dy = IntegerDigits[y^2]; If[(Length[dx] == digits) && (Length[dy] == digits) && (Select[dx, (#1 == 0)&] == {}), Print[x^2]]]] Flatten@Prepend[Table[Select[#[[Ceiling[(Length[#] + 1)/2] ;;]] &@(# + Reverse@#)/2 &@Divisors[(10^n - 1)/9], IntegerLength[#^2] == n && (#[[1]] != 1 && FreeQ[#, 0]&[IntegerDigits[#^2]])&]^2, {n, 30}], 1] (* JungHwan Min, Dec 29 2015 *) Join[{1},Select[Select[Flatten[Table[#^2&/@(x/.Solve[{x^2-y^2 == FromDigits[ PadRight[{},n,1]],x>0,y>0},{x,y},Integers]),{n,2,30}]], DigitCount[ #,10,0]==0&&IntegerDigits[#][[1]]>1&]// Union,IntegerQ[ Sqrt[ FromDigits[IntegerDigits[#]-1]]]&]] (* Harvey P. Dale, Apr 16 2016 *)
Formula
Extensions
More terms and program from Jonathan Cross (jcross(AT)wcox.com), Oct 08 2001
Comments