login
A380585
a(n) = floor(n^2 / 10^m) + (n^2 mod 10^m) where m is the number of decimal digits in n.
2
0, 1, 4, 9, 7, 7, 9, 13, 10, 9, 1, 22, 45, 70, 97, 27, 58, 91, 27, 64, 4, 45, 88, 34, 81, 31, 82, 36, 91, 49, 9, 70, 34, 99, 67, 37, 108, 82, 58, 36, 16, 97, 81, 67, 55, 45, 37, 31, 27, 25, 25, 27, 31, 37, 45, 55, 67, 81, 97, 115, 36, 58, 82, 108, 136, 67, 99
OFFSET
0,3
COMMENTS
The positive fixed points of this sequence are the Kaprekar numbers (A053816).
The sum of two halves of the decimal expansion of n^2 after having added a leading 0 if that number of digits is odd. - Michel Marcus, Mar 28 2025
LINKS
Giorgos Kalogeropoulos, Table of n, a(n) for n = 0..10000
Seiichi Manyama, Post 191006
Ivo Zerkov, 22222^2, seqfan post.
MAPLE
a:= n-> (k-> iquo(n^2, k)+(n^2 mod k))(10^length(n)):
seq(a(n), n=0..66); # Alois P. Heinz, Mar 27 2025
MATHEMATICA
Table[m=IntegerLength@n; Floor[n^2/10^m] + Mod[n^2, 10^m], {n, 0, 66}]
PROG
(Python)
def a(n): return (nn:=n**2)//(M:=10**len(str(n))) + nn%M
print([a(n) for n in range(0, 67)]) # Michael S. Branicky, Mar 27 2025
(PARI) a(n) = my(d=digits(n^2)); if (#d % 2, d = concat(0, d)); my(m=#d/2); fromdigits(Vec(d, m)) + fromdigits(vector(#d-m, i, d[m+i])); /* Michel Marcus, Mar 28 2025 */
CROSSREFS
Cf. A053816 (fixed points), A055642, A344851, A358072 (similar plot).
Sequence in context: A339023 A169908 A004159 * A092554 A155787 A338304
KEYWORD
nonn,base,look
AUTHOR
STATUS
approved