cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A380585 a(n) = floor(n^2 / 10^m) + (n^2 mod 10^m) where m is the number of decimal digits in n.

This page as a plain text file.
%I A380585 #36 Apr 10 2025 17:14:19
%S A380585 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,
%T A380585 82,36,91,49,9,70,34,99,67,37,108,82,58,36,16,97,81,67,55,45,37,31,27,
%U A380585 25,25,27,31,37,45,55,67,81,97,115,36,58,82,108,136,67,99
%N A380585 a(n) = floor(n^2 / 10^m) + (n^2 mod 10^m) where m is the number of decimal digits in n.
%C A380585 The positive fixed points of this sequence are the Kaprekar numbers (A053816).
%C A380585 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
%H A380585 Giorgos Kalogeropoulos, <a href="/A380585/b380585.txt">Table of n, a(n) for n = 0..10000</a>
%H A380585 Seiichi Manyama, <a href="https://manchanr6.blogspot.com/2019/10/191006.html">Post 191006</a>
%H A380585 Ivo Zerkov, <a href="https://groups.google.com/g/seqfan/c/VGNHgEb2BKA">22222^2</a>, seqfan post.
%p A380585 a:= n-> (k-> iquo(n^2, k)+(n^2 mod k))(10^length(n)):
%p A380585 seq(a(n), n=0..66);  # _Alois P. Heinz_, Mar 27 2025
%t A380585 Table[m=IntegerLength@n; Floor[n^2/10^m] + Mod[n^2,10^m], {n,0,66}]
%o A380585 (Python)
%o A380585 def a(n): return (nn:=n**2)//(M:=10**len(str(n))) + nn%M
%o A380585 print([a(n) for n in range(0, 67)]) # _Michael S. Branicky_, Mar 27 2025
%o A380585 (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 */
%Y A380585 Cf. A053816 (fixed points), A055642, A344851, A358072 (similar plot).
%K A380585 nonn,base,look
%O A380585 0,3
%A A380585 _Giorgos Kalogeropoulos_, Mar 27 2025