cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A048385 In base-10 notation replace digits of n with their squared values (Version 1).

This page as a plain text file.
%I A048385 #32 Sep 08 2022 08:44:57
%S A048385 0,1,4,9,16,25,36,49,64,81,10,11,14,19,116,125,136,149,164,181,40,41,
%T A048385 44,49,416,425,436,449,464,481,90,91,94,99,916,925,936,949,964,981,
%U A048385 160,161,164,169,1616,1625,1636,1649,1664,1681,250,251,254,259,2516,2525
%N A048385 In base-10 notation replace digits of n with their squared values (Version 1).
%H A048385 Alois P. Heinz, <a href="/A048385/b048385.txt">Table of n, a(n) for n = 0..10000</a>
%F A048385 a(n) >= n with equality iff n belongs to A007088. - _Rémy Sigrist_, May 17 2019
%p A048385 a:= n-> (s-> parse(cat(seq(parse(s[i])^2, i=1..length(s)))))(""||n):
%p A048385 seq(a(n), n=0..70);  # _Alois P. Heinz_, Jul 04 2014
%t A048385 Table[FromDigits[Flatten[IntegerDigits/@(IntegerDigits[n]^2)]],{n,0,80}] (* _Harvey P. Dale_, May 06 2019 *)
%o A048385 (Magma) [0] cat [StringToInteger(&cat[IntegerToString(h): h in Reverse([i^2: i in Intseq(n)])]): n in [1..55]]; // _Bruno Berselli_, Jul 31 2012
%o A048385 (Python)
%o A048385 def digits(n):
%o A048385     d=[]
%o A048385     while n>0:
%o A048385         d.append(n%10)
%o A048385         n=n//10
%o A048385     return d
%o A048385 def sqdig(n):
%o A048385     new=0
%o A048385     num=digits(n)
%o A048385     spacing=0
%o A048385     while num:
%o A048385         k=num.pop(0)
%o A048385         new+=(10**(spacing))*(k**2)
%o A048385         if k>3:
%o A048385             spacing+=1
%o A048385         spacing+=1
%o A048385     return new
%o A048385 # _David Nacin_, Aug 19 2012
%o A048385 (Haskell)
%o A048385 a048385 0 = 0
%o A048385 a048385 n = read (show (a048385 n') ++ show (m ^ 2)) :: Integer
%o A048385             where (n', m) = divMod n 10
%o A048385 -- _Reinhard Zumkeller_, Jul 08 2014
%o A048385 (PARI) a(n) = if (n, fromdigits(concat(apply(d -> my (d2=d^2); if (d2, digits(d2), [0]), digits(n)))), 0) \\ _Rémy Sigrist_, May 17 2019
%o A048385 (MATLAB) m=1;
%o A048385 for u=0:200 digit=dec2base(u,10)-'0'; digitp=digit.^2;
%o A048385     sol(m)=str2num(strrep(num2str(digitp), ' ', ''));m=m+1;
%o A048385 end
%o A048385 sol % _Marius A. Burtea_, May 17 2019
%Y A048385 See A068522 for another version.
%Y A048385 Cf. A007088, A048386, A048387, A048388, A048389.
%K A048385 nonn,base
%O A048385 0,3
%A A048385 _Patrick De Geest_, Mar 15 1999