A061909 Skinny numbers: numbers n such that there are no carries when n is squared by "long multiplication".
0, 1, 2, 3, 10, 11, 12, 13, 20, 21, 22, 30, 31, 100, 101, 102, 103, 110, 111, 112, 113, 120, 121, 122, 130, 200, 201, 202, 210, 211, 212, 220, 221, 300, 301, 310, 311, 1000, 1001, 1002, 1003, 1010, 1011, 1012, 1013, 1020, 1021, 1022, 1030, 1031, 1100, 1101, 1102
Offset: 1
Examples
12 is a member as 12^2 = 144, digit reversal of 144 is 441 = 21^2. 13 is a member as 13 squared is 169 and sqrt(961) = 31. 113 is a member as 113^2 = 12769, reversal(12769) = 96721 = 311^2. (Sum of digits of 13)^2 = 4^2 = 16 and sum of digits of 13^2 = sum of digits of 169 = 16. 10^k is in the sequence for all k >= 0, since reversal((10^k)^2) = 1 = (reversal(10^k))^2. - _Ryan Propper_, Sep 09 2005
Links
Crossrefs
Programs
-
Haskell
a061909 n = a061909_list !! (n-1) a061909_list = filter (\x -> a004086 (x^2) == (a004086 x)^2) [0..] -- Reinhard Zumkeller, Jul 08 2011
-
Maple
rev:=proc(n) local nn, nnn: nn:=convert(n,base,10): add(nn[nops(nn)+1-j]*10^(j-1),j=1..nops(nn)) end: a:=proc(n) if sqrt(rev(n^2))=rev(n) then n else fi end: seq(a(n),n=1..1200); # Emeric Deutsch, Mar 31 2007 f := []: for n from 1 to 1000 do if (convert(convert(n,base,10),`+`))^2 = convert(convert(n^2,base,10),`+`) then f := [op(f), n] fi; od; f; # Asher Auel
-
Mathematica
r[n_] := FromDigits[Reverse[IntegerDigits[n]]]; Do[If[r[n]^2 == r[n^2], Print[n]], {n, 1, 10^4}] (* Ryan Propper, Sep 09 2005 *) Select[Range[0,1200],IntegerReverse[#^2]==IntegerReverse[#]^2&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 02 2017 *)
-
PARI
is(n)=sumdigits(n)^2==sumdigits(n^2) \\ Charles R Greathouse IV, Jun 21 2017
-
Python
from itertools import count, islice, product def sd(n): return sum(map(int, str(n))) def ok(n): return sd(n**2) == sd(n)**2 def agen(): # generator of terms yield from [0, 1, 2, 3] for d in count(2): for f in "123": rset = "01" if f == "3" else "012" if f == "2" else "0123" for r in product(rset, repeat=d-1): t = int(f+"".join(r)) if ok(t): yield t print(list(islice(agen(), 53))) # Michael S. Branicky, Dec 23 2022
Formula
a(n) >> n^2.0959..., where the exponent is log 10/log 3. - Charles R Greathouse IV, Sep 21 2012
Comments