login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A061844 Squares that remain squares if you decrease every digit by 1. 12

%I #55 Sep 12 2023 12:10:45

%S 1,36,3136,24336,5973136,71526293136,318723477136,264779654424693136,

%T 24987377153764853136,31872399155963477136,58396845218255516736,

%U 517177921565478376336,252815272791521979771662766736,518364744896318875336864648336,554692513628187865132829886736

%N Squares that remain squares if you decrease every digit by 1.

%C The terms may be calculated efficiently by solving x^2 - y^2 = 111...1; this is done by factoring 111..1 = (x + y)(x - y).

%C Note that some solutions will produce a square containing a zero digit so the solution is impermissible; for example, 460^2 - 317^2 = 111111 but 460^2 = 211600. - _Wendy Appleby_, Sep 20 2015

%C Except for a(1) = 1, we don't allow decreasing the digits to create a leading 0. Thus 126736 = 356^2 is not included, even though 126736 - 111111 = 15625 = 125^2. - _Robert Israel_, Dec 30 2015

%C If it exists, a(79) > 10^262. - _Max Alekseyev_, Sep 05 2023

%C From _Robert Israel_, Jan 04 2016: (Start)

%C The sequence may well be finite.

%C It is known that A000005(n) = O(n^epsilon) for all epsilon>0.

%C Therefore if 1 < c < 10/9, for d sufficiently large (10^d-1)/9 has fewer than c^d divisors, and thus fewer than c^d possible candidates for x^2 having d digits.

%C Heuristically, x^2 has probability ~ (9/10)^d of having no digits 0.

%C Thus we expect fewer than (9c/10)^d terms having d digits.

%C Since Sum_d (9c/10)^d converges, we expect only finitely many terms.

%C Of course, this is only a heuristic argument, but it seems to fit well with the data. (End)

%H JungHwan Min, <a href="/A061844/b061844.txt">Table of n, a(n) for n = 1..78</a>

%F a(n) = A048379(A061843(n)). - _Max Alekseyev_, Jul 26 2023

%e 13225 = 115^2 and 24336 = 156^2.

%p A:= {1}:

%p for d from 1 to 96 do

%p r:= (10^d-1)/9;

%p f:= subs(X=10,factors((X^d-1)/(X-1))[2]);

%p q:= map(t -> op(map(s -> [s[1],t[2]*s[2]], ifactors(t[1])[2])),f);

%p divs:= {1};

%p for t in q do

%p divs:= map(x -> seq(x*t[1]^j,j=0..t[2]),divs)

%p od;

%p for t in select(s -> s^2 > r, divs) do

%p x:= (t + r/t)/2;

%p if ilog10(x^2) = d-1 and x^2 > 2*10^(d-1) and not has(convert(x^2,base,10),0) then

%p A:= A union {x^2};

%p fi

%p od

%p od:

%p sort(convert(A,list)); # _Robert Israel_, Dec 30 2015

%t 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]]]]

%t 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 *)

%t 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 *)

%Y Cf. A048379, A052382, A061843, A117755.

%K base,nonn,nice

%O 1,2

%A _Erich Friedman_, Jun 23 2001

%E More terms and program from Jonathan Cross (jcross(AT)wcox.com), Oct 08 2001

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 8 23:08 EDT 2024. Contains 372341 sequences. (Running on oeis4.)