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

A114258 Numbers k such that k^2 contains exactly 2 copies of each digit of k.

Original entry on oeis.org

72576, 406512, 415278, 494462, 603297, 725760, 3279015, 4065120, 4152780, 4651328, 4915278, 4927203, 4944620, 4972826, 4974032, 4985523, 4989323, 5002245, 5016125, 6032970, 6214358, 6415002, 6524235, 7257600, 9883667
Offset: 1

Views

Author

Giovanni Resta, Nov 18 2005

Keywords

Comments

From Chai Wah Wu, Feb 27 2024: (Start)
If k is a term, then k == 0 (mod 9) or k == 2 (mod 9) (see A370676).
First decimal digit of each term is 3 or larger. (End)

Examples

			72576 is in the sequence since its square 5267275776 contains four 7's, two 2's, two 5's and two 6's.
		

Crossrefs

Programs

  • Python
    from math import isqrt
    from itertools import count, islice
    def A114258_gen(): # generator of terms
        for l in count(1):
            a = isqrt(10**((l<<1)-1))
            if (a9:=a%9):
                a -= a9
            for b in range(a,10**l,9):
                for c in (0,2):
                    k = b+c
                    if sorted(str(k)*2)==sorted(str(k**2)):
                        yield k
    A114258_list = list(islice(A114258_gen(),20)) # Chai Wah Wu, Feb 27 2024

A370675 Number of unordered pairs of n-digit numbers k1, k2 such that their product has the same multiset of digits as in both k1 and k2 together.

Original entry on oeis.org

0, 7, 156, 3399, 112025, 4505706, 213002162
Offset: 1

Views

Author

Danila Potapov, Feb 26 2024

Keywords

Comments

Since multiplication and multiset union are commutative operations, we count unordered pairs, i.e. we can assume that k1 <= k2.
The sequence is nondecreasing, since for any x,y,p such that x*y=p, x0*y0=p00.
The numbers up to n=7 were verified by at least two independent implementations.
The property of possible residues mod 3 and mod 9 for A370676 also holds for this sequence.

Examples

			For n=2 the a(2)=7 solutions are:
  15 * 93 = 1395
  21 * 60 = 1260
  21 * 87 = 1827
  27 * 81 = 2187
  30 * 51 = 1530
  35 * 41 = 1435
  80 * 86 = 6880
		

Crossrefs

Cf. A114258, A370676 (number of such pairs with possibly unequal number of digits).

Programs

  • PARI
    a370675(n) = {my (np=0, n1=10^(n-1), n2=10*n1-1); for (k1=n1, n2, my(s1=digits(k1)); for (k2=k1, n2, my (s2=digits(k2)); my(sp=digits(k1*k2)); if (#s1+#s2==#sp && vecsort(concat(s1,s2)) == vecsort(sp), np++))); np} \\ Hugo Pfoertner, Feb 26 2024

A370678 a(n) is the number of pairs x <= y of n-digit numbers such that the number of distinct digits in their product is less than in their concatenation.

Original entry on oeis.org

10, 1395, 147718, 15187437, 1530456465, 152653821364
Offset: 1

Views

Author

Hugo Pfoertner, Feb 26 2024

Keywords

Examples

			a(1) = 10: 8 products 1*2, ..., 1*9, 2*3, 2*4 with 1 digit in x*y and 2 digits in x|y.
		

Crossrefs

Programs

  • PARI
    \\ returns [number of products, [a(n), A370679(n), A370680(n)]]
     a370678_80(n) = {my (m=0, c=vector(3), n1=10^(n-1), n2=10*n1-1); for (k1=n1, n2, my (s1=digits(k1)); for (k2=k1, n2, my (s2=digits(k2), cs=#Set(digits(k1*k2)), d=cs-#Set(concat(s1,s2))); c[sign(d)+2]++; m++)); [m,c]}
    
  • Python
    def A370678(n):
        a = 10**(n-1)
        b, c = 10*a, 0
        for x in range(a,b):
            s = set(str(x))
            for y in range(x,b):
                if len(s|set(str(y))) > len(set(str(x*y))):
                    c += 1
        return c # Chai Wah Wu, Feb 28 2024

Formula

a(n) = 9 * 2^(n-3) * 5^(n-2) * (10 + 9*10^n) - A370679(n) - A370680(n).

Extensions

a(6) from Martin Ehrenstein, Feb 29 2024

A370679 a(n) is the number of pairs x <= y of n-digit numbers such that the number of distinct digits in their product is the same as in their concatenation.

Original entry on oeis.org

29, 1674, 136854, 12082393, 1136370471, 111392993465
Offset: 1

Views

Author

Hugo Pfoertner, Feb 26 2024

Keywords

Crossrefs

Programs

  • PARI
    See A370678.
    
  • Python
    def A370679(n):
        a = 10**(n-1)
        b, c = 10*a, 0
        for x in range(a,b):
            s = set(str(x))
            for y in range(x,b):
                if len(s|set(str(y))) == len(set(str(x*y))):
                    c += 1
        return c # Chai Wah Wu, Feb 28 2024

Extensions

a(6) from Martin Ehrenstein, Feb 29 2024

A370680 a(n) is the number of pairs x <= y of n-digit numbers such that the number of distinct digits in their product is greater than in their concatenation.

Original entry on oeis.org

6, 1026, 120878, 13234670, 1383218064, 140953635171
Offset: 1

Views

Author

Hugo Pfoertner, Feb 26 2024

Keywords

Examples

			a(1) = 6: 6 squares 4*4, ..., 9*9 with 2 distinct digits in x*y = 16, 25, ..., and 1 digit in their concatenation.
		

Crossrefs

Programs

  • PARI
    See A370678.
    
  • Python
    def A370680(n):
        a = 10**(n-1)
        b, c = 10*a, 0
        for x in range(a,b):
            s = set(str(x))
            for y in range(x,b):
                if len(s|set(str(y))) < len(set(str(x*y))):
                    c += 1
        return c # Chai Wah Wu, Feb 28 2024

Extensions

a(6) from Martin Ehrenstein, Feb 29 2024
Showing 1-5 of 5 results.