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!)
A290934 a(n) equals the sum of the squares of the digits of A254958(n). 1

%I #20 May 30 2022 16:33:11

%S 1,4,9,16,25,36,49,64,81,25,25,100,100,9,81,81,9,9,49,36,49,121,121,

%T 49,49,81,81,36,36,81,81,81,144,49,121,49,81,81,121,121,121,81,121,81,

%U 81,144,144,121,121,4,36,36,100,25,25,36,100,36,100,25,49,36,36

%N a(n) equals the sum of the squares of the digits of A254958(n).

%H Jonathan Schwartz, <a href="/A290934/b290934.txt">Table of n, a(n) for n = 1..1000</a>

%t Select[Map[Total, Select[Array[IntegerDigits, 1550], FreeQ[#, 0] &]^2], IntegerQ@ Sqrt@ # &] (* _Michael De Vlieger_, Aug 15 2017 *)

%o (Java) import java.util.ArrayList;public class Seq {public static void main(String[] args) {int l = 1000;

%o ArrayList<int> squares = new ArrayList<int>();

%o for (int i = 1; i <= l; i++) {squares.add((i * i));}

%o int term = 1;

%o for (int n = 1; n < Integer.MAX_VALUE; n++) {

%o if (!(Integer.toString(n).contains("0")))

%o if (squares.contains(sum(n))){

%o int k = 0;

%o 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;}}

%o 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;}}

%o (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

%Y Cf. A000290, A003132, A254958.

%K nonn,base

%O 1,2

%A _Jonathan Schwartz_, Aug 14 2017

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 April 24 10:11 EDT 2024. Contains 371935 sequences. (Running on oeis4.)