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-3 of 3 results.

A062892 Number of squares that can be obtained by permuting the digits of n.

Original entry on oeis.org

1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0
Offset: 0

Views

Author

Amarnath Murthy, Jun 29 2001

Keywords

Comments

The original definition was ambiguous (it did not specify how repeated digits or leading zeros are to be handled). Here is a precise version (based on the Mathematica code):
Suppose the decimal expansion of n has d digits. Apply all d! permutations, discard duplicates, but keep any with leading zeros; now ignore leading zeros; a(n) is the number of squares on the resulting list. For example, if n = 100 we end up with 100, 010, 001, and both 100 and 1 are squares, so a(100)=2. If n=108 we get 6 numbers but only (0)81 is a square, so a(108)=1. - N. J. A. Sloane, Jan 16 2014

Examples

			a(169) = 3; the squares obtained by permuting the digits are 169, 196, 961.
		

Crossrefs

A096599 gives the squares k^2 such that a(k^2) = 1.

Programs

  • Mathematica
    Table[t1=Table[FromDigits[k],{k,Permutations[IntegerDigits[n]]}]; p=Length[Select[t1,IntegerQ[Sqrt[#]]&]], {n,0,104}] (* Jayanta Basu, May 17 2013 *)
  • PARI
    a(n) = {my(d = vecsort(digits(n)), res = 0); forperm(d, p, res += issquare(fromdigits(Vec(p)))); res } \\ David A. Corneth, Oct 18 2021
    
  • Python
    from math import isqrt
    from sympy.utilities.iterables import multiset_permutations as mp
    def sqr(n): return isqrt(n)**2 == n
    def a(n):
        s = str(n)
        perms = (int("".join(p)) for p in mp(s, len(s)))
        return len(set(p for p in perms if sqr(p)))
    print([a(n) for n in range(105)] ) # Michael S. Branicky, Oct 18 2021

Formula

a(A096600(n))=0; a(A007937(n))>0; a(A096599(n))=1; a(A096598(n))>1. - Reinhard Zumkeller, Jun 29 2004

Extensions

Corrected and extended by Larry Reeves (larryr(AT)acm.org), Jul 02 2001

A096600 Numbers such that in decimal representation all permutations of digits are nonsquares.

Original entry on oeis.org

2, 3, 5, 6, 7, 8, 11, 12, 13, 14, 15, 17, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 37, 38, 39, 41, 42, 43, 44, 45, 47, 48, 50, 51, 53, 54, 55, 56, 57, 58, 59, 60, 62, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 82, 83, 84, 85, 86, 87
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 29 2004

Keywords

Comments

A062892(a(n)) = 0.

Examples

			134=2*67, 143=11*13, 314=2*157, 341=11*31, 413=7*59 and 431=A000040(83), therefore 134, 143, 314, 341, 413 and 431 are terms.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[100],NoneTrue[Sqrt[#]&/@(FromDigits/@Permutations[IntegerDigits[ #]]),IntegerQ]&] (* Harvey P. Dale, Dec 04 2022 *)

A096598 Squares such that some permutation of digits is also a square (in decimal representation).

Original entry on oeis.org

100, 144, 169, 196, 256, 400, 441, 625, 900, 961, 1024, 1089, 1296, 1369, 1600, 1764, 1936, 2025, 2304, 2401, 2500, 2809, 2916, 3600, 4096, 4761, 4900, 6400, 7056, 8100, 9025, 9216, 9604, 9801, 10000, 10201, 10404, 10609, 10816, 11025
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 29 2004

Keywords

Comments

A062892(a(n)) > 1.

Examples

			1024 = 32^2 and also 2401=49^2, therefore 1024 (and 2401) is a term.
		

Crossrefs

Showing 1-3 of 3 results.