login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A333034 a(n) is the sum of the digits of the squares of all n-digit numbers. 2
69, 1410, 21921, 298725, 3792660, 46016727, 541129686, 6221175405, 70311424443, 784112741880, 8651123311875, 94611219470547 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
a(n) == 6 (mod 9). - Robert Israel, Mar 06 2020
LINKS
FORMULA
a(n) = A071317(10^n) - A071317(10^(n-1)).
EXAMPLE
a(1) = 1+4+9+(1+6)+(2+5)+(3+6)+(4+9)+(6+4)+(8+1) = 69.
MAPLE
ds:= proc(x) local t, s, r;
s:= x; t:= 0;
while s > 0 do
r:= s mod 10;
t:= t + r;
s:= (s-r)/10;
od;
t
end proc:
seq(add(ds(x^2), x=10^(n-1)..10^n-1), n=1..5);
PROG
(PARI) for(d=0, 6, print1(sum(k=10^d, 10^(d+1)-1, vecsum(digits(k^2))), ", ")) \\ Hugo Pfoertner, Mar 05 2020
(Python)
def A333034(n):
return sum(int(d) for i in range(10**(n-1), 10**n) for d in str(i**2)) # Chai Wah Wu, Mar 05 2020
CROSSREFS
Cf. A071317.
Sequence in context: A253000 A295212 A264283 * A200826 A359105 A133708
KEYWORD
nonn,more,base
AUTHOR
Robert Israel, Mar 05 2020
EXTENSIONS
a(8)-a(9) from Hugo Pfoertner, Mar 05 2020
a(10)-a(12) from Giovanni Resta, Mar 07 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 19 07:25 EDT 2024. Contains 370955 sequences. (Running on oeis4.)