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: Gary Yane

Gary Yane's wiki page.

Gary Yane has authored 5 sequences.

A358787 a(1)=1; let x=gcd(a(n-1),n); for n > 1, a(n) = a(n-1) + n if x=1 or a(n-1)/x=1, otherwise a(n) = a(n-1)/x.

Original entry on oeis.org

1, 3, 6, 3, 8, 4, 11, 19, 28, 14, 25, 37, 50, 25, 5, 21, 38, 19, 38, 19, 40, 20, 43, 67, 92, 46, 73, 101, 130, 13, 44, 11, 44, 22, 57, 19, 56, 28, 67, 107, 148, 74, 117, 161, 206, 103, 150, 25, 74, 37, 88, 22, 75, 25, 5, 61, 118, 59, 118, 59, 120, 60, 20, 5, 70, 35, 102, 3, 72, 36
Offset: 1

Author

Gary Yane, Nov 30 2022

Keywords

Examples

			For n=2, gcd(2,1)=1 so a(2) = 2+1 = 3.
For n=3, gcd(3,3)=3=a(2) so a(3) = 3+3 = 6.
For n=4, gcd(4,6)=2 so a(4) = 6/2 = 3.
		

Programs

  • Mathematica
    nn = 2^16; a[1] = 1; Do[g = GCD[a[n - 1], n]; If[Or[g == 1, Set[k, a[n - 1]/g] == 1], a[n] = a[n - 1] + n, a[n] = k], {n, 2, nn}]; Array[a, nn] (* Michael De Vlieger, Dec 13 2022 *)
  • Python
    from math import gcd
    from itertools import count, islice
    def agen(): # generator of terms
        an = 1
        for n in count(2):
            yield an
            x = gcd(an, n)
            an = an + n if x == 1 or x == an else an//x
    print(list(islice(agen(), 70))) # Michael S. Branicky, Dec 15 2022

A342831 a(n) is the smallest positive integer k such that the n-dimensional cube [0,k]^n contains at least as many internal lattice points as external lattice points.

Original entry on oeis.org

3, 6, 9, 12, 15, 18, 21, 24, 26, 29, 32, 35, 38, 41, 44, 47, 50, 52, 55, 58, 61, 64, 67, 70, 73, 76, 78, 81, 84, 87, 90, 93, 96, 99, 101, 104, 107, 110, 113, 116, 119, 122, 125, 127, 130, 133, 136, 139, 142, 145, 148, 151, 153, 156, 159, 162, 165, 168, 171, 174, 177, 179, 182
Offset: 1

Author

Gary Yane, Mar 23 2021

Keywords

Examples

			a(2) > 5 because the number of internal lattice points = 4^2 = 16 < 20 = 6^2 - 16 = the number of external lattice points, therefore a(2)=6 because the number of internal lattice points = 5^2 = 25 > 24 = 7^2 - 25 = number of external lattice points.
		

Crossrefs

Cf. A078608.

Programs

  • Maple
    a:= n-> ceil(1+2/(2^(1/n)-1)):
    seq(a(n), n=1..65);  # Alois P. Heinz, Apr 20 2021
  • Mathematica
    a[1] = 3; a[n_] := Floor[2^(1/n + 1)/(2^(1/n) - 1)]; Array[a, 100] (* Amiram Eldar, Mar 31 2021 *)

Formula

a(1) = 3 and a(n) = floor(2^(1/n+1)/(2^(1/n)-1)) for n > 1.
a(n) = A078608(n) + 1.

A343576 Number of permutations of [n] without fixed points and all cycles equal length.

Original entry on oeis.org

1, 0, 1, 2, 9, 24, 175, 720, 6405, 42560, 436401, 3628800, 48073795, 479001600, 7116730335, 88966701824, 1474541093025, 20922789888000, 400160588853025, 6402373705728000, 133991603578884051, 2457732174030848000, 55735573291977790575, 1124000727777607680000
Offset: 0

Author

Gary Yane, Apr 20 2021

Keywords

Examples

			a(4) = 9: (1,2)(3,4), (1,3)(2,4), (1,4)(2,3), (2,3,4,1), (2,4,1,3), (3,1,4,2), (3,4,2,1), (4,1,2,3), (4,3,1,2).
		

Crossrefs

Programs

  • Maple
    a:= n-> `if`(n=0, 1, add(n!/d!*(d/n)^d, d=numtheory[divisors](n) minus {n})):
    seq(a(n), n=0..23);  # Alois P. Heinz, Apr 20 2021
  • PARI
    a(n) = if (n, sumdiv(n, d, if (dMichel Marcus, Apr 21 2021

Formula

a(n) = Sum_{d|n, d0, a(0) = 1.
a(n) = A261431(n) for n in { A000040, A001358 }.

A341216 Triangle read by columns T(n,k) k > n >= 1: Last survivor positions in a modified Josephus problem for n numbers, where after each deletion the counting starts over at the lowest existing number n, rather than continuing from the current position.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 1, 2, 3, 4, 1, 1, 1, 1, 2, 1, 2, 3, 4, 5, 6, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 3, 3, 4, 5, 6, 1, 1, 2, 3, 3, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2
Offset: 1

Author

Gary Yane, Feb 06 2021

Keywords

Comments

Arrange 1,2,3,...,n clockwise in a circle. Start the count at the lowest surviving value and delete the k-th value counting clockwise around the circle. Repeat this procedure until one number remains, which is T(n,k).
Note: In the complete n X k array with n >= 1 and k >= 1, T(n,k) = T(k-1,k) for all n >= k > 1 and T(n,1)=n.
That makes the bottom triangle of the array unchanging, so it is omitted.

Examples

			n\k    2    3    4    5    6    7    8    9   10   11   12   13
_______________________________________________________________
1      1    1    1    1    1    1    1    1    1    1    1    1
2           2    1    2    1    2    1    2    1    2    1    2
3                2    3    1    3    1    2    2    3    1    3
5                     4    1    4    1    3    3    4    1    4
6                          2    5    1    3    3    5    1    5
7                               6    1    4    3    6    1    6
8                                    2    5    4    7    1    7
9                                         6    5    8    1    8
10                                             6    9    1    9
11                                                 10    1   10
12                                                       2   11
13                                                           12
		

Crossrefs

The last entry in each column is A128982.

Formula

T(1,k) = 1, for k > 1;
T(n,k) = T(n-1,k) if k mod n > T(n-1,k) or k mod n = 0;
T(n,k) = T(n-1,k) + 1 otherwise.

A178776 a(n) is the largest number that appears twice in an n x n multiplication table of positive integers, disregarding the pairs that are obviously produced by the commutative property.

Original entry on oeis.org

4, 4, 12, 12, 24, 36, 40, 40, 72, 72, 84, 120, 144, 144, 180, 180, 240, 252, 252, 252, 360, 400, 400, 432, 504, 504, 600, 600, 672, 672, 672, 840, 900, 900, 900, 936, 1120, 1120, 1260, 1260, 1320, 1440, 1440, 1440, 1680, 1764, 1800, 1800, 1872, 1872
Offset: 4

Author

Gary Yane, Jun 11 2010

Keywords

Comments

It appears that all terms of this sequence are multiple of 4 (checked up to 10^7). - Michel Marcus, Aug 26 2013

Examples

			The first term is 4, which appears twice in a 4 x 4 multiplication table. a(4) = 2x2 = 4x1 = 4. For all n = prime a(n) = a(n-1) so a(5) = 4. a(6) = 12 = 2x6 = 3x4, a(7) = 12, a(8) = 24 = 3x8 = 4x6, a(9) = 36 = 4x9 = 6x6.
		

Programs

  • PARI
    a(n) = {skeep = Set(); mmax = 0; for (i = 1, n, for (j = i, n, v = i*j; if (! setsearch(skeep, v), skeep = setunion(skeep, Set(v)), mmax = max(mmax, v)););); mmax;} \\ Michel Marcus, Aug 26 2013
    
  • PARI
    findxy(n, d) = {mins = 2*n; if (#d % 2, nd = #d\2 +1, nd = #d/2); for (i = 1, nd, if ((s = d[i]+n/d[i]) < mins, mins = s; mini = i);); x = d[mini]; y = n/x; return (x*y*(x-1)*(y-1));}
    lista(nn) = {lmmx = 4; print1(lmmx, ", "); for (n=5, nn, d = divisors(n); nmmx = findxy(n, d); lmmx = max(lmmx, nmmx); print1(lmmx, ", "););} \\ Michel Marcus, Aug 26 2013

Formula

Let xy = n be the factorization of n such that x+y is a minimum. We then have a(4)= 4 and a(n)= max{a(n-1), xy(x-1)(y-1)} for all n>4.

Extensions

Edited by N. J. A. Sloane, Jun 12 2010
Corrected by Michel Marcus, Aug 26 2013