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: Adnan Baysal

Adnan Baysal's wiki page.

Adnan Baysal has authored 14 sequences. Here are the ten most recent ones:

A371598 a(n) = (Product_{i=1..n} Fibonacci(i)) mod Fibonacci(n + 1).

Original entry on oeis.org

0, 1, 2, 1, 6, 6, 12, 2, 15, 16, 0, 49, 299, 220, 882, 252, 2176, 166, 495, 5720, 5251, 6065, 28224, 41650, 106947, 113288, 256737, 173841, 26840, 25379, 444150, 347278, 1834953, 8709610, 4046544, 2653673, 31127545, 47532000, 50717205, 147239197, 97769672, 37543458
Offset: 1

Author

Adnan Baysal, Mar 29 2024

Keywords

Examples

			a(1) = 0 since A000045(1) = A000045(2) = 1 and 1 mod 1 = 0.
a(2) = (1 * 1) mod 2 = 1.
a(3) = (1 * 1 * 2) mod 3 = 2.
a(4) = (1 * 1 * 2 * 3) mod 5 = 1.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Mod[Fibonorial[n], Fibonacci[n + 1]]; Array[a, 50] (* Amiram Eldar, Mar 29 2024 *)
  • PARI
    a(n) = my(f=fibonacci(n+1)); lift(prod(k=1, n, Mod(fibonacci(k), f))); \\ Michel Marcus, Apr 03 2024
  • Python
    from sympy import fibonacci
    def a(n):
        a_n = 1
        mod = fibonacci(n + 1)
        for i in range(1, n + 1):
            a_n = (a_n * fibonacci(i)) % mod
        return a_n
    

Formula

a(n) = A003266(n) mod A000045(n+1).

A371597 a(n) is the sum of k where A063655(k) = n.

Original entry on oeis.org

0, 1, 2, 7, 6, 22, 22, 38, 52, 70, 58, 141, 104, 188, 230, 281, 260, 320, 374, 531, 526, 717, 566, 927, 756, 1017, 1114, 1203, 1148, 1799, 1402, 1741, 1718, 2170, 2314, 2765, 2400, 2912, 2800, 3769, 2856, 4577, 3352, 4923, 4410, 5054, 5036, 6346, 6246, 5537
Offset: 1

Author

Adnan Baysal, Mar 28 2024

Keywords

Comments

Construct the same directed graph as in A369793. a(n) is the sum of vertices directed to the vertex n in this graph.

Examples

			a(1) = 0 since 1 does not exist in A063655.
a(2) = 1 because there is only one integral rectangle of area 1 with a minimal semiperimeter 2, which is the 1 X 1 square. So 2 appears only once in A063655 at index 1, which means a(2) = 1.
a(4) = 7, because only A063655(3) and A063655(4) have the value 4. For any n > 4, A063655(n) > 4, because A063655(n) > 2 * sqrt(n) > 2 * sqrt(4) = 4. Hence, 4 cannot appear in the rest of A063655.
		

Crossrefs

Programs

  • Python
    from sympy import divisors
    def A371597(n): return sum(m for m in range(1, (n**2>>2)+1) if (d:=divisors(m))[((l:=len(d))-1)>>1]+d[l>>1]==n)

A369793 a(n) is the number of occurrences of n in A063655.

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 2, 3, 3, 3, 2, 5, 3, 5, 5, 5, 4, 5, 5, 7, 6, 7, 5, 8, 6, 7, 7, 7, 6, 10, 7, 9, 8, 9, 9, 10, 8, 10, 9, 11, 8, 13, 9, 13, 11, 12, 11, 14, 13, 11, 12, 15, 10, 15, 13, 15, 13, 14, 12, 15, 12, 18, 16, 15, 15, 17, 13, 17
Offset: 1

Author

Adnan Baysal, Feb 07 2024

Keywords

Comments

Construct a directed graph whose vertex set is the set of all positive integers, and a directed edge from k to n belongs to this graph iff A063655(k) = n. a(n) is the in-degree of the vertex n in this graph. As conjectured in A369110, it is also conjectured here that the only cycles in this graph are from 4 to itself and between 5 and 6.

Examples

			a(1) = 0 since 1 does not exist in A063655. This is also clear from the definition of A063655, because there is no integral rectangle with semiperimeter 1.
a(2) = 1 because there is only one integral rectangle of area 1 with a minimal semiperimeter 2, which is the 1 X 1 square. So 2 appears only once in A063655, which means a(2) = 1.
a(4) = 2, because only A063655(3) and A063655(4) have the value 4. For any n > 4, A063655(n) > 4, because A063655(n) > 2 * sqrt(n) > 2 * sqrt(4) = 4. Hence, 4 cannot appear in the rest of A063655.
		

Crossrefs

Programs

  • Mathematica
    a=1156;Table[Count[Table[2*Median[Divisors[m]], {m,a}] ,n],{n,Floor[2*Sqrt[a]]}] (* James C. McMahon, Mar 12 2024 *)
  • Python
    from sympy import divisors
    def A369793(n): return sum(1 for m in range(1,(n**2>>2)+1) if (d:=divisors(m))[((l:=len(d))-1)>>1]+d[l>>1]==n) # Chai Wah Wu, Mar 25 2024

A369110 a(n) is the number of distinct elements appearing in the sequence formed by recursively applying A063655 when starting from n.

Original entry on oeis.org

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

Author

Adnan Baysal, Jan 13 2024

Keywords

Comments

A063655(n) gives the smallest semiperimeter of an integral rectangle with area n, which is the same thing as the minimum sum of two positive integers whose product is n. In this sequence, A063655 is applied recursively until a cycle is found. Then the number of distinct elements appearing in this process is given as a(n). Note that it's conjectured that a cycle will be found at some point.
Conjecture: The cycle part of each sequence generated by the recursion is one of (4), (5, 6), or (6, 5). Confirmed through 1 millionth term.
The conjecture is true. Proof: The conjecture holds for n <= 6. Suppose n >= 7 and the conjecture holds for lower values of n. If n is composite, then A063655(n) <= n/2+2. If n is prime, then A063655(n) = n+1 is even and A063655(A063655(n)) <= (n+1)/2+2. In both cases, n reaches a lower number and the conjecture holds for n. - Jason Yuen, Mar 30 2024

Examples

			n = 1 can be factored as 1*1 with minimum sum 2 (similarly, A063655(1) = 2). Then 2 = 1*2, so minimum sum is 3 = A063655(2). 3 = 1*3 which means the next number in the recursion is 4 = A063655(3). 4 = 2*2 which gives the same number 4 = A063655(4), hence this recursion will create a cycle at this point. Starting from n = 1 (including 1), we generated these numbers: (1, 2, 3, 4, 4, 4, ...). Therefore, a(1) = 4. a(2), a(3), and a(4) are trivially deduced from this example.
		

Crossrefs

Programs

  • Python
    from sympy import divisors
    def A369110(n):
        c = {n}
        while n<4 or n>5:
            c.add(n:=(d:=divisors(n))[((l:=len(d))-1)>>1]+d[l>>1])
        if n==5:
            c.add(6)
        return len(c) # Chai Wah Wu, Apr 25 2024

A333591 Alternate multiplying and adding Fibonacci numbers: a(0) = F(0) * F(1), for n >= 0, a(2n+1) = a(2n) + F(2n+2), a(2n+2) = a(2n+1) * F(2n+3).

Original entry on oeis.org

0, 1, 2, 5, 25, 33, 429, 450, 15300, 15355, 1366595, 1366739, 318450187, 318450564, 194254844040, 194254845027, 310224987508119, 310224987510703, 1297050672782249243, 1297050672782256008, 14197516664274574263568, 14197516664274574281279
Offset: 0

Author

Adnan Baysal, Mar 27 2020

Keywords

Examples

			a(0) = 0 * 1 =  0;
a(1) = 0 + 1 =  1;
a(2) = 1 * 2 =  2;
a(3) = 2 + 3 =  5;
a(4) = 5 * 5 = 25.
		

Programs

  • Mathematica
    a[0] = 0; a[n_] := a[n] = If[EvenQ[n], a[n-1] * Fibonacci[n+1], a[n-1] + Fibonacci[n+1]]; Array[a, 22, 0] (* Amiram Eldar, Mar 28 2020 *)
  • Python
    from sympy import fibonacci
    f = [fibonacci(n) for n in range(200)]
    def a(n):
        out = f[0] * f[1]
        for i in range(1, n+1):
            if i%2:
                out += f[i+1]
            else:
                out *= f[i+1]
        return out

A332660 Alternate adding and multiplying Fibonacci numbers: a(0) = F(0) + F(1), for n >= 0, a(2n+1) = a(2n) * F(2n+2), a(2n+2) = a(2n+1) + F(2n+3).

Original entry on oeis.org

1, 1, 3, 9, 14, 112, 125, 2625, 2659, 146245, 146334, 21072096, 21072329, 7944268033, 7944268643, 7840993150641, 7840993152238, 20261126305382992, 20261126305387173, 137066519455944225345
Offset: 0

Author

Adnan Baysal, Feb 18 2020

Keywords

Examples

			a(0) = 0 + 1 =  1;
a(1) = 1 * 1 =  1;
a(2) = 1 + 2 =  3;
a(3) = 3 * 3 =  9;
a(4) = 9 + 5 = 14.
		

Programs

  • Mathematica
    a[0] = 1; a[n_] := a[n] = If[OddQ[n], a[n-1] * Fibonacci[n+1], a[n-1] + Fibonacci[n+1]]; Array[a, 20, 0] (* Amiram Eldar, Mar 28 2020 *)
  • Python
    from sympy import fibonacci
    f = [fibonacci(n) for n in range(100)]
    def a(n):
        out = f[0] + f[1]
        for i in range(1, n):
            if i%2:
                out *= f[i+1]
            else:
                out += f[i+1]
        return out

A334067 a(n) is taken to be the smallest positive integer greater than a(n-1) which is consistent with the condition "n is a term of the sequence if and only if a(n) is prime" where indices start from 0.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 11, 13, 14, 15, 16, 17, 18, 19, 23, 29, 31, 37, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 59, 60, 62, 63, 64, 65, 67, 68, 69, 70, 71, 72, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 132, 133, 134, 135, 137, 139, 140, 149
Offset: 0

Author

Adnan Baysal, Apr 13 2020

Keywords

Comments

a(n) is the minimal sequence for which the sequence generated by the indices of primes in this sequence is equal to itself, where indices start from 0.
So if f is a function on 0-indexed integer sequences with infinitely many primes where f returns the increasing sequence of indices of primes of the input sequence b(n), then a(n) is the lexicographically minimal fixed point of f.
a(n) has almost the same definition as A079254, except that a(n) starts indices from 0 instead of 1. But the resulting sequences do not seem to have any correlation.

Examples

			a(0) cannot be 0, since then 0 should be prime, which it is not.
a(0) = 1 is valid hence a(1) must be the next prime, which is a(1) = 2.
Then a(2) should be the next prime, hence a(2) = 3.
a(3) should be prime, hence a(3) = 5.
Since 4 is not in the sequence so far, a(4) must be the next nonprime, which means a(4) = 6.
		

Crossrefs

The same definition as A079254 except here the indices start from 0 instead of 1.

Programs

  • Python
    # is_prime(n) is a Python function which returns True if n is prime, and returns False otherwise. In the form stated below runs with SageMath.
    def a_list(length):
        """Returns the list [a(0), ..., a(length-1)]."""
        num = 1
        b = [1]
        for i in range(1, length):
            num += 1
            if i in b:
                while not is_prime(num):
                    num += 1
                b.append(num)
            else:
                while is_prime(num):
                    num += 1
                b.append(num)
        return b
    print(a_list(63))

A333599 a(n) = Fibonacci(n) * Fibonacci(n+1) mod Fibonacci(n+2).

Original entry on oeis.org

0, 1, 2, 1, 7, 1, 20, 1, 54, 1, 143, 1, 376, 1, 986, 1, 2583, 1, 6764, 1, 17710, 1, 46367, 1, 121392, 1, 317810, 1, 832039, 1, 2178308, 1, 5702886, 1, 14930351, 1, 39088168, 1, 102334154, 1, 267914295, 1, 701408732, 1, 1836311902, 1, 4807526975, 1, 12586269024
Offset: 0

Author

Adnan Baysal, Mar 28 2020

Keywords

Examples

			a(0) = 0*1 mod 1 = 0;
a(1) = 1*1 mod 2 = 1;
a(2) = 1*2 mod 3 = 2;
a(3) = 2*3 mod 5 = 1;
a(4) = 3*5 mod 8 = 7.
		

Crossrefs

Equals A035508 interleaved with A000012.

Programs

  • Mathematica
    With[{f = Fibonacci}, Table[Mod[f[n] * f[n+1], f[n+2]], {n, 0, 50}]] (* Amiram Eldar, Mar 28 2020 *)
  • PARI
    a(n) = if (n % 2, 1, fibonacci(n+2) - 1); \\ Michel Marcus, Mar 29 2020
    
  • PARI
    concat(0, Vec(x*(1 + 3*x - x^3) / ((1 + x)*(1 + x - x^2)*(1 - x - x^2)) + O(x^45))) \\ Colin Barker, Mar 29 2020
  • Python
    def a(n):
        f1 = 0
        f2 = 1
        for i in range(n):
            f = f1 + f2
            f1 = f2
            f2 = f
        return (f1 * f2) % (f1 + f2)
    

Formula

a(2n+1) = 1, and a(2n) = F(2n+2) - 1, and lim(a(2n+2)/a(2n)) = phi^2 by d'Ocagne's identity.
a(n) = F(n) * F(n+1) mod (F(n) + F(n+1)) since F(n+2) := F(n+1) + F(n).
From Colin Barker, Mar 28 2020: (Start)
G.f.: x*(1 + 3*x - x^3) / ((1 + x)*(1 + x - x^2)*(1 - x - x^2)).
a(n) = -a(n-1) + 3*a(n-2) + 3*a(n-3) - a(n-4) - a(n-5) for n>4.
(End)

A332657 Alternate adding and multiplying prime numbers: a(2n) = a(2n-1) * prime(2n+1) and a(2n-1) = a(2n) + prime(2n-2) for n >= 1.

Original entry on oeis.org

5, 25, 32, 352, 365, 6205, 6224, 143152, 143181, 4438611, 4438648, 181984568, 181984611, 8553276717, 8553276770, 504643329430, 504643329491, 33811103075897, 33811103075968, 2468210524545664, 2468210524545743, 204861473537296669, 204861473537296758
Offset: 1

Author

Adnan Baysal, Feb 18 2020

Keywords

Examples

			a(1) = 2 + 3 = 5;
a(2) = 5 * 5 = 25;
a(3) = 25 + 7 = 32;
...
a(40) = 2714410084880275101596278688487175846.
		

Programs

  • Python
    from sympy import primerange
    p = list(primerange(1, 200))
    def a(n):
        out = p[0] + p[1]
        for i in range(1, n):
            if i % 2:
                out *= p[i + 1]
            else:
                out += p[i + 1]
        return out
    for n in range(1, 25):
        print(a(n), end=", ")

A332659 Alternate multiplying and adding prime numbers: a(2n) = a(2n-1) + prime(2n+1) and a(2n-1) = a(2n) * prime(2n-2) for n >= 1.

Original entry on oeis.org

6, 11, 77, 88, 1144, 1161, 22059, 22082, 640378, 640409, 23695133, 23695174, 1018892482, 1018892529, 54001304037, 54001304096, 3294079549856, 3294079549923, 233879648044533, 233879648044606, 18476492195523874, 18476492195523957, 1644407805401632173
Offset: 1

Author

Adnan Baysal, Feb 18 2020

Keywords

Examples

			a(1) =  2 * 3 =  6;
a(2) =  6 + 5 = 11;
a(3) = 11 * 7 = 77.
		

Programs

  • Python
    from sympy import primerange
    p = list(primerange(1, 1000))
    def a(n):
        out = p[0] * p[1]
        for i in range(1, n):
            if i % 2:
                out += p[i + 1]
            else:
                out *= p[i + 1]
        return out