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.

Showing 1-7 of 7 results.

A085306 Prime numbers such that first reversing digits and after squaring equals the result of first-squaring and after-reversing. Primes in A085305.

Original entry on oeis.org

2, 3, 11, 13, 31, 101, 103, 113, 211, 311, 1013, 1021, 1031, 1103, 1201, 1301, 2011, 2111, 3001, 3011, 10103, 10111, 10211, 11003, 11113, 12011, 12101, 13001, 20011, 20021, 20101, 20201, 21001, 21011, 21101, 22111, 30011, 100003, 100103, 101021
Offset: 1

Views

Author

Labos Elemer, Jun 27 2003

Keywords

Examples

			n=13 is here because 31^2 = 961 = rev(169) = rev(13^2) = rev(rev(31)^2).
65 solutions below 1000000.
		

Crossrefs

Cf. A085305.

Programs

  • Mathematica
    rt[x_] := tn[Reverse[IntegerDigits[x]]] Do[s=rt[n^2]; s1=rt[n]^2; If[Equal[s, s1]&& !Equal[Mod[n, 10], 0]&&PrimeQ[n], Print[n]], {n, 1, 1000000}]
    (* Second program: *)
    Select[Prime[Range[10^5]], IntegerReverse[#]^2 == IntegerReverse[#^2]&] (* Jean-François Alcover, Feb 13 2021 *)

Formula

Prime number solutions to rev(x^2) = rev(x)^2.

A061909 Skinny numbers: numbers n such that there are no carries when n is squared by "long multiplication".

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jun 14 2007

Keywords

Comments

There are several equivalent formulations. Suppose the decimal expansion of n is n = Sum_{i = 0..k } d_i 10^i, where 0 <= d_i <= 9 for i = 0..k.
Then n is skinny if and only if:
(i) e_i = Sum_{ j = 0..i } d_j d_{i-j} <= 9 for i = 0 .. 2k-1;
(ii) if P_n(X) = Sum_{i = 0..k } d_i X^i (so P_n(10) = n) then P_{n^2}(X) = P_n(X)^2;
(iii) R(n^2) = R(n)^2, where R(n) means the digit reversal of n;
(iv) (sum of digits of n)^2 = sum of digits of n^2.
This entry is a merging and reworking of earlier entries from Asher Auel, May 17 2001 and Amarnath Murthy, Aug 15 2005. Thanks to Andrew S. Plewe for suggesting that these sequences might be identical.
Also, numbers n in base 10 whose base 10 expansion of n^2 is the same as if n were interpreted in some base b>10 and n^2 also calculated in that base. - Andrew Silberman (sandrew(AT)math.upenn.edu), Oct 30 2006
From David Applegate and N. J. A. Sloane, Jun 14 2007: (Start)
The decimal expansion of a skinny number n may contain only 0's, 1's, 2's and 3's.
There may be at most one 3 and if there is a 3 then there can be no 2's. (Hence of course if there are any 2's then there can be no 3's.)
There is no limit to the number of 1's and 2's - consider for example Sum_{i=0..m} 10^{2^i} and 2*Sum_{i=0..m} 10^{2^i}.
These are necessary conditions, but are not sufficient (e.g., 131 is not skinny). (End)
There are fifty-five skinny numbers without a 0 digit, the greatest being a(5203) = 111111111. - Jason Zimba, Jul 05 2020

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
		

Crossrefs

A085305 is a subsequence.
The primes in this sequence are given by A085306.
Numbers n such that A067552(n) = 0.

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

A085315 Numbers such that first reversing digits and after forming its cube equals the result of first-form-cube and after-reverse operation with exclusion of cases divisible by 10.

Original entry on oeis.org

1, 2, 7, 11, 101, 111, 1001, 1011, 1101, 10001, 10011, 10101, 11001, 11011, 100001, 100011, 100101, 100111, 101001, 101011, 101101, 110001, 110011, 110101, 111001, 1000001, 1000011, 1000101, 1000111, 1001001, 1001011, 1001101, 1010001, 1010011, 1011001, 1100001, 1100011, 1100101, 1101001, 1110001
Offset: 1

Views

Author

Labos Elemer, Jul 01 2003

Keywords

Examples

			n=100111,rev[n]=111001, n^3=1003333697667631.
rev[n^3]=111001^3=1367667963333001=rev[n]^3.
		

Crossrefs

Programs

  • Maple
    r:= n-> (s-> parse(cat(seq(s[-i], i=1..length(s)))))(""||n):
    q:= n-> irem(n, 10)>0 and r(n^3)=r(n)^3:
    select(q, [$1..2000000])[];  # Alois P. Heinz, Oct 22 2021
  • Mathematica
    nd[x_, y_] := 10*x+y; tn[x_] := Fold[nd, 0, x] rt[x_] := tn[Reverse[IntegerDigits[x]]] Do[s=rt[n^3]; s1=rt[n]^3; If[Equal[s, s1]&& !Equal[Mod[n, 10], 0], k=k+1; Print[n]], {n, 1, 10000000}]; k

Formula

Solutions to rev[x^3]=rev[x]^3 without numbers divisible by 10.
{ A069494 } minus { A008592 }. - Alois P. Heinz, Oct 22 2021

A098701 Number of solutions to rev(x^2) = rev(x)^2 with n digits, where the rev(x) function reverses the digits of x.

Original entry on oeis.org

3, 6, 15, 39, 90, 209, 457, 991, 2062, 4288, 8521, 17075, 33108, 64073, 121045, 228811, 423188, 781582, 1420445, 2571855, 4599072, 8187723, 14426529, 25278777, 43966808, 75959592, 130496955, 222598065, 378036562, 637128539, 1071282807
Offset: 1

Views

Author

Martin Renner, Oct 27 2004

Keywords

Comments

Excludes multiples of 10.

Crossrefs

Cf. A085305.

Extensions

a(7)-a(31) from David Radcliffe, May 05 2013

A225301 Number of solutions to rev(x^2) = rev(x)^2 with at most n digits, where the function rev(x) reverses the digits of x.

Original entry on oeis.org

4, 10, 25, 64, 154, 363, 820, 1811, 3873, 8161, 16682, 33757, 66865, 130938, 251983, 480794, 903982, 1685564, 3106009, 5677864, 10276936, 18464659, 32891188, 58169965, 102136773, 178096365, 308593320, 531191385, 909227947, 1546356486, 2617639293
Offset: 1

Views

Author

David Radcliffe, May 05 2013

Keywords

Comments

Numbers (other than 0) that end in zero are excluded.

Examples

			For n = 2 the a(2) = 10 solutions are 0, 1, 2, 3, 11, 12, 13, 21, 22, 31.
		

Crossrefs

Formula

Equals one more than the partial sums of A098701.

A098690 Number of solutions to rev(x^2)=rev(x)^2 below 10^n.

Original entry on oeis.org

3, 9, 24, 63, 153, 362, 819, 1810, 3872, 8160, 16681, 33756, 66864, 130937, 251982, 480793, 903981, 1685563, 3106008, 5677863, 10276935, 18464658, 32891187, 58169964, 102136772, 178096364, 308593319, 531191384, 909227946, 1546356485, 2617639292
Offset: 1

Views

Author

Martin Renner, Oct 27 2004

Keywords

Comments

Partial sums of A098701. - Michel Marcus, Apr 11 2014
Excludes multiples of 10. - David Radcliffe, Aug 28 2021
Also the number of skinny numbers (A061909) with n digits, excluding 0. - David Radcliffe, Aug 28 2021

Examples

			For n = 2 the a(2) = 9 solutions are 1, 2, 3, 11, 12, 13, 21, 22, 31. - _David Radcliffe_, Aug 28 2021
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=FromDigits[Reverse[IntegerDigits[n]]];Differences[Table[Length[Select[Range[10^n],f[#^2]==f[#]^2&]],{n,0,6}]] (* Geoffrey Critzer, Dec 18 2013 *)
  • Python
    def rev(n): return int(str(n)[::-1])
    def a(n): return sum(k % 10 and rev(k**2) == rev(k)**2 for k in range(10**n)) # David Radcliffe, Aug 28 2021

Extensions

a(7),a(8) from Geoffrey Critzer, Dec 18 2013
Extended using A098701 by Michel Marcus, Apr 11 2014

A340491 Number of n-digit numbers x such that rev(x^2) = rev(x)^2 and x does not contain any zero digits, where rev(x) is the digit reversal of x.

Original entry on oeis.org

3, 6, 9, 11, 10, 7, 7, 1, 1
Offset: 1

Views

Author

Sébastien Dumortier, Jan 10 2021

Keywords

Comments

The number of solutions of rev(x^2) = rev(x)^2 increases but the solutions with a 0 don't. Any number with more than 9 digits can't be a solution, due to the development of x^2.

Examples

			The 7 solutions with 7 digits are 1111111, 1111112, 1111121, 1111211, 1121111, 1211111, 2111111.
		

Crossrefs

Cf. A098701 (number of solutions) and A085305 (the solutions), where digit 0 is not forbidden.
Cf. A004086 (digit reversal), A052382 (zeroless numbers).

Programs

  • PARI
    isok(k) = my(d=digits(k)); vecmin(d) && (fromdigits(Vecrev(digits(k^2))) == fromdigits(Vecrev(d))^2);
    a(n) = sum(k=10^(n-1), 10^n-1, isok(k)); \\ Michel Marcus, Jan 16 2021
Showing 1-7 of 7 results.