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!)
A258682 Remove from n^2 all digits of n from left to right, in decimal representation. 6

%I #10 Jun 11 2015 10:14:05

%S 0,0,4,9,16,2,3,49,64,81,0,2,44,69,96,22,25,289,324,36,40,44,484,59,

%T 576,6,76,9,74,841,90,96,104,1089,1156,122,129,169,1444,1521,160,681,

%U 176,189,1936,202,211,2209,230,201,20,260,704,2809,2916,302,313

%N Remove from n^2 all digits of n from left to right, in decimal representation.

%C a(A029783(n)) = A029783(n)^2; a(A189056(n)) < A189056(n)^2;

%C a(A178501(n)) = 0.

%H Reinhard Zumkeller, <a href="/A258682/b258682.txt">Table of n, a(n) for n = 0..10000</a>

%e . n n^2 | a(n)

%e . -----------+------

%e . 20 400 | 40

%e . 21 441 | 44

%e . 22 484 | 484

%e . 23 529 | 59

%e . 24 576 | 576

%e . 25 625 | 6

%e . 26 676 | 76 not 67, as digits of n are to be removed

%e . 27 729 | 9 from left to right

%e . 28 784 | 74

%e . 29 841 | 841

%e . 30 900 | 90 .

%t a[n_]:=Module[{idn=IntegerDigits[n],idnn=IntegerDigits[n^2],idn1},

%t idn1=DeleteCases[idn,m_/;MemberQ[Complement[idn,idnn],m]];

%t Do[If[First[Position[idnn,idn1[[i]]]]!= {},idnn=Delete[idnn,First[Position[idnn,idn1[[i]]]]]],

%t {i,1,Length[idn1]}];FromDigits[idnn]]//Quiet;

%t a/@Range[0,56] (* _Ivan N. Ianakiev_, Jun 11 2015 *)

%o (Haskell)

%o import Data.List (delete)

%o a258682 n = read ('0' : minus (show (n ^ 2)) (show n)) :: Int where

%o minus [] _ = []

%o minus us [] = us

%o minus (u:us) vs | elem u vs = minus us $ delete u vs

%o | otherwise = u : minus us vs

%Y Cf. A000290, A029783, A189056, A178501.

%K nonn,base,look

%O 0,3

%A _Reinhard Zumkeller_, Jun 07 2015

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 19 07:11 EDT 2024. Contains 371782 sequences. (Running on oeis4.)