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.

User: Barry Smyth

Barry Smyth's wiki page.

Barry Smyth has authored 3 sequences.

A350220 Composite numbers d such that the period k of the repetend of 1/d is > 1 and divides d-1, and d is the first such composite with a given period.

Original entry on oeis.org

33, 91, 148, 246, 451, 496, 505, 561, 657, 703, 1035, 1105, 1912, 2120, 2465, 2556, 2752, 2821, 4005, 4141, 5461, 6525, 6533, 6565, 6601, 6700, 7107, 8695, 8905, 8911, 10585, 11649, 12403, 12801, 13366, 13695, 13833, 14701, 15211, 15841, 17120, 18336, 19345, 19503, 19900
Offset: 1

Author

Barry Smyth, Mar 27 2022

Keywords

Comments

This is a subset of sequence A351396 with the extra condition that d is included if and only if it is the smallest value of d with a given period. Thus, 246 is included because its period is 5 (repetend is 04065) and it is the first valid of d with this period and, moreover, 5 divides evenly into 245. However, 55 (which is in A351396) is excluded because although its period (2 based on a repetend of 18 for 1/55) divides evenly into 54, there is a smaller value of d (33) with this property and a period of 2 (1/33 has a repetend of 03).

Examples

			33 is a term since 1/33 = 0.030303..., its repetend is 03, so its period is 2, 2 divides into 33-1 evenly, and there is no smaller value of d with this period.
91 is a term since 1/91 = 0.010989010989..., its repetend is 010989, so its period is 6, 6 divides into 91-1 evenly, and there is no smaller value of d with this period.
148 is a term since 1/148 = 0.00675675..., its repetend is 675, so its period is 3, 3 divides into 148-1 evenly, and there is no smaller value of d with this period.
Note that 370 is not in the sequence even though the repetend of 1/370 is 027 (period = 3) and 3 divides 370-1 because the period of 3 is accounted for by 148; note, 370 is in the related sequence A351396.
		

Crossrefs

Cf. A007732 (digits period), A000010 (totient), A351396.

Programs

  • Python
    from itertools import count, islice
    from sympy import n_order, multiplicity, isprime
    def A350220_gen(): # generator of terms
        pset = set()
        for d in count(1):
            if not (isprime(d) or (p := n_order(10, d//2**multiplicity(2, d)//5**multiplicity(5, d))) <= 1 or (d-1) % p or p in pset):
                yield d
                pset.add(p)
    A350220_list = list(islice(A350220_gen(),50)) # Chai Wah Wu, May 19 2022

A350598 Composite numbers d such that the period k of the repetend of 1/d is > 1 and divides d-1, and d is the first such composite with a given repetend.

Original entry on oeis.org

33, 55, 91, 99, 148, 165, 175, 246, 259, 275, 325, 370, 385, 451, 481, 495, 496, 505, 561, 592, 656, 657, 703, 715, 825, 909, 925, 1035, 1045, 1105, 1233, 1375, 1476, 1626, 1729, 1825, 1912, 2035, 2120, 2275, 2368, 2409, 2465, 2475, 2525, 2556, 2752, 2821, 2981, 3160
Offset: 1

Author

Barry Smyth, Mar 27 2022

Keywords

Comments

This is a subset of sequence A351396, and adds the extra condition that d is included only if it is the smallest value of d with a given repetend; thus duplicate repetends are not permitted. This eliminates some values of A351396 which are powers of 10 of d. For example, 1480 is excluded because although its period (k=3 based on a repetend of 675) divides evenly into 1479, this repetend already exists for a smaller value of d, namely 148, and 3 also divides evenly into 147. 1480 is the smallest such value of d from A351396 that will be excluded based on this modification. Other values of A351396 that are excluded include 3700, 5920, 9250, 14800, ...

Examples

			33 is a term since 1/33 = 0.030303..., its repetend is 03, so its period is 2, 2 divides 33-1 evenly, and there is no smaller value of d with this repetend.
148 is in the sequence because 1/148 has 675 as its repetend, so its period is 3 and 3 divides 148-1.
		

Crossrefs

Cf. A007732 (digits period), A000010 (totient), A351396.

Programs

  • Python
    from itertools import count, islice
    from sympy import n_order, multiplicity, isprime
    def A350598_gen(): # generator of terms
        pset = set()
        for d in count(1):
            if not isprime(d):
                m2, m5 = multiplicity(2,d), multiplicity(5,d)
                r = max(m2,m5)
                k, m = 10**r, 10**(t := n_order(10,d//2**m2//5**m5))-1
                c = k//d
                s = str(m*k//d-c*m).zfill(t)
                if not (t <= 1 or (d-1) % t or s in pset):
                    yield d
                    pset.add(s)
    A350598_list = list(islice(A350598_gen(),50)) # Chai Wah Wu, May 19 2022

A351396 Composite numbers d such that the period k of the decimal expansion of 1/d is > 1 and divides d-1.

Original entry on oeis.org

33, 55, 91, 99, 148, 165, 175, 246, 259, 275, 325, 370, 385, 451, 481, 495, 496, 505, 561, 592, 656, 657, 703, 715, 825, 909, 925, 1035, 1045, 1105, 1233, 1375, 1476, 1480, 1626, 1729, 1825, 1912, 2035, 2120, 2275, 2368, 2409, 2465, 2475, 2525, 2556, 2752, 2821
Offset: 1

Author

Barry Smyth, Mar 24 2022

Keywords

Comments

For primes p, the period k of the decimal expansion of 1/p divides p-1. This is usually not the case for reciprocals of composites d; instead, the period k always divides phi(d) where phi is Euler's totient function (A000010). This sequence lists the composites d for which k also divides d-1, which satisfies the condition of a pseudoprime, making such composites a sequence of pseudoprimes with respect to the divisibility of d-1 by k.

Examples

			33 is a term since 1/33 = 0.030303..., its repetend is 03 so its period is 2, and 2 divides 33-1.
91 is a term since 1/91 = 0.010989010989..., its repetend is 010898 so its period is 6, and 6 divides 91-1.
925000 is a term since 1/925000 = 0.00000108108... has a repetend of 108 and a period of 3, and 3 divides 925000-1.
		

Crossrefs

Cf. A007732 (digits period), A000010 (totient).

Programs

  • Python
    from itertools import count, islice
    from sympy import n_order, multiplicity, isprime
    def A351396_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda d: not (isprime(d) or (p := n_order(10, d//2**multiplicity(2, d)//5**multiplicity(5, d))) <= 1 or (d-1) % p), count(max(startvalue,1)))
    A351396_list = list(islice(A351396_gen(),50)) # Chai Wah Wu, May 19 2022