A049416
Largest number whose square has n digits.
Original entry on oeis.org
3, 9, 31, 99, 316, 999, 3162, 9999, 31622, 99999, 316227, 999999, 3162277, 9999999, 31622776, 99999999, 316227766, 999999999, 3162277660, 9999999999, 31622776601, 99999999999, 316227766016, 999999999999, 3162277660168
Offset: 1
Ulrich Schimke (ulrschimke(AT)aol.com)
31^2 = 961, but 32^2 = 1024, hence a(3) = 31.
a(4) = 99: 99^2 = 9801 has 4 digits, while 100^2 = 10000 has 5 digits.
More terms from Larry Reeves (larryr(AT)acm.org), May 16 2001
A180416
Number of positive integers below 10^n, excluding perfect squares, which have a representation as a sum of 2 positive squares.
Original entry on oeis.org
3, 33, 298, 2649, 23711, 215341, 1982296, 18447847, 173197435, 1637524156, 15570196516, 148735628858, 1426303768587, 13722207893214, 132387231596281, 1280309591127436
Offset: 1
-
isA000415 := proc(n) local x ,y2; if issqr(n) then false; else for x from 1 do y2 := n-x^2 ; if y2 < x^2 then return false; elif issqr(y2) then return true; end if; end do ; end if; end proc:
A180416 := proc(n) a := 0 ; for k from 2 to 10^n-1 do if isA000415(k) then a := a+1 ; end if; end do: a ; end proc:
for n from 1 do print(A180416(n)) ; end do; # R. J. Mathar, Jan 20 2011
-
a[n_] := a[n] = Module[{k, xMax = Floor[Sqrt[10^n - 1]]}, Table[k = x^2 + y^2; If[IntegerQ[Sqrt[k]], Nothing, k], {x, 1, xMax}, {y, x, Floor[ Sqrt[10^n - 1 - x^2]]}] // Flatten // Union // Length];
Table[Print[n, " ", a[n]]; a[n], {n, 1, 8}] (* Jean-François Alcover, Oct 31 2020 *)
A167615
Total number of positive integers below 10^n with 4 positive squares in their representation as sum of squares.
Original entry on oeis.org
1, 15, 165, 1665, 16664, 166664, 1666663, 16666663, 166666661, 1666666662, 16666666661, 166666666660, 1666666666661, 16666666666660, 166666666666659, 1666666666666660, 16666666666666658, 166666666666666657, 1666666666666666660, 16666666666666666656
Offset: 1
a(1) = 1 since 7 is the only natural number below 10 which is the sum of 4 but no fewer nonzero squares.
-
a:=proc(n)
local f,s,k;
f:=(x,y)->ceil(10^y/2^(2*x+3)-7/8):
s:=0:
for k from 0 by 1 while not f(k,n)=0 do
s:=s+f(k,n);
od:
return(s);
end;
-
a[n_] := Module[{f, s = 0, k}, f[x_, y_] := Ceiling[10^y/2^(2x+3) - 7/8]; For[k = 0, f[k, n] != 0, k++, s += f[k, n]]; Return[s]];
Array[a, 20] (* Jean-François Alcover, Oct 31 2020, after Maple *)
A180429
The number of n-digit numbers requiring 3 nonzero squares in their representation as sum of squares.
Original entry on oeis.org
2, 40, 463, 5081, 53722, 557687, 5730883, 58527612, 595228791, 6035604901, 61067111413, 616833883887, 6222429697992, 62704089037652, 631334954674157, 6352077572091621
Offset: 1
Showing 1-4 of 4 results.
Comments