|
|
A224977
|
|
n^2 minus sum of digits of n^2.
|
|
1
|
|
|
0, 0, 0, 0, 9, 18, 27, 36, 54, 72, 99, 117, 135, 153, 180, 216, 243, 270, 315, 351, 396, 432, 468, 513, 558, 612, 657, 711, 765, 828, 891, 945, 1017, 1071, 1143, 1215, 1278, 1350, 1431, 1512, 1593, 1665, 1746, 1827, 1917, 2016, 2106, 2196, 2295, 2394, 2493
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,5
|
|
COMMENTS
|
a(n) mod 9 = 0 for all n.
|
|
LINKS
|
Christian N. K. Anderson, Ulam spiral of a(n) in red, with other multiples of 9 in gray.
|
|
FORMULA
|
|
|
EXAMPLE
|
a(0) = 0^2 - 0 = 0.
a(12) = 144 - (1+4+4) = 135.
|
|
MATHEMATICA
|
Table[n^2 - Sum[DigitCount[n^2][[i]]i, {i, 9}], {n, 50}] (* Alonso del Arte, Apr 21 2013 *)
#^2-Total[IntegerDigits[#^2]]&/@Range[0, 50] (* Harvey P. Dale, May 10 2017 *)
|
|
PROG
|
(R) library(gmp); digsum<-function(x) sum(as.numeric(unlist(strsplit(as.character(x), split=""))))
ans=rep(0, 100); n=0
while(n<=100) ans[(n=n+1)]=n^2-digsum(n^2); ans
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|