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
KEYWORD
AUTHOR
Giorgos Kalogeropoulos, Mar 27 2025
STATUS
approved
