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: Sebastian F. Orellana

Sebastian F. Orellana's wiki page.

Sebastian F. Orellana has authored 17 sequences. Here are the ten most recent ones:

A362138 a(n) = gpf(a(n-1) + prime(n)) where gpf is the greatest prime factor and a(1)=2.

Original entry on oeis.org

2, 5, 5, 3, 7, 5, 11, 5, 7, 3, 17, 3, 11, 3, 5, 29, 11, 3, 7, 13, 43, 61, 3, 23, 5, 53, 13, 5, 19, 11, 23, 11, 37, 11, 5, 13, 17, 5, 43, 3, 13, 97, 3, 7, 17, 3, 107, 11, 17, 41, 137, 47, 3, 127, 3, 19, 3, 137, 23, 19, 151, 37, 43, 59, 31, 29, 5, 19, 61, 41, 197
Offset: 1

Author

Sebastian F. Orellana, Jun 12 2023

Keywords

Examples

			a(3) = gpf(a(2) + prime(3)) = gpf(5+5) = 5.
		

Crossrefs

Cf. A006530 (gpf), A000040.

Programs

  • Mathematica
    gpf[n_] := FactorInteger[n][[-1, 1]]; a[1] = 2; a[n_] := a[n] = gpf[a[n - 1] + Prime[n]]; Array[a, 100] (* Amiram Eldar, Jun 15 2023 *)
  • Python
    from sympy import factorint, prime
    list=[2]
    num=1
    k=50
    for i in range(0, k):
      list.append(max(factorint(list[i]+prime(i+1))))
    print(list)

A362289 a(n) is the largest denominator when the greedy algorithm for Egyptian fractions is applied to 1/n + 1/(n+1).

Original entry on oeis.org

2, 3, 12, 180, 30, 1428, 56, 2520, 90, 2310, 132, 100292556, 182, 9240, 240, 119952, 306, 614444040, 380, 23100, 462, 42190274940, 552, 77390453400, 650, 201474, 756, 23370247110, 870, 200880, 992, 14523137084239067683872, 1122, 2206260, 1260, 104845560637757648698080
Offset: 1

Author

Sebastian F. Orellana, Apr 14 2023

Keywords

Examples

			For n=16, 1/16 + 1/17 = 33/272 which written in Egyptian fractions is 1/9 + 1/98 + 1/119952 and the largest denominator is 119952.
		

Crossrefs

Cf. A050210.

Programs

  • Mathematica
    egyptFraction[f_] := Ceiling[1/Most[NestWhileList[# - 1/Ceiling[1/#] &, f, # != 0 &]]]; a[n_] := egyptFraction[1/n + 1/(n + 1)][[-1]]; Array[a, 40] (* Amiram Eldar, Apr 14 2023 *)

Formula

a(n) = A050210(n*(n+1), 2*n+1). - Michel Marcus, Apr 14 2023

A361520 a(n) is the greatest prime factor of a(n-2)^2 + a(n-1)^2 where a(1)=2 and a(2)=3.

Original entry on oeis.org

2, 3, 13, 89, 809, 349, 409, 144541, 10446133981, 1361264878245241, 4398505263882824939701, 17847523009215848981, 512996953133650208042047593649109478833
Offset: 1

Author

Sebastian F. Orellana, Mar 14 2023

Keywords

Crossrefs

Programs

  • Maple
    A[1]:= 2: A[2]:= 3:
    for n from 3 to 15 do A[n]:= max(numtheory:-factorset(A[n-2]^2 + A[n-1]^2)) od:
    seq(A[],n=1..15); # Robert Israel, Mar 17 2023
  • Mathematica
    a[1] = 2; a[2] = 3; a[n_] := a[n] = FactorInteger[a[n - 1]^2 + a[n - 2]^2][[-1, 1]]; Array[a, 14] (* Amiram Eldar, Mar 14 2023 *)

A360825 a(n) is the remainder after dividing n! by its least nondivisor.

Original entry on oeis.org

1, 1, 2, 2, 4, 1, 6, 2, 5, 1, 10, 1, 12, 3, 8, 1, 16, 1, 18, 4, 11, 1, 22, 22, 6, 5, 14, 1, 28, 1, 30, 33, 20, 31, 18, 1, 36, 7, 20, 1, 40, 1, 42, 8, 23, 1, 46, 19, 11, 9, 26, 1, 52, 30, 27, 10, 29, 1, 58, 1, 60, 43, 53, 56, 33, 1, 66, 12, 35, 1, 70, 1, 72, 27, 23
Offset: 0

Author

Sebastian F. Orellana, Feb 22 2023

Keywords

Comments

For every term besides a(3), the least nondivisor is the next prime after n.

Examples

			a(5) = 5! mod 7 = 120 mod 7 = 1.
		

Programs

  • Mathematica
    a[n_] := Module[{f = n!, m = n + 1}, While[Divisible[f, m], m++]; Mod[f, m]]; Array[a, 100, 0] (* Amiram Eldar, Feb 22 2023 *)
  • PARI
    a(n) = my(k=1, r); while(!(r=(n! % (n+k))), k++); r; \\ Michel Marcus, Feb 22 2023
    
  • Python
    from functools import reduce
    from sympy import nextprime
    def A360825(n):
        if n == 3: return 2
        m = nextprime(n)
        return reduce(lambda i, j: i*j%m,range(2,n+1),1)%m # Chai Wah Wu, Feb 22 2023
    
  • Python
    from functools import reduce
    from sympy import nextprime
    def A360825(n):
        if n == 3: return 2
        m = nextprime(n)
        return (m-1)*pow(reduce(lambda i,j:i*j%m,range(n+1,m),1),-1,m)%m # Chai Wah Wu, Feb 23 2023

Formula

a(n) = 1 <=> n in { A040976 } \ { 3 }.
a(n) = n <=> n in { A006093 }.
a(n) = n! mod A151800(n) for n > 3.
a(n) = A213636(n!) = A213636(A000142(n)).
a(A000040(n)) = A275111(n) for n >= 3.
a(n) > n <=> n in { A360805 }.

A360496 a(n) is the remainder after dividing n by its largest prime factor plus 1, a(1) = 1.

Original entry on oeis.org

1, 2, 3, 1, 5, 2, 7, 2, 1, 4, 11, 0, 13, 6, 3, 1, 17, 2, 19, 2, 5, 10, 23, 0, 1, 12, 3, 4, 29, 0, 31, 2, 9, 16, 3, 0, 37, 18, 11, 4, 41, 2, 43, 8, 3, 22, 47, 0, 1, 2, 15, 10, 53, 2, 7, 0, 17, 28, 59, 0, 61, 30, 7, 1, 9, 6, 67, 14, 21, 6, 71, 0, 73, 36, 3, 16, 5, 8, 79, 2, 1, 40, 83, 4, 13
Offset: 1

Author

Sebastian F. Orellana, Feb 09 2023

Keywords

Examples

			a(15) = 15 mod (5+1) = 15 mod 6 = 3.
		

Crossrefs

Cf. A006530.

Programs

  • Maple
    a:= n-> irem(n, max(numtheory[factorset](n))+1):
    seq(a(n), n=1..100);  # Alois P. Heinz, Feb 10 2023
  • Mathematica
    a[n_] := Mod[n, FactorInteger[n][[-1, 1]] + 1]; Array[a, 100] (* Amiram Eldar, Feb 10 2023 *)
  • PARI
    a(n) = if (n==1, 1, n % (vecmax(factor(n)[, 1])+1)); \\ Michel Marcus, Feb 10 2023

Formula

a(n) = n mod (1 + A006530(n)).

A359950 a(n) is the greatest prime factor of n^n - n!.

Original entry on oeis.org

2, 7, 29, 601, 29, 116929, 11887, 4778489, 82207, 296987, 2767, 464089, 36922117, 71722471217, 10219277051, 9406703479, 2040247819, 122450719, 1265072927, 18353142818474353, 21514105057, 46999724987, 29693667067, 5684341885088084044195811037649, 692132186353, 12114317049616531
Offset: 2

Author

Sebastian F. Orellana, Jan 19 2023

Keywords

Examples

			a(5) = greatest prime factor of 5^5 - 5! = greatest prime factor of 3125 - 120 = greatest prime factor of 3005 = 3005/5 = 601.
		

Crossrefs

Programs

  • Mathematica
    Table[Max[First/@FactorInteger[n^n-n!]],{n,2,27}] (* Stefano Spezia, Jan 22 2023 *)
  • PARI
    a(n) = vecmax(factor(n^n - n!)[,1]); \\ Michel Marcus, Jan 22 2023

Formula

a(n) = A006530(A036679(n)) = A006530(n*A126130(n-1)).

Extensions

More terms from Michel Marcus, Jan 22 2023

A352798 a(n) = 1/(cf[0;n,n,n,...,n] - cf[0;n,n,...,n]) where the first continued fraction has n+1 terms and the second has n terms.

Original entry on oeis.org

1, -10, 330, -21960, 2551640, -461930274, 120572270007, -42930583856160, 20008932768992430, -11825788272679695050, 8643081649999714376976, -7654102744143874729100040, 8076084821027629176909996013, -10010473694454865001226770534530, 14402393216408406872433735669683370
Offset: 1

Author

Sebastian F. Orellana, Apr 03 2022

Keywords

Examples

			a(2) = -10 because the two continued fractions are cf[0;2,2] = 0 + 1/(2 + 1/2) = 2/5 and cf[0;2] = 0 + 1/2 = 1/2 and the reciprocal of their difference is 1/(2/5 - 1/2) = -10.
a(3) = 330 because the two continued fractions are cf[0;3,3,3] = 0 + 1/(3 + 1/(3 + 1/3)) = 10/33 and cf[0;3,3] = 0 + 1/(3 + 1/3) = 3/10, and 1/(10/33 - 3/10) = 330.
		

Crossrefs

Programs

  • Maple
    a:= n-> (f-> -(-1)^n*f(n,n)*f(n+1,n))(combinat[fibonacci]):
    seq(a(n), n=1..15);  # Alois P. Heinz, Jul 06 2022
  • PARI
    a(n) = (-1)^(n+1) * vecprod(Vec(lift(Mod('x,'x^2-n*'x-1)^(n+1)))); \\ Kevin Ryde, Apr 18 2022
    
  • Python
    from sympy.ntheory.continued_fraction import continued_fraction_reduce
    def A352798(n): return int(1/(continued_fraction_reduce([0]+[n]*n)-continued_fraction_reduce([0]+[n]*(n-1)))) # Chai Wah Wu, Jul 06 2022

Formula

a(n) = A084844(n)*A084845(n)*(-1)^(n+1).

Extensions

More terms from Kevin Ryde, Apr 18 2022

A352285 a(n) is the number of steps in John Conway's game of life that it takes for the smallest square checkerboard pattern with a diagonal of n living cells to either die out or enter a cycle; or -1 if it never cycles.

Original entry on oeis.org

1, 1, 1, 1, 3, 4, 4, 4, 40, 7, 58, 9, 38, 8, 37, 29, 71, 55, 51, 41, 49, 70, 60, 93, 102, 79, 333, 123, 181, 69, 200, 279, 372, 117, 188, 212, 122, 137, 263, 576, 96, 149, 225, 169, 150, 276, -1, 304, 281, 106, 215, 160, 206, 197, -1, 359, 221, 355, -1, 447, 178, 314, 431
Offset: 1

Author

Sebastian F. Orellana, Mar 10 2022

Keywords

Comments

a(n) = -1 iff the pattern's extent grows without bound (since a bounded region must eventually repeat). The first a(n) = -1 is at n=47 where the square launches 8 gliders into open space.

Examples

			For n = 1:
. . . | . . . |
. o . | . . . |
. . . | . . . |
all cells are dead after one generation, hence a(1)=1.
For n = 2:
. . . . | . . . . |
. o . . | . . . . |
. . o . | . . . . |
. . . . | . . . . |
all cells are dead after one generation, hence a(2)=1.
For n = 3:
. . . . .| . . . . . |
. o . o .| . . o . . |
. . o . .| . o . o . |
. o . o .| . . o . . |
. . . . .| . . . . . |
a pattern repeats after one generation, hence a(3)=1.
For n = 4:
. . . . . . | . . . . . . |
. o . o . . | . . o o . . |
. . o . o . | . o . . o . |
. o . o . . | . o . . o . |
. . o . o . | . . o o . . |
. . . . . . | . . . . . . |
a pattern repeats after one generation, hence a(4) = 1.
For n = 5:
. . . . . . . . . | . . . . . . . . . | . . . . . . . . . | . . . . . . . . . |
. . . . . . . . . | . . . . . . . . . | . . . . o . . . . | . . . o o o . . . |
. . o . o . o . . | . . . o o o . . . | . . . o o o . . . | . . . . . . . . . |
. . . o . o . . . | . . o . . . o . . | . . o . o . o . . | . o . . . . . o . |
. . o . o . o . . | . . o . . . o . . | . o o o . o o o . | . o . . . . . o . |
. . . o . o . . . | . . o . . . o . . | . . o . o . o . . | . o . . . . . o . |
. . o . o . o . . | . . . o o o . . . | . . . o o o . . . | . . . . . . . . . |
. . . . . . . . . | . . . . . . . . . | . . . . o . . . . | . . . o o o . . . |
. . . . . . . . . | . . . . . . . . . | . . . . . . . . . | . . . . . . . . . |
a pattern begins to oscillate between four parallel "blinkers" after one generation, hence a(5) = 3.
		

Crossrefs

Cf. A089520 (filled square).

A352026 a(n) is the nearest integer to 1/(H(k) - n), where H(k) is the smallest harmonic number that exceeds n.

Original entry on oeis.org

1, 2, 12, 50, 37, 483, 229, 785, 2059, 4806, 23251, 56470, 327690, 813351, 734186, 2643630, 10476269, 67340402, 268822185, 102740092, 618260119, 2491694355, 7222972533, 50525424196, 44010188391, 164490666033, 131444704333, 548839044705, 1808874061272, 9913711133738
Offset: 0

Author

Sebastian F. Orellana, Feb 28 2022

Keywords

Comments

The k-th harmonic number, H(k), is Sum_{j=1..k} 1/j. A002387(n) is the smallest k such that H(k) > n.

Examples

			H(2) = 1/1 + 1/2 = 3/2 = 1.5;
H(3) = 1/1 + 1/2 + 1/3 = 11/6 = 1.8333...;
H(4) = 1/1 + 1/2 + 1/3 + 1/4 = 25/12 = 2.08333..., which is the first harmonic number that exceeds 2, so a(2) = round(1/(25/12 - 2)) = round(1/(1/12)) = 12.
H(10) = 7381/2520 = 2.92896...;
H(11) = 83711/27720 = 3.01987..., which is the first harmonic number > 3, and the fractional part of 83711/27720 = 551/27720, so a(3) = round(27720/551) = round(50.30852...) = 50.
		

Crossrefs

Programs

  • PARI
    a(n)={my(s=0,k=0); while(s<=n, k++;s+=1/k); round(1/(s-n))} \\ Andrew Howroyd, Mar 01 2022
    
  • SageMath
    RR = RealField(1000)
    def A352026(n):
        g = RR.euler_constant()
        u = exp(RR(n) - g)
        a = u + RR(3/2) - RR(1/(24*u)) + RR(3/(640*u^3))
        h = RR(psi(RR(floor(a)))) + g
        return round(RR(1/(h - RR(n))))
    print([A352026(n) for n in range(30)])  # Peter Luschny, Mar 03 2022

Formula

a(n) = round(1/(H(A002387(n)) - n)).

Extensions

More terms from Peter Luschny, Mar 01 2022

A350037 a(n) = n^2 mod round(sqrt(n)).

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 4, 4, 1, 0, 1, 4, 4, 1, 0, 1, 4, 3, 4, 1, 0, 1, 4, 3, 4, 1, 0, 1, 4, 2, 2, 4, 1, 0, 1, 4, 2, 2, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 1, 0, 1, 4, 0, 7, 7, 0, 4, 1, 0, 1, 4, 0, 7, 7, 0, 4
Offset: 1

Author

Sebastian F. Orellana, Dec 09 2021

Keywords

Examples

			a(5) = 5^2 mod round(sqrt(5)) = 25 mod 2 = 1.
		

Crossrefs

Cf. A336302 (with ceiling instead of round).

Programs

  • Java
    import java.util.Arrays;
    public class modulus_sequence {
      static int[] solutions = new int[480];
      static int a_of_n (double n) {
        int z = (int)Math.round(Math.sqrt(n));
        int w = (int)(Math.pow(n, 2));
        int k = w%z;
        return k;
      }
      public static void main(String[] args) {
        for (double j = 2; j < 482; j++) {
          int h = a_of_n(j);
          solutions[(int) (j-2)]=h;
        }
        System.out.println(Arrays.toString(solutions));
      }
    }
    
  • Mathematica
    a[n_] := Mod[n^2, Round @ Sqrt[n]]; Array[a, 100, 2] (* Amiram Eldar, Dec 10 2021 *)
    Table[PowerMod[n,2,Round[Sqrt[n]]],{n,2,101}] (* Stefano Spezia, Dec 15 2021 *)
  • PARI
    a(n) = n^2 % round(sqrt(n)); \\ Michel Marcus, Dec 14 2021
    
  • PARI
    a(n) = lift(Mod(n, ((sqrtint(4*n) + 1)\2))^2); \\ Michel Marcus, Dec 14 2021
    
  • Python
    from math import isqrt
    def A350037(n): return pow(n,2,(m:=isqrt(n))+int(4*n>=(2*m+1)**2)) # Chai Wah Wu, Jan 10 2022

Formula

a(n) = A000290(n) mod A000194(n). - Michel Marcus, Dec 14 2021