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: Gil Moses

Gil Moses's wiki page.

Gil Moses has authored 4 sequences.

A381977 Number of edge intersections in the divisibility circle graph of n (base 10).

Original entry on oeis.org

0, 0, 0, 0, 0, 3, 3, 5, 0, 0, 0, 12, 18, 19, 21, 27, 35, 36, 57, 20, 45, 25, 71, 75, 65, 88, 90, 110, 137, 81, 120, 135, 42, 162, 150, 180, 204, 215, 252, 165, 230, 252, 282, 208, 270, 315, 341, 357, 402, 290, 375, 400, 440, 441, 340, 481, 513, 530, 587, 456
Offset: 1

Author

Gil Moses, Mar 11 2025

Keywords

Comments

Definition:
For each integer n, construct a divisibility circle graph as follows:
- Place the numbers 0 to n-1 evenly around a circle.
- For each number k between 0 and n-1, draw a chord from k to 10k mod n.
- Count the intersections among all the chords.
Notes:
- Two edges (a,f(a)) and (b,f(b)) are considered to intersect if their segments are only partially contained within the other.
- Edges are undirected, and intersections are counted once (i.e., duplicates from symmetric pairs are removed).

Examples

			For n=7, the segments are 0->0, 1->3, 2->6, 3->2, 4->5, 5->1, 6->4.
When drawing these chords in a circle, 3 intersections occur: 1->3 and 2->6, 5->1 and 6->4, 2->6 and 5->1.
		

Programs

  • Python
    import sys
    base_multiplier = 10
    def list_intersections(n):
        """
        Computes the number of valid intersections based on range intersections.
        Before checking intersections, ensures that each range is stored in ascending order
        to avoid duplicate counting.
        """
        # Generate remainder pairs using the base multiplier
        table = [(i, (base_multiplier * i) % n) for i in range(n)]
        # Ensure each range is stored in ascending order and remove duplicates
        unique_ranges = set((min(num, rem), max(num, rem)) for num, rem in table)
        sorted_table = list(unique_ranges)  # Convert back to a list for processing
        intersections = []
        # Check for valid intersections
        for i in range(len(sorted_table)):
            num1, rem1 = sorted_table[i]
            for j in range(i):
                num2, rem2 = sorted_table[j]
                # Find intersection range
                intersection_start = max(num1, num2)
                intersection_end = min(rem1, rem2)
                intersection_length = max(0, intersection_end - intersection_start)
                # Compute the lengths of the two ranges
                range1_length = rem1 - num1
                range2_length = rem2 - num2
                # An intersection occurs if the intersection is smaller than the smallest range and > 0
                if 0 < intersection_length < min(range1_length, range2_length):
                    intersections.append(((num2, rem2), (num1, rem1)))
        return len(intersections)
    # Define range of n values
    n_values = list(range(1, 100))
    intersections_values = []  # Stores intersections count for each n
    for n in n_values:
        # Compute intersections using the deduplicated method
        intersections = list_intersections(n)
        intersections_values.append(intersections)
    # Output only intersection numbers for OEIS submission
    for value in intersections_values:
        print(value)

A362556 Number of distinct n-digit suffixes generated by iteratively multiplying an integer by 8, where the initial integer is 1.

Original entry on oeis.org

5, 21, 101, 502, 2502, 12502, 62503, 312503, 1562503, 7812504, 39062504, 195312504, 976562505, 4882812505, 24414062505, 122070312506, 610351562506, 3051757812506, 15258789062507, 76293945312507, 381469726562507
Offset: 1

Author

Gil Moses, Apr 24 2023

Keywords

Examples

			For n = 1, we begin with 1, iteratively multiply by 8 and count the number of terms before the last 1 digit begins to repeat. We obtain 1, 8, 64, 512, 4096, ... . The next term is 32768, which repeats the last 1 digit 8. Thus, the number of distinct terms is a(1) = 5.
		

Crossrefs

Cf. A362468 (with 4 as the multiplier).

Programs

  • Mathematica
    A362556[n_]:=5^(n-1)4+Ceiling[n/3];Array[A362556,30] (* after Charles R Greathouse IV *) (* or *) LinearRecurrence[{6,-5,1,-6,5},{5,21,101,502,2502},30] (* Paolo Xausa, Nov 18 2023 *)
  • PARI
    a(n)=4*5^(n-1)+ceil(n/3) \\ Charles R Greathouse IV, Apr 28 2023
  • Python
    def a(n):
         s, x, M = set(), 1, 10**n
         while x not in s: s.add(x); x = (x<<3)%M
         return len(s)
    

Extensions

a(13)-a(21) from Charles R Greathouse IV, Apr 28 2023

A362555 Number of distinct n-digit suffixes generated by iteratively multiplying an integer by 6, where the initial integer is 1.

Original entry on oeis.org

2, 7, 28, 129, 630, 3131, 15632, 78133, 390634, 1953135, 9765636, 48828137, 244140638, 1220703139, 6103515640, 30517578141, 152587890642, 762939453143, 3814697265644, 19073486328145, 95367431640646, 476837158203147, 2384185791015648, 11920928955078149, 59604644775390650
Offset: 1

Author

Gil Moses, Apr 24 2023

Keywords

Examples

			For n = 2, we begin with 1, iteratively multiply by 6 and count the terms before the last 2 digits begin to repeat. We obtain 1, 6, 36, 216, 1296, 7776, 46656, ... . The next term is 279936, which repeats the last 2 digits 36. Thus, the number of distinct terms is a(2) = 7.
		

Crossrefs

Cf. A362468 (with 4 as the multiplier).

Programs

Formula

a(n) = 5^(n-1) + n.
From Stefano Spezia, Apr 27 2023: (Start)
O.g.f.: (1 - 5*x + 4*x^2 - 4*x^3)/((1 - x)^2*(1 - 5*x)).
E.g.f.: (4 + exp(5*x) + 5*exp(x)*x)/4. (End)

A362468 Number of distinct n-digit suffixes generated by iteratively multiplying an integer by 4, where the initial integer is 1.

Original entry on oeis.org

3, 11, 52, 252, 1253, 6253, 31254, 156254, 781255, 3906255, 19531256, 97656256, 488281257, 2441406257, 12207031258, 61035156258, 305175781259, 1525878906259, 7629394531260, 38146972656260, 190734863281261, 953674316406261, 4768371582031262, 23841857910156262
Offset: 1

Author

Gil Moses, Apr 21 2023

Keywords

Comments

This process produces a family of similar sequences when using different constant multipliers. See crossrefs below.

Examples

			For n = 2, we begin with 1, iteratively multiply by 4 and count the number of terms before the last 2 digits begin to repeat. We obtain 1, 4, 16, 64, 256, 1024, 4096, 16384, 65536, 262144, 1048576, ... . The next term is 4194304, which repeats the last 2 digits 04. Thus, the number of distinct terms is a(2) = 11.
		

Crossrefs

Period of powers mod 10^n: A020699 (4), A216099 (3), A216164 (7), A216156 (11).

Programs

  • PARI
    a(n)=(n+1)\2*2*5^(n-1) \\ Charles R Greathouse IV, Apr 28 2023
  • Python
    def a(n):
        s, x, M = set(), 1, 10**n
        while x not in s: s.add(x); x = (x<<2)%M
        return len(s), x
    print([a(n) for n in range(1, 11)]) # Michael S. Branicky, Apr 22 2023
    
  • Python
    def A362468(n): return (n+1>>1)+(5**(n-1)<<1) # Chai Wah Wu, Apr 24 2023
    

Formula

a(n) = t + k, where t = A004526(n+1) and k = A020699(n), since 4^t == 4^(t+k) (mod 10^n). Here, t is the "transient" portion and k = ord_5^n(4), the multiplicative order of 4 modulo 5^n, is the period of the orbit. - Michael S. Branicky, Apr 22 2023

Extensions

a(13) and beyond from Michael S. Branicky, Apr 22 2023