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.

A047726 Number of different numbers that are formed by permuting digits of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, 3, 6
Offset: 1

Views

Author

Keywords

Comments

The minimum value of a(A171102(n)) is 10*9!. - Altug Alkan, Jul 08 2016

Examples

			From 102 we get 102, 120, 210, 201, 12 and 21, so a(102)=6.
From 33950 with 5 digits, one '0', two '3', one '5' and one '9', we get 5! / (1! * 2! * 1! * 1!) = 60 different numbers and a(33950) = 60.  - _Bernard Schott_, Oct 20 2019
		

Crossrefs

Cf. A055098. Identical to A043537 and A043562 for n<100.
Cf. A179239. - Aaron Dunigan AtLee, Jul 14 2010

Programs

  • Haskell
    import Data.List (permutations, nub)
    a047726 n = length $ nub $ permutations $ show n
    -- Reinhard Zumkeller, Jul 26 2011
    
  • Maple
    f:= proc(n) local L;
      L:= convert(n,base,10);
      nops(L)!/mul(numboccur(i,L)!,i=0..9);
    end proc:
    map(f, [$1..1000]); # Robert Israel, Jul 08 2016
  • Mathematica
    pd[n_]:=Module[{p=Permutations[IntegerDigits[n]]},Length[Union [FromDigits/@p]]]; pd/@Range[120]  (* Harvey P. Dale, Mar 22 2011 *)
  • PARI
    a(n)=n=eval(Vec(Str(n)));(#n)!/prod(i=0,9,sum(j=1,#n,n[j]==i)!) \\ Charles R Greathouse IV, Sep 29 2011
    
  • PARI
    A047726(n)={local(c=Vec(0,10)); apply(d->c[d+1]++, digits(n)); logint(n*10,10)!/prod(i=1,10,c[i]!)} \\ M. F. Hasler, Oct 18 2019

Formula

a(n) << n / (log_10 n)^4.5 by Stirling's approximation. - Charles R Greathouse IV, Sep 29 2011
a(n) = A000142(A055642(n))/Product_{k=0..9} A000142(A100910(n,k)). - Robert Israel, Jul 08 2016

Extensions

Corrected by Henry Bottomley, Apr 19 2000

A046810 Number of anagrams of n that are primes.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

An anagram of a k-digit number is one of the k! permutations of the digits that does not begin with 0.

Examples

			107 has 2 prime anagrams: 107 and 701 (but not 017 or 071); so a(107) = 2.
		

Crossrefs

Programs

  • Haskell
    import Data.List (permutations, nub)
    a046810 n = length $ filter ((== 1) . a010051)
                       $ map read (nub $ filter ((> '0') . head)
                                                $ permutations $ show n)
    -- Reinhard Zumkeller, Aug 14 2011
    
  • Mathematica
    Table[Count[FromDigits/@Select[Permutations[IntegerDigits[n]], First[#] != 0&],?(PrimeQ[#]&)],{n,110}] (* _Harvey P. Dale, Aug 24 2011 *)
  • Python
    from sympy import isprime
    from itertools import permutations
    def a(n): return len(set(t for p in permutations(str(n)) if p[0]!="0" and isprime(t:=int("".join(p)))))
    print([a(n) for n in range(1, 106)]) # Michael S. Branicky, Feb 17 2024

A235993 Numbers having at least one anagram which is a square.

Original entry on oeis.org

1, 4, 9, 16, 18, 25, 36, 46, 49, 52, 61, 63, 64, 81, 94, 100, 112, 121, 136, 144, 148, 163, 169, 184, 196, 211, 225, 234, 243, 252, 256, 259, 265, 279, 289, 295, 297, 298, 316, 324, 342, 361, 400, 414, 418, 423, 432, 441, 448, 478, 481, 484, 487, 522, 526
Offset: 1

Views

Author

Colin Barker, Jan 19 2014

Keywords

Comments

An anagram of a k-digit number is one of the <= k! permutations of the digits that does not begin with 0.

Examples

			121 is in the sequence because 121 = 11^2.
619 is in the sequence because 169, 196 and 961 are squares.
		

Crossrefs

Cf. A000290, A007936 (leading zeros allowed), A046810, A055098, A235994.

A160851 Numbers which are a difference of two of their own anagrams.

Original entry on oeis.org

459, 495, 1089, 1269, 1467, 1476, 1503, 1530, 1692, 1746, 2385, 2439, 2493, 2502, 2520, 2538, 2691, 2853, 3285, 3501, 3510, 4095, 4392, 4590, 4599, 4671, 4698, 4797, 4896, 4932, 4950, 4959, 4968, 4977, 4986, 4995, 5238, 5382, 5409, 6147, 6174, 6921, 8019, 8091
Offset: 1

Views

Author

Claudio Meller, May 28 2009

Keywords

Comments

An anagram of a number k is a number formed by one of the k! permutations of its digits.
All terms are divisible by 9. - David A. Corneth, Jun 06 2025

Examples

			459 = 954 - 495;
495 = 954 - 459;
1089 = 9108 - 8019;
1269 = 2961 - 1692;
1467 = 7641 - 6174;
1476 = 6147 - 4671;
2538 = 5823 - 3285;
6174 = 7641 - 1467;
10989 = 91908 - 80919;
12969 = 29961 - 16992.
		

Crossrefs

Programs

  • PARI
    \\ See Corneth link
  • Python
    from itertools import permutations
    def ok(k):
        anagram = {int(''.join(p)) for p in permutations(str(k)) if p[0] != '0'}
        anagram.discard(k)
        return any(a != b and a - b == k for a in anagram for b in anagram)
    print([k for k in range(10, 10000) if ok(k)]), #Gonzalo Martínez, May 28 2025
    

Extensions

Definition edited by R. J. Mathar, May 30 2009
a(1), a(5)-a(15) inserted by Gonzalo Martínez May 28 2025

A384433 Integers k that are equal to the sum of at least two distinct of their anagrams, which must have the same number of digits as k.

Original entry on oeis.org

954, 2961, 4617, 4851, 4932, 5013, 5022, 5031, 5103, 5112, 5184, 5238, 5823, 5913, 6012, 6021, 6102, 6129, 6147, 6171, 6180, 6192, 6210, 6219, 6291, 6312, 6321, 6417, 6519, 6915, 6921, 7125, 7128, 7149, 7152, 7182, 7194, 7218, 7251, 7281, 7341, 7416, 7431
Offset: 1

Views

Author

Gonzalo Martínez, May 28 2025

Keywords

Comments

This sequence consists of integers k that are equal to the sum of at least two of their own digit permutations. All anagrams must have the same number of digits as k, so permutations with leading zeros are not allowed.
Unlike Osiris numbers (A319274), which are formed by summing permutations of digit subsamples, these numbers require the use of all digits in each term of the sum.
All terms are divisible by 3. Proof: if a term t is in the sequence then it is a sum of at least 2 anagrams and at most 9 anagrams. The remainder of any q anagrams of t is (q*t) mod 9 which is never equivalent t mod 9 since t mod 3 is nonzero. - David A. Corneth, Jun 05 2025

Examples

			4617 is in this list, since 4617 = 1467 + 1476 + 1674, where 1467, 1476 and 1674 are anagrams of 4617.
921 is not in the sequence even though 921 = 192 + 219 + 219 + 291. - _David A. Corneth_, Jun 05 2025
		

Crossrefs

Programs

  • Python
    from itertools import permutations
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def anagrams(k):
        s = str(k)
        return sorted({int(''.join(p)) for p in permutations(s) if p[0] != '0' and int(''.join(p)) != k})
    def ok(k):
        def back(i, acc):
            if acc == k: return True
            if acc > k or i == len(a): return False
            return back(i + 1, acc + a[i]) or back(i + 1, acc)
        a = anagrams(k)
        return back(0, 0)
    print([k for k in range(10, 10000) if ok(k)])

A235994 Numbers having at least one anagram which is a cube.

Original entry on oeis.org

1, 8, 27, 46, 64, 72, 125, 126, 152, 162, 215, 216, 251, 261, 279, 297, 334, 343, 433, 512, 521, 612, 621, 729, 792, 927, 972, 1000, 1133, 1269, 1278, 1279, 1287, 1296, 1297, 1313, 1331, 1349, 1394, 1439, 1493, 1629, 1692, 1728, 1729, 1782, 1792, 1827, 1872
Offset: 1

Views

Author

Colin Barker, Jan 19 2014

Keywords

Comments

An anagram of a k-digit number is one of the k! permutations of the digits that does not begin with 0.

Examples

			126 is in the sequence because 216 = 6^3.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[2000],AnyTrue[Surd[FromDigits/@Select[ Permutations[ IntegerDigits[#]],#[[1]]>0&],3],IntegerQ]&] (* The program uses the AnyTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jul 15 2016 *)
  • Python
    from itertools import count, takewhile
    def hash(n): return "".join(sorted(str(n)))
    def aupto_digits(d):
        cubes   = takewhile(lambda x:x<10**d, (i**3 for i in count(1)))
        C = set(map(hash, cubes))
        return [k for k in range(1, 10**d) if hash(k) in C]
    print(aupto_digits(4)) # Michael S. Branicky, Feb 18 2024

A384708 a(n) is the smallest integer k such that k is the sum of exactly n distinct permutations of k, all having the same number of digits as k.

Original entry on oeis.org

1, 954, 4617, 5112, 8136, 67104, 76011, 90216, 910107
Offset: 1

Views

Author

Gonzalo Martínez, Jun 07 2025

Keywords

Comments

There is no such k exists for n >= 10, since the sum of 10 or more distinct permutations of any integer k, with the same number of digits of k, will always be greater than k itself.

Examples

			a(1) = 1, since 1 = 1.
a(2) = 954, since 954 = 459 + 495.
a(3) = 4617, since 4617 = 1467 + 1476 + 1674.
a(4) = 5112, since 5112 = 1125 + 1215 + 1251 + 1521.
a(5) = 8136, since 8136 = 1368 + 1386 + 1683 + 1836 + 1863.
a(6) = 67104, since 67104 = 10467 + 10476 + 10647 + 10674 + 10764 + 14076.
a(7) = 76011, since 76011 = 10167 + 10176 + 10617 + 10671 + 11067 + 11607 + 11706.
a(8) = 90216, since 90216 = 10269 + 10296 + 10629 + 10692 + 10962 + 12069 + 12609 + 12690.
a(9) = 910107, since 910107 = 100179 + 100197 + 100917 + 100971 + 101079 + 101097 + 101790 + 101907 + 101970. - _David A. Corneth_, Jun 12 2025
		

Crossrefs

Subsequence of A384433.
Cf. A055098.

Extensions

a(9) from David A. Corneth, Jun 12 2025
Showing 1-7 of 7 results.