%I M3194 #23 Jul 09 2017 10:14:31
%S 0,1,4,1,2,5,4,5,8,1,2,5,2,3,6,5,6,9,4,5,8,5,6,9,8,9,12,1,2,5,2,3,6,5,
%T 6,9,2,3,6,3,4,7,6,7,10,5,6,9,6,7,10,9,10,13,4,5,8,5,6,9,8,9,12,5,6,9,
%U 6,7
%N Sum of squares of digits of ternary representation of n.
%D Jeffrey Shallit, personal communication.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H R. J. Mathar, <a href="/A006287/b006287.txt">Table of n, a(n) for n = 0..500</a>
%H Michael Gilleland, <a href="/selfsimilar.html">Some Self-Similar Integer Sequences</a>
%H Robert Walker, <a href="http://robertinventor.com/ftswiki/Self_Similar_Sloth_Canon_Number_Sequences">Self Similar Sloth Canon Number Sequences</a>
%p A006287 := proc(n)
%p local d ;
%p convert(n,base,3) ;
%p add(d^2,d=%) ;
%p end proc: # _R. J. Mathar_, Jun 13 2014
%t Table[Total[IntegerDigits[n,3]^2],{n,0,80}] (* _Harvey P. Dale_, Apr 23 2011 *)
%Y Cf. A053735
%K nonn,base
%O 0,3
%A _N. J. A. Sloane_.