OFFSET
1,4
COMMENTS
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
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..185
EXAMPLE
a(7)=11 since 7 = sumdigits(121) + numberdigits(121) = 4 + 3.
MATHEMATICA
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}]
PROG
(Python)
from itertools import count
def A185076(n):
for k in count(1):
if n == (t:=len(s:=str(k**2)))+sum(map(int, s)):
return k
if t >= n:
return 0 # Chai Wah Wu, Mar 15 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Carmine Suriano, Feb 23 2011
STATUS
approved