OFFSET
1,3
COMMENTS
For integers k that are squares of integers, "Sum of initial digits" includes digits to the left of the decimal point only, as there are no digits other than zero to the right of the decimal point. This constraint contributes terms 0 and 1 to the sequence.
For integers k with irrational sqrt(k), "Sum of initial digits" includes digits to the left of the decimal point and to the right of the decimal point.
"Initial digits" implies a sufficient number of digits to produce either a sum > k or a sum = k condition, halting at whichever condition occurs first (sum > k condition is discarded).
EXAMPLE
41 is a term because sqrt(41) = 6.4031242374328... and 6+4+0+3+1+2+4+2+3+7+4+3+2 = 41.
42 is not a term because sqrt(42) = 6.480740698407860... and 6+4+8+0+7+4+0+6 = 35 and 6+4+8+0+7+4+0+6+9 = 44 (no sum of initial digits = 42).
144 is not a term because sqrt(144) = 12 (no digits to the right of the decimal), and 1+2 is not equal to 144.
PROG
(PARI) is(n) = { my (d=digits(sqrtint(n)), s=0); for (i=1, #d, s+=d[i]; if (s==n, return (1), s>n, return (0); ); ); if (issquare(n), return (n==0); ); my (n0=n); while (1, s+=sqrtint(n0*=100)%10; if (s==n, return (1), s>n, return (0); ); ); } \\ Rémy Sigrist, Oct 19 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Gil Broussard, Oct 18 2022
STATUS
approved