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.

A381266 a(n) = least positive integer m such that when m*(m+1) is written in base n, it contains every single digit exactly once, or 0 if no such number exists.

Original entry on oeis.org

1, 0, 12, 34, 134, 0, 1477, 6891, 38627, 0, 891230, 4874690, 28507439, 0, 1078575795, 7002987575, 46916000817, 0, 2295911609450, 16720559375850, 124852897365573, 0, 7468470450367652, 59705969514613035, 487357094495846175, 0, 34452261762372201726, 297930994005481958694
Offset: 2

Views

Author

Daniel Mondot and Ali Sada, Feb 18 2025

Keywords

Comments

It appears that for each base of the form 4k+3, no number can be found that satisfies the requirement.
From Chai Wah Wu, Mar 13 2025: (Start)
The above observation is true.
Theorem: if n==3 (mod 4), then a(n) = 0.
Proof: Since n^a == 1 (mod n-1), k == the digit sum of k in base n (mod n-1). Thus for a number k with every digit exactly once, k == n(n-1)/2 (mod n-1).
Suppose n==3 (mod 4), i.e. n=2q+1 for some odd q. Then n(n-1)/2 = 2q^2+q. Since n-1 = 2q, this means that n(n-1)/2 == q (mod n-1). As q is odd, m(m+1) is even and n-1 is even, this implies that m(m+1) <> q (mod n-1) and thus m(m+1) is not a number with every digit exactly once and the proof is complete.
Conjecture: a(n) = 0 if and only if n==3 (mod 4).
(End)

Examples

			1477 is 2705 in octal. 2705 * 2706 = 10247536 (base 8)
38627 * 38628 = 1492083756 (base 10)
see a381266.txt for more
		

Crossrefs

Cf. A381248.

Programs

  • Python
    from itertools import count
    from math import isqrt
    from sympy.ntheory import digits
    def A381266(n):
        k, l, d = (n*(n-1)>>1)%(n-1), n**n-(n**n-n)//(n-1)**2, tuple(range(n))
        clist = [i for i in range(n-1) if i*(i+1)%(n-1)==k]
        if len(clist) == 0:
            return 0
        s = (n**n-n)//(n-1)**2+n**(n-2)*(n-1)-1
        s = isqrt((s<<2)+1)-1>>1
        s += n-1-s%(n-1)
        if s%(n-1) <= max(clist):
            s -= n-1
        for a in count(s,n-1):
            if a*(a+1)>l:
                break
            for c in clist:
                m = a+c
                if m*(m+1)>l:
                    break
                if tuple(sorted(digits(m*(m+1),n)[1:]))==d:
                    return m
        return 0 # Chai Wah Wu, Mar 17 2025

Formula

a(n) = 0 if n == 3 (mod 4). - Chai Wah Wu, Mar 13 2025

Extensions

a(19)-a(29) from Chai Wah Wu, Mar 12 2025

A381247 Positive integers m such that m * (m+1) contains at least 8 decimal digits that are in neither m nor m+1.

Original entry on oeis.org

77776, 88888, 444554, 554544, 655555, 656565, 656665, 888787, 888888, 1111121, 1212121, 1222121, 2212121, 2222232, 2222332, 2223222, 2232222, 2322322, 2332222, 3223232, 3223332, 3232222, 3233322, 3322332, 3323232, 3443443, 4334443, 4343443, 4444443, 4544444, 5444444, 5445554, 5455454
Offset: 1

Views

Author

Ali Sada and M. F. Hasler, Feb 17 2025

Keywords

Comments

Theorem: The sequence contains all m(n) = A002282(2n+1) = 8*R(2n+1) with n >= 2, where R(n) = (10^n-1)/9 = A002275(n) is the n-th repunit. - Proof: for these m, whe have m*(m+1) == 65432 (mod 10^5) and floor(m*(m+1)/10^(4n-2)) = 7091, as one can check by direct calculation. Therefore all the digits 0 through 7 are present in these numbers. - Actually, as n grows, the string of initial digits consists of increasingly more copies of "790123456", and the final digits are increasingly many copies of "098765432". - M. F. Hasler, Feb 18 2025

Examples

			77776*77777 = 6049183952 which has 8 new digits.
88888*88889 = 79011'65432, (with ' inserted to separate 1st and 2nd half of digits)
888888*888889 = 7901233'8765432,
8888888*8888889 = 790123456'098765432,
88888888*88888889 = 79012345678'32098765432,
888888888*888888889 = 7901234567900'5432098765432, etc.
It appears that only the last digit of the first part may be off by +-1 from the digit that would follow according to the periodic pattern. - _M. F. Hasler_, Feb 18 2025
		

Crossrefs

Cf. A381248.

Programs

  • Maple
    filter:= proc(t) nops(convert(convert(t*(t+1),base,10),set) minus
    (convert(convert(t,base,10),set) union convert(convert(t+1,base,10),set))) = 8 end proc [Maple code is missing some punctuation! - N. J. A. Sloane, Feb 19 2025]
    f:= proc(d) local Cands,i,s,S;
      Cands:= {seq(i*(10^d-1)/9, i=1..9), seq(seq(i*(10^d-1)/9 + add(10^s,s=S),i=1..8),S=combinat:-powerset({$1..d-1}))};
      sort(convert(select(filter,Cands),list))
    end proc:
    seq(op(f(d)),d=1..7); # Robert Israel, Feb 18 2025
  • PARI
    select( {is_A381247(n)=#setminus(Set(digits(n*(n+1))), Set(concat(digits(n), digits(n+1))))>7}, [10^4..10^5])
    for(n=1,1e7, is_A381247(n)&& print1(n", "))

Extensions

More terms from Michel Marcus, Feb 18 2025
Showing 1-2 of 2 results.