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

A046891 Values of n where number of permutations of digits a(n) that are prime increases.

Original entry on oeis.org

1, 2, 13, 103, 107, 1007, 1013, 1049, 1079, 1237, 10013, 10039, 10079, 10139, 10237, 10279, 10379, 13789, 100127, 100139, 100235, 100237, 100279, 101237, 101239, 102347, 102367, 102379, 103579, 103789, 1001234, 1001237, 1001239, 1002347, 1002359, 1002367, 1002379
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    ap[n_] := Count[FromDigits /@ Permutations[IntegerDigits[n]], ?PrimeQ]; t = {1}; x = 0; Do[If[ap[i] > x, AppendTo[t, i]; x = ap[i]], {i, 105000}]; t (* _Jayanta Basu, Jun 29 2013 *)
  • Python
    from sympy import prime
    from gmpy2 import is_prime
    from sympy.utilities.iterables import multiset_permutations as mp
    from itertools import count, islice, combinations_with_replacement as mc
    def f(n): return sum(1 for p in mp(str(n)) if is_prime(t:=int("".join(p))))
    def bgen(d):
        for f in "123456789":
            yield from map(int, (f+"".join(m) for m in mc("0123456789", d-1)))
    def agen():
        record = -1
        for d in count(1):
            for k in bgen(d):
                v = f(k)
                if v > record:
                    record = v
                    yield k
    print(list(islice(agen(), 30))) # Michael S. Branicky, Feb 17 2024

Extensions

a(35) and beyond from Michael S. Branicky, Feb 17 2024

A068805 Suppose the integer m has k decimal digits; make a list of the k! strings obtained by permuting the digits in all possible ways; discard any leading zeros; count distinct squares in the list (A062892); a(n) = smallest m that yields n squares.

Original entry on oeis.org

1, 100, 169, 10269, 13468, 10044, 100269, 1000269, 10069, 100069, 1001466, 1000044, 10012689, 10045669, 10001466, 1003468, 10023469, 1000069, 10000069, 10002456, 10003468, 100045669, 100023469, 100001466, 100124469, 100045678, 100345689, 100023489, 100000069, 100002456
Offset: 1

Views

Author

Amarnath Murthy, Mar 06 2002

Keywords

Examples

			a(3) = 169 whose 3 permutations 169, 196 and 961 yield three different squares.
		

Crossrefs

Programs

  • Mathematica
    a=Table[0, {15}]; Do[b=Count[ IntegerQ /@ Sqrt[ FromDigits /@ Permutations[ IntegerDigits[n]]], True]; If[b<15&&a[[b]]==0, a[[b]]=n], {n, 1, 287618} ] (* Robert G. Wilson v, May 22 2003 *)

Extensions

More terms from Robert G. Wilson v, May 22 2003
a(13)-a(20) from John W. Layman, Sep 27 2004
More terms from David A. Corneth, Oct 18 2021
Showing 1-2 of 2 results.