[go: up one dir, main page]

login
A357894
Integers k such that the sum of some number of initial decimal digits of sqrt(k) is equal to k.
0
0, 1, 6, 10, 14, 18, 27, 33, 41, 43, 46, 55, 56, 62, 66, 69, 70, 77, 80, 87, 93, 98, 102, 108, 110, 123, 124, 145, 147, 149, 150, 154, 157, 162, 164, 165, 168, 176, 177, 179, 180, 182, 183, 197, 204, 213, 214, 219, 224, 236, 237, 242, 248, 251, 252, 261, 262, 263, 271, 274, 285, 295
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
Cf. A106039.
Sequence in context: A007944 A290266 A200269 * A370137 A315192 A315193
KEYWORD
nonn,base
AUTHOR
Gil Broussard, Oct 18 2022
STATUS
approved