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: ,x

,x's wiki page.

,x has authored 7 sequences.

A364237 a(n) is the number of non-equivalent permutations of {1,2,...,2n-1} such that no subset of consecutive terms from the permutation sums to 0 modulo 2n, where two permutations are equivalent if one can be obtained from the other by multiplying every entry with an integer relatively prime to 2n and/or reversing the permutation.

Original entry on oeis.org

1, 1, 2, 4, 42, 504, 7492, 172480, 8639632
Offset: 1

Keywords

Comments

If we consider all permutations of {1,2,...,2n-1} such that no subset of consecutive terms from the permutation sums to 0 modulo 2n, then the number of such permutations is given by the number of constructive orderings mentioned in A141599. For example, given the permutation 14325 that satisfies the given conditions, observe that the partial sums modulo 6, namely 1=1, 1+4=5, 1+4+3=2, 1+4+3+2=4, and 1+4+3+2+5=3, are distinct.

Examples

			When n=3, there are four permutations of {1,2,3,4,5} such that no subset of consecutive terms from the permutation sums to 0 modulo 6, namely 14325, 25314, 41352, and 52341. Note that 14325 and 52341 are equivalent by reversing the permutations. Furthermore multiplication by 5 on every entry also yields the same equivalence. Additionally, 25314 and 41352 are analogously equivalent. Hence a(3)=2.
When n=4, 6142573 and 3752416 are equivalent by reversing the permutations but not by multiplying any integer relatively prime to 8, whereas 6142573 and 2346751 are equivalent by multiplication of 3 on every entry.
		

Crossrefs

Cf. A141599.

Programs

  • SageMath
    n = 3 #the index for the sequence a(n)
    orbits = {} #dictionary of permutations that are consecutive zero-sum-free
    seen = [] #list of seen permutations that are consecutive zero-sum-free
    a = 0 #the value of a(n)
    for labeling in Permutations(range(1,2*n)):
        if labeling not in seen:
            sums = [labeling[0]]
            for i in range(1,2*n-1):
                nextsum = (labeling[i] + sums[i-1]) % (2*n)
                if any([nextsum == 0, nextsum in sums]):
                    break
                sums.append(nextsum)
            if len(sums) == (2*n)-1:
                a += 1
                orbits[a] = []
                for m in [x for x in range(1,2*n) if gcd(x,2*n) == 1]:
                    equiv = [(m*labeling[i]) % (2*n) for i in range(2*n-1)]
                    if equiv not in orbits[a]:
                        orbits[a].append(equiv)
                    seen.append(equiv)
                    equiv = [equiv[2*n-2-i] for i in range(2*n-1)]
                    if equiv not in orbits[a]:
                        orbits[a].append(equiv)
                    seen.append(equiv)
    print(f"a({n}) = {a}\n")
    print("Equivalencies:")
    for i in range(1,a+1):
        print(f"{i}.")
        for x in orbits[i]:
            print(x)
        print('\n')

Extensions

a(8)-a(9) from Sean A. Irvine, Aug 15 2023

A364451 a(n) is the number of trees of diameter 4 with n vertices that are N-games in peg duotaire.

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 5, 7, 10, 13, 18, 22, 29, 34, 42, 49, 60, 69, 86, 100, 121, 139, 164, 187, 219, 252, 296, 343, 400, 458, 532, 605, 696, 794, 917, 1050, 1214, 1389, 1599, 1823, 2087, 2371, 2710, 3080, 3521
Offset: 1

Keywords

Comments

Peg duotaire is an impartial normal-play two-player game played on a simple graph, in which each vertex starts with a peg in it. If all vertices have a peg (i.e. the first turn), a move consists of removing some peg from a vertex.
If some vertex does not have a peg, then a move hops one peg over another, landing in an adjacent hole and removing the jumped peg. Formally, it is three vertices x, y, z where x, y are adjacent and y, z are adjacent, and x, y have pegs and z does not. After the move, x, y do not have pegs and z does.
Note than this sequence is always less than or equal to the number of trees of diameter 4 with n vertices, see A000094.

Examples

			There is only one tree of diameter 4 with 5 vertices. It is an N-game, as evidenced by the below winning strategy for the first player. We use 1 to represent a vertex with a peg and 0 otherwise.
   1-1-1-1-1
       |
   1-0-1-1-1
       |     (move is forced)
   1-1-0-0-1
       |
   0-0-1-0-1 (no moves remain)
		

References

  • E. R. Berlekamp, J. H. Conway, and R. K. Guy, Winning Ways for Your Mathematical Plays. Vol. 1, CRC Press, 2001.

Crossrefs

Cf. A000094.

Formula

a(n) <= A000094(n).

A307467 The number of points, corresponding to the first n primes, and placed on the unit circle according to an algorithm using the data from A077218 (in the spirit of Ulam's spiral, and described in the COMMENTS section below), which lie on the closed arc of the unit circle from 0 to 45 degrees.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 4, 4, 5, 5, 6, 7
Offset: 1

Author

Bernard X. Russo, Apr 09 2019

Keywords

Comments

Algorithm:
1. Place a dot, representing p_1, on the unit circle at (1,0), or equivalently, at angle 0 degrees, and label this point as the complex number lambda_1 = 1 = e^(i*0).
2. Place a dot, representing p_2, on the unit circle at (-1,0), or equivalently, at angle 180 degrees, and label this point as the complex number lambda_2 = -1 = e^(i*Pi).
3. For n > 2, supposing that dots representing p_1, ..., p_n have already been placed on the unit circle, place a dot, representing p_{n+1}, on the unit circle as follows: Starting at the dot representing p_n, proceed counterclockwise around the circle until you reach a dot representing one of p_1, p_2, ..., p_{n-1}.
4. Starting at this latter dot, proceed counterclockwise until you reach another dot representing one of p_1, p_2, ..., p_n.
5. Continue this process until you have traversed a(n) (of A077218) successive arcs connecting dots.
6. Proceed in a counterclockwise direction one more time to the next dot and place the dot which will represent p_{n+1} at the midpoint of the arc just traversed. Label this point as the complex number lambda_{n+1} = e^(i*theta_{n+1}).
The sequence is of interest since the points seem to cluster in the mentioned arc as well as in the closed arc from 180 degrees to 225 degrees. The sequences have been constructed by James Farrington up to n=256, which suggests the clustering. The precise clustering properties are formulated as questions in a file which is referenced below under LINKS.

Examples

			Following this procedure, we would place a dot representing p_3 on the unit circle at (0,-1), or equivalently, at angle 270 degrees, and we would place a dot representing p_4 on the unit circle at the midpoint of the arc connecting the point (-1,0) to the point (0,-1), that is, at (-1/root2,-1/root2), or equivalently, at angle 225 degrees.
Thus lambda_3 = -i = e^(3*Pi/2) and lambda_4 = e^(5*Pi/4).
		

Crossrefs

Uses A077218 in algorithm.

A128858 Number of digits in A128857(n).

Original entry on oeis.org

1, 18, 28, 6, 42, 58, 22, 13, 44, 2, 108, 48, 21, 46, 148, 13, 78, 178, 6, 99, 18, 8, 228, 7, 41, 6, 268, 15, 272, 66, 34, 28, 138, 112, 116, 179, 5, 378, 388, 18, 204, 418, 6, 219, 32, 48, 66, 239, 81, 498, 508, 43, 506, 42, 60, 42, 284, 192, 90, 299, 84, 618, 48, 35
Offset: 1

Author

Anton V. Chupin (chupin(X)icmm.ru), Apr 12 2007

Keywords

Crossrefs

Cf. A128857.

Programs

  • Mathematica
    Give[a_,n_]:=Block[{d=Floor[Log[10,n]]+1,m=(10n-1)/GCD[10n-1,a]}, If[m?1,While[PowerMod[10,d,m]!=N,d++ ],d=1]; ((10^(d+1)-1) a n)/(10n-1)]; Length[IntegerDigits[Give[1,n]]]
  • Python
    from sympy import n_order
    def A128858(n): return n_order(10,10*n-1) # Chai Wah Wu, Apr 09 2024

Formula

a(n) = order of 10 (mod 10*n - 1). - Arkadiusz Wesolowski, Nov 17 2012

Extensions

a(10) = 2 corrected by Gerard P. Michon, Oct 31 2012

A128857 a(n) = least number m beginning with 1 such that the quotient m/n is obtained merely by shifting the leftmost digit 1 of m to the right end.

Original entry on oeis.org

1, 105263157894736842, 1034482758620689655172413793, 102564, 102040816326530612244897959183673469387755, 1016949152542372881355932203389830508474576271186440677966
Offset: 1

Author

Anton V. Chupin (chupin(X)icmm.ru), Apr 12 2007

Keywords

Comments

a(n) is simply the decimal period of the fraction n/(10n-1). Thus, we have: n/(10n-1) = a(n)/(10^A128858(n)-1). With the usual convention that the decimal period of 0 is zero, that definition would allow the extension a(0)=0. a(n) is also the period of the decadic integer -n/(10n-1). - Gerard P. Michon, Oct 31 2012

Examples

			a(4) = 102564 since this is the smallest number that begins with 1 and which is divided by 4 when the first digit 1 is made the last digit (102564/4 = 25641).
		

Crossrefs

Minimal numbers for shifting any digit from the left to the right (not only 1) are in A097717.
By accident, the nine terms of A092697 coincide with the first nine terms of the present sequence. - N. J. A. Sloane, Apr 13 2009

Programs

  • Mathematica
    (*Moving digits a:*) Give[a_,n_]:=Block[{d=Ceiling[Log[10,n]],m=(10n-1)/GCD[10n-1, a]}, If[m!=1,While[PowerMod[10,d,m]!=n,d++ ],d=1]; ((10^(d+1)-1) a n)/(10n-1)]; Table[Give[1,n],{n,101}]
  • Python
    from sympy import n_order
    def A128857(n): return n*(10**n_order(10,(m:=10*n-1))-1)//m # Chai Wah Wu, Apr 09 2024

Extensions

Edited by N. J. A. Sloane, Apr 13 2009
Code and b-file corrected by Ray Chandler, Apr 29 2009

A112087 a(n) = 4*(n^2 - n + 1).

Original entry on oeis.org

4, 12, 28, 52, 84, 124, 172, 228, 292, 364, 444, 532, 628, 732, 844, 964, 1092, 1228, 1372, 1524, 1684, 1852, 2028, 2212, 2404, 2604, 2812, 3028, 3252, 3484, 3724, 3972, 4228, 4492, 4764, 5044, 5332, 5628, 5932, 6244, 6564, 6892, 7228, 7572, 7924, 8284
Offset: 1

Author

Jenny X. Chen (pookahead(AT)gmail.com), Nov 28 2005

Keywords

Comments

Diagonal of a number spiral.

Examples

			..43.44.45.46.47.48.49.50...
..42.21.22.23.24.25.26.51...
..40.19..7..8..9.10.27.52...
..40.19..6..1..2.11.28....
..39.18..5..4..3.12.29
..38.17.16.15.14.13.30
..37.36.35.34.33.32.31
		

Crossrefs

Cf. A002061.

Programs

Formula

a(n) = 4*A002061(n). - Robert G. Wilson v, Nov 29 2005
a(n) = 8*n + a(n-1) - 8 (with a(1)=4). - Vincenzo Librandi, Nov 13 2010
Sum_{n>=1} 1/a(n) = tanh(Pi*sqrt(3)/2)*Pi/(4*sqrt(3)). - Amiram Eldar, Aug 25 2022
From Elmo R. Oliveira, Feb 08 2025: (Start)
G.f.: 4*x*(1 + x^2)/(1 - x)^3.
E.g.f.: -4 + 4*exp(x)*(1 + x^2).
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) for n >= 4. (End)

Extensions

Edited and extended by Robert G. Wilson v, Nov 29 2005

A095680 13, together with primes of the form 10^k + 13 for some k >= 0.

Original entry on oeis.org

13, 113, 1013, 100000000000000013, 10000000000000000000000013, 1000000000000000000000000000000000000000000000000000000000000000000000000000000013
Offset: 1

Author

Xavier Bury (x(AT)monsieurx.com), Jul 04 2004

Keywords

Comments

The next term has 141 digits. - Harvey P. Dale, May 26 2024

Crossrefs

See A095688 for the values of k.
Cf. A093011.

Programs

  • Mathematica
    Join[{13},Select[Table[FromDigits[PadRight[{1},n,0]]+13,{n,100}],PrimeQ]] (* Harvey P. Dale, May 26 2024 *)

Extensions

Corrected by N. J. A. Sloane, Dec 31 2016 at the suggestion of Harvey P. Dale.
Corrected by Harvey P. Dale, May 26 2024