A380585 a(n) = floor(n^2 / 10^m) + (n^2 mod 10^m) where m is the number of decimal digits in n.
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
Links
- Giorgos Kalogeropoulos, Table of n, a(n) for n = 0..10000
- Seiichi Manyama, Post 191006
- Ivo Zerkov, 22222^2, seqfan post.
Programs
-
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}]
-
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 */
-
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
Comments