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!)
A185076 a(n) is the least number k such that (sum of digits of k^2) + (number of digits of k^2) = n, or 0 if no such k exists. 1

%I #26 Mar 16 2023 17:29:29

%S 0,1,0,10,2,100,11,1000,4,3,6,8,19,35,7,16,34,106,13,41,24,17,37,107,

%T 323,43,124,317,67,113,63,114,134,343,83,133,367,1024,167,374,264,314,

%U 386,1043,313,583,1303,3283,707,1183,3316,836,1333,3286,10133

%N a(n) is the least number k such that (sum of digits of k^2) + (number of digits of k^2) = n, or 0 if no such k exists.

%C a(n) < sqrt(10^(n-1)). 0 < a(2m) <= 10^(m-1) with the upper bound reached for 1<=m<=4. - _Chai Wah Wu_, Mar 15 2023

%H Chai Wah Wu, <a href="/A185076/b185076.txt">Table of n, a(n) for n = 1..185</a>

%F n = A004159(a(n)) + A185679(a(n)).

%e a(7)=11 since 7 = sumdigits(121) + numberdigits(121) = 4 + 3.

%t Table[k=1; While[d=IntegerDigits[k^2]; n>Length[d] && n != Total[d] + Length[d], k++]; If[Length[d] >= n, k=0]; k, {n, 50}]

%o (Python)

%o from itertools import count

%o def A185076(n):

%o for k in count(1):

%o if n == (t:=len(s:=str(k**2)))+sum(map(int,s)):

%o return k

%o if t >= n:

%o return 0 # _Chai Wah Wu_, Mar 15 2023

%Y Cf. A004159, A185679.

%K nonn,base

%O 1,4

%A _Carmine Suriano_, Feb 23 2011

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 April 19 18:05 EDT 2024. Contains 371798 sequences. (Running on oeis4.)