login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A290934
a(n) equals the sum of the squares of the digits of A254958(n).
1
1, 4, 9, 16, 25, 36, 49, 64, 81, 25, 25, 100, 100, 9, 81, 81, 9, 9, 49, 36, 49, 121, 121, 49, 49, 81, 81, 36, 36, 81, 81, 81, 144, 49, 121, 49, 81, 81, 121, 121, 121, 81, 121, 81, 81, 144, 144, 121, 121, 4, 36, 36, 100, 25, 25, 36, 100, 36, 100, 25, 49, 36, 36
OFFSET
1,2
LINKS
MATHEMATICA
Select[Map[Total, Select[Array[IntegerDigits, 1550], FreeQ[#, 0] &]^2], IntegerQ@ Sqrt@ # &] (* Michael De Vlieger, Aug 15 2017 *)
PROG
(Java) import java.util.ArrayList; public class Seq {public static void main(String[] args) {int l = 1000;
ArrayList<int> squares = new ArrayList<int>();
for (int i = 1; i <= l; i++) {squares.add((i * i)); }
int term = 1;
for (int n = 1; n < Integer.MAX_VALUE; n++) {
if (!(Integer.toString(n).contains("0")))
if (squares.contains(sum(n))){
int k = 0;
for(int i = 0; i<Integer.toString(n).length(); i++){k +=(Integer.valueOf(Character.toString(Integer.toString(n).charAt(i)))*Integer.valueOf(Character.toString(Integer.toString(n).charAt(i)))); }System.out.print(k + ", "); term++; }if(term>1000)break; }}
static int sum(int n) {int s = 0; String str = Integer.toString(n); for (int i = 0; i < str.length(); i++) {s += (Integer.valueOf(Character.toString(str.charAt(i)))*Integer.valueOf(Character.toString(str.charAt(i)))); }return s; }}
(PARI) lista(nn) = {for (n=1, nn, d = digits(n); if (vecmin(d) && issquare(s=sum(k=1, #d, d[k]^2)), print1(s, ", ")); ); } \\ Michel Marcus, Aug 28 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jonathan Schwartz, Aug 14 2017
STATUS
approved