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.

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

Original entry on oeis.org

0, 0, 5, 0, 79, 0, 650, 2716, 17846, 0, 277166, 1472993, 8233003, 0, 286485314, 1797613432, 11675780880, 0, 538954048563, 3821844010905, 27824692448867, 0, 1587841473665581, 12417635018180828, 99246128296767625, 0, 6742930364132819544, 57228575814672196977, 494789896551823383745, 0, 38997607084561562847324
Offset: 2

Views

Author

Chai Wah Wu, Mar 13 2025

Keywords

Comments

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 zeroless number k with every nonzero 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 zeroless number with every nonzero digit exactly once.

Examples

			a(9) = 2716. 2716*2717 = 7379372 which is 14786532 in base 9.
		

Crossrefs

Cf. A381266.

Programs

  • Python
    from itertools import count
    from math import isqrt
    from sympy.ntheory import digits
    def A382050(n):
        k, l, d = (n*(n-1)>>1)%(n-1), n**(n-1)-(n**(n-1)-1)//(n-1)**2, tuple(range(1,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**2 + n - 1)//((n - 1)**2)
        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).
Conjecture: a(n) > 0 if n > 5 and n <> 3 (mod 4).

A382054 a(n) = least positive integer m such that when m*(m+1) is written in base n, it does not contain the digit n-1 and contains every single digit from 0 to n-2 exactly once, or 0 if no such number exists.

Original entry on oeis.org

0, 0, 14, 54, 0, 616, 2251, 12069, 0, 251085, 1348305, 7619403, 0, 269717049, 1698727527, 11061795398, 0, 513383208454, 3648738866370, 26618719297968, 0, 1524495582671125, 11941193897016731, 95578593301936475, 0, 6510865478836888683, 55324396705324796861, 478855818873249715068, 0, 37817609915967014967822
Offset: 3

Views

Author

Chai Wah Wu, Mar 13 2025

Keywords

Comments

Theorem:
a(n) = 0 if n == 3 (mod 4).
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 from 0 to n-2 exactly once, k == (n-2)(n-1)/2 == 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 from 0 to n-2 exactly once and the proof is complete.
Conjecture: a(n) > 0 if n > 4 and n <> 3 (mod 4).

Examples

			a(9) = 2251 since 2251*2252 = 5069252 which is 10475632 in base 9.
		

Crossrefs

Programs

  • Python
    from itertools import count
    from math import isqrt
    from sympy.ntheory import digits
    def A382054(n):
        k, l, d= (n*(n-1)>>1)%(n-1), (n - n**n + (n - 1)**2*(n**n + n**(n - 1)*(1 - n)))//(n - 1)**2, tuple(range(n-1))
        clist = [i for i in range(n-1) if i*(i+1)%(n-1)==k]
        if len(clist) == 0:
            return 0
        s = (n**(n - 1) + (n - 1)**2*(n**(n - 3)*(n - 1) - 1) - 1)//(n - 1)**2
        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).

A382055 a(n) = least positive integer m such that when m*(m+1) is written in base n, it does not contain the digits 0 or n-1 and contains every single digit from 1 to n-2 exactly once, or 0 if no such number exists.

Original entry on oeis.org

0, 2, 6, 19, 0, 420, 924, 3672, 0, 78880, 431493, 2173950, 0, 71583429, 436726936, 2750336517, 0, 120521201887, 833996387274, 5932255141224, 0, 324116744376715, 2483526997445916, 19463766853506024, 0, 1274294107710603710, 10627079743009611713, 90335862784009245081, 0
Offset: 3

Views

Author

Chai Wah Wu, Mar 13 2025

Keywords

Examples

			a(9) = 924. 924*925 = 854700 which is 1542376 in base 9.
		

Crossrefs

Programs

  • Python
    from itertools import count
    from math import isqrt
    from sympy.ntheory import digits
    def A382055(n):
        k, l, d= (n*(n-1)>>1)%(n-1), (-n**(n - 1) + (n - 1)**2*(n**(n - 2)*(1 - n) + n**(n - 1)) + 1)//(n - 1)**2, tuple(range(1,n-1))
        clist = [i for i in range(n-1) if i*(i+1)%(n-1)==k]
        if len(clist) == 0:
            return 0
        s = (-n**2 + n + n**n - (n - 1)**3 - 1)//(n*(n - 1)**2)
        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). For a proof of this see A382054 for the proof of a similar result which also holds in this case.
Conjecture: a(n) = 0 if and only if n == 3 (mod 4).
Showing 1-3 of 3 results.