login
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
0, 1, 0, 10, 2, 100, 11, 1000, 4, 3, 6, 8, 19, 35, 7, 16, 34, 106, 13, 41, 24, 17, 37, 107, 323, 43, 124, 317, 67, 113, 63, 114, 134, 343, 83, 133, 367, 1024, 167, 374, 264, 314, 386, 1043, 313, 583, 1303, 3283, 707, 1183, 3316, 836, 1333, 3286, 10133
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
FORMULA
n = A004159(a(n)) + A185679(a(n)).
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
Sequence in context: A096043 A001202 A054841 * A178643 A038304 A290308
KEYWORD
nonn,base
AUTHOR
Carmine Suriano, Feb 23 2011
STATUS
approved