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: Jakub Buczak

Jakub Buczak's wiki page.

Jakub Buczak has authored 13 sequences. Here are the ten most recent ones:

A383420 Maximum (equal) number of red and blue tiles on an n X n matrix, where opposite colors cannot be adjacent diagonally or edgewise, and where a cluster of the same color can be no greater than n.

Original entry on oeis.org

0, 0, 6, 8, 16, 24, 30, 38
Offset: 1

Author

Jakub Buczak, Apr 26 2025

Keywords

Comments

a(n) refers to the total number of both red and blue tiles covering the n X n matrix, and thus all the terms are even.

Examples

			a(2) = 0, since red and blue tiles, regardless of the arrangement will always either border sideways or diagonally.
a(3) = 6, a simple example could be:
  [R R R]
  [     ]
  [B B B]
		

Crossrefs

Formula

The lower and upper bounds apply to all n > 3.
k is the root of the smallest square greater than n, b = ceiling((n+1)/(k+1)). The variable x is defined as 5*((n+1)/(k+1) - b), if (n+1)/(k+1) - b > 0, otherwise x=0.
a(n) <= (b*k)^2 + n^2 - (n - x)^2 for all n.
a(n) => n^2/2, for n == 0 mod 4.
a(n) => (n^2 + n - 2)/2, for n == 1 mod 4.
a(n) => n^2/2 + n - 4, for n == 2 mod 4.
a(n) => (n^2 + n - 4)/2, for n == 3 mod 4.

A383399 For n>1, a(n) is the smallest number greater than a(n-1), whose sum with any previous term is deficient, with a(1) = 1.

Original entry on oeis.org

1, 2, 3, 6, 7, 8, 31, 43, 44, 91, 115, 121, 122, 127, 128, 140, 146, 163, 211, 248, 283, 290, 331, 403, 427, 464, 511, 595, 631, 667, 668, 751, 842, 883, 931, 955, 1051, 1106, 1123, 1171, 1243, 1291, 1388, 1411, 1555, 1591, 1682, 1711, 1723, 1771, 1843, 1891, 2011, 2131
Offset: 1

Author

Jakub Buczak, Apr 25 2025

Keywords

Comments

If not for the set condition that a(n) must be greater than a(n-1), the sequence would consist of only 1's, because 2 is a deficient number.
While a majority of the terms are deficient, a few are abundant, with the first instance being a(16) = 140.
This is also equivalent to the sum of any 2 terms being a deficient number.

Examples

			7 is a member, because 7+6, 7+3, 7+2 and 7+1 are all deficient.
		

Crossrefs

Programs

  • Maple
    q:= n-> is(numtheory[sigma](n)<2*n):
    a:= proc(n) option remember; local k, l;
          l:= [seq(a(i), i=1..n-1)]:
          for k from 1+`if`(n>1, a(n-1), 0)
            while not andmap(j-> q(k+j), l) do od; k
        end:
    seq(a(n), n=1..54);  # Alois P. Heinz, Apr 25 2025
  • Mathematica
    a[1] = 1; a[n_] := a[n] = Module[{k = a[n-1] + 1}, While[AnyTrue[Array[a, n-1], DivisorSigma[-1, #+k] >= 2 &], k++]; k]; Array[a, 54] (* Amiram Eldar, Apr 26 2025 *)
  • PARI
    isdeficient(n) = (sigma(n) < 2*n) ;
    isok(k, n, va) = for (i=1, n-1, if (! isdeficient(k+va[i]), return(0));); return(1);
    lista(nn) = my(va=vector(nn)); for (n=1, nn, my(k=if (n==1, 1, 1+va[n-1])); while(! isok(k, n, va), k++); k; va[n] = k;); va; \\ Michel Marcus, Apr 26 2025

A383398 a(n) is the smallest number whose sum with any previous term is abundant.

Original entry on oeis.org

1, 11, 19, 29, 59, 349, 521, 2071, 66949, 223231, 3660191, 4552181, 5500081, 10161979, 12235619, 47859629
Offset: 1

Author

Jakub Buczak, Apr 25 2025

Keywords

Comments

The terms are generally either prime or semiprime. This results in all known terms to be deficient (see A005100).
If a(1) is an even abundant number, then the set of all the terms is simply the set of all the even abundant numbers (see A173490).
I conjecture that all the terms are odd integers ending in 1 or 9. The odd nature of the terms seems particularly likely, as the sum of a(n) that's even with any previous term would need to be an odd abundant number (see A005231).
This is also equivalent to the sum of any 2 terms being an abundant number.

Examples

			29 is a member, because 29+19, 29+11 and 29+1 are all abundant numbers.
		

Crossrefs

Programs

  • Maple
    q:= n-> is(numtheory[sigma](n)>2*n):
    a:= proc(n) option remember; local k, l;
          l:= [seq(a(i), i=1..n-1)]:
          for k while not andmap(j-> q(k+j), l) do od; k
        end:
    seq(a(n), n=1..10);  # Alois P. Heinz, Apr 25 2025
  • Mathematica
    a[1] = 1; a[n_] := a[n] = Module[{k = a[n-1] + 1}, While[AnyTrue[Array[a, n-1], DivisorSigma[-1, #+k] <= 2 &], k++]; k]; Array[a, 10] (* Amiram Eldar, Apr 26 2025 *)
  • PARI
    isabundant(n) = (sigma(n) > 2*n) ;
    isok(k, n, va) = for (i=1, n-1, if (! isabundant(k+va[i]), return(0));); return(1);
    lista(nn) = my(va=vector(nn)); for (n=1, nn, my(k=if (n==1, 1, 1+va[n-1])); while(! isok(k, n, va), k++); k; va[n] = k;); va; \\ Michel Marcus, Apr 26 2025

Extensions

a(16) from Amiram Eldar, Apr 26 2025

A382986 a(n) is the number of iterations that n requires to reach 0 under the map k -> b(k) where b(k) = k+1 if k is even, and b(k) = k-gpf(k) if k is odd, where gpf(k) is the greatest prime dividing k.

Original entry on oeis.org

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

Author

Jakub Buczak, Apr 11 2025

Keywords

Comments

k -> 0 occurs when k is 1 or an odd prime and this is the only way to reach 0.
At 0, a loop 0 -> 1 -> 0 occurs and there are no other loops since either 1 or 2 steps is a decrease: b(k) < k for odd k, or b(b(k)) < k for even k >= 2.
Consecutive terms can form decreasing runs starting at an even term, such as: (4, 3, 2, 1) starting at the 8th term.

Examples

			a(0) = 0, since 0 already matches the ending condition.
a(2) = 2, since (b2)=3 and then b(3)=0.
a(3) = 1, since 3 - gpf(3) = 0.
		

Crossrefs

Programs

  • PARI
    gpf(n) = if (n==1, 1, vecmax(factor(n)[,1]));
    b(m) = if (m % 2, m - gpf(m), m+1);
    a(n)= my(nb=0); while (n>1, n=b(n); nb++); nb; \\ Michel Marcus, Apr 13 2025
    
  • Python
    from sympy import factorint
    from itertools import count
    def b(n): return n - max(factorint(n), default=0) if n&1 else n + 1
    def a(n): return next(i for i in count(1) if not (n:=b(n))) if n > 1 else n
    print([a(n) for n in range(90)]) # Michael S. Branicky, Apr 13 2025

Formula

a(p) = 1, for odd prime p.
a(2*n) = a(2*n+1) + 1.

A382834 Smallest number k > P(n) - prime(n+1)^2 which is coprime to P(n), where P(n)= A002110(n) are the primorials.

Original entry on oeis.org

-5, -17, -17, 97, 2143, 29747, 510151, 9699167, 223092031, 6469692277, 200560488763, 7420738133141, 304250263525363, 13082761331667823, 614889782588488607, 32589158477190041261, 1922760350154212635351, 117288381359406970978787, 7858321551080267055874051
Offset: 1

Author

Jakub Buczak, Apr 06 2025

Keywords

Comments

The difference d = P(n) - k is also coprime to P(n), and satisfies d < prime(n+1)^2, which means it must be prime since composite d would have at least one prime factor <= prime(n).
There is always at least one prime strictly between prime(n) and prime(n+1)^2, consequently d is the largest prime < prime(n+1)^2, and so a(n) = A002110(n) - A054270(n+1).
There are no negative terms after a(3).

Examples

			a(4) = 97, since 2*3*5*7 - 11^2 = 89, the smallest number coprime to 2*3*5*7 greater than 89 is 97.
a(2) = -17, since 2*3 - 5^2 = -19, the smallest number x>-19 coprime here is thus -17, and its difference d = 30 -(-17) = 47 is the largest prime < 7^2.
		

Crossrefs

Programs

  • PARI
    a(n) = my(P=vecprod(primes(n)), k=P-prime(n+1)^2+1); while (gcd(k,P)!=1, k++); k; \\ Michel Marcus, Apr 07 2025

A382246 Smallest number k such that k^n - 6 is prime.

Original entry on oeis.org

8, 3, 2, 5, 5, 5, 19, 85, 7, 5, 19, 275, 23, 43, 53, 455, 65, 23, 23, 175, 7, 65, 47, 295, 7, 143, 49, 115, 23, 355, 185, 305, 7, 55, 319, 85, 113, 25, 329, 505, 25, 187, 205, 25, 295, 437, 17, 2285, 7, 583, 35, 1375, 5, 7, 35, 895, 235, 277, 197, 695, 203, 145, 43, 35, 437, 215
Offset: 1

Author

Jakub Buczak, Mar 19 2025

Keywords

Comments

No term k in the sequence can be divisible by 2 or 3. Except for the special case a(1)-a(3), where the result of k^n - 6 is either the prime number 2 or 3.
If n is a multiple of 4, the only valid terms of k are those ending in a 5.
Empirical analysis suggests that the terms are typically prime or semiprime.

Examples

			a(1) = 8, because 8^1 - 6 = 2, which is prime.
a(4) = 5, because 5^4 - 6 = 619, which is prime.
		

Crossrefs

Cf. A028879 (a(2)), A239414 (a(6)) for the first term.

Programs

  • PARI
    a(n) = my(k=1); while (!isprime(k^n-6), k++); k; \\ Michel Marcus, Mar 19 2025
  • Python
    from sympy import isprime
    def a(n):
        k = 1
        while (n>1 and k not in [2,3] and (k%2==0 or k%3==0)) or not isprime(k**n-6):
            k += 1
        return k
    

A380905 Smallest number k such that k^(2*3^n) - 6 is prime.

Original entry on oeis.org

3, 5, 23, 7, 433, 2447, 9377, 82597, 134687
Offset: 0

Author

Jakub Buczak, Feb 07 2025

Keywords

Comments

Terms must have an ending digit of 3, 5 or 7. If k ends in 1 or 9, then k^(2*3^n)-6 ends in a 5, which is not prime.
a(7) is the first composite term. - Michael S. Branicky, Feb 24 2025

Examples

			For n=0, k^(2*3^0) - 6 is prime for the first time at a(0) = k = 3.
For n=5, k^(2*3^5) - 6 is prime for the first time at a(5) = k = 2447.
		

Crossrefs

Cf. Subsequence of A382246.
Cf. A028879 (a(0)), A239414 (a(1)) for the first term.

Programs

  • PARI
    a(n) = my(p=3,q=2*3^n); while (!ispseudoprime(p^q-6), p+=2); p; \\ Michel Marcus, Feb 08 2025
  • Python
    from sympy import isprime
    from itertools import count
    def a(n): return next(k for k in count(2) if k%10 in {3,5,7} and isprime(k**(2*3**n)-6))
    

Extensions

a(7) from Michael S. Branicky, Feb 24 2025
a(8) from Georg Grasegger, Apr 17 2025

A382179 Numbers k such that for each digit of k, 2*k*(digit) + 1 is prime.

Original entry on oeis.org

1, 3, 6, 9, 11, 14, 15, 22, 24, 25, 27, 28, 33, 44, 54, 63, 75, 78, 81, 88, 99, 111, 119, 131, 141, 153, 168, 173, 219, 249, 252, 255, 279, 282, 322, 325, 333, 357, 363, 414, 441, 459, 474, 491, 538, 553, 558, 565, 611, 666, 674, 699, 794, 797, 828, 831, 832, 858, 895, 924, 947, 955
Offset: 1

Author

Jakub Buczak, Mar 17 2025

Keywords

Comments

The decision to use the expression 2*k*(digit) instead of k*(digit) is based on the fact that k*(odd) + 1 is never prime. By multiplying k*(digit) by 2, we ensure that any number, regardless of its digits, can appear in the sequence. Additionally, numbers containing the digit 0 are never terms, as 2*k*(0) + 1 is never prime.
When k is restricted to the smallest term with n distinct digits, only 7 terms exist (see A382198).
If the smallest term k is further restricted to a prime number p with n distinct digits, the conditions become significantly more restrictive (see A382127).

Examples

			63 is a term because 2*63*6 + 1 and 2*63*3 + 1 are both prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[2500], AllTrue[2 * # * IntegerDigits[#] + 1, PrimeQ] &] (* Amiram Eldar, Mar 17 2025 *)
  • PARI
    isok(k) = my(d=Set(digits(k))); for (i=1, #d, if (!isprime(2*k*d[i]+1), return(0));); return(1); \\ Michel Marcus, Mar 17 2025
    
  • Python
    from sympy import isprime
    def ok(n): return all(isprime(2*n*d+1) for d in map(int, set(str(n))))
    print([k for k in range(956) if ok(k)]) # Michael S. Branicky, Mar 17 2025

A382127 Smallest prime p with n distinct digits, such that for each digit of p, 2*p*(digit) + 1 is prime.

Original entry on oeis.org

3, 131, 173, 4391, 4746616799
Offset: 1

Author

Jakub Buczak, Mar 16 2025

Keywords

Comments

The sequence is proven to be finite by definition and by nature, containing only up to 7 terms (though it is uncertain if all 7 exist). This is because in base 10 there are 10 digits, excluding 0 that's 9. There are always 2 digits d_1 and d_2, such that 2*p*d_1 + 1 and 2*p*d_2 + 1 has an ending digit of 5. The (d_1,d_2) for the ending digits of p are: 1->(2,7), 3->(4,9), 7->(1,6), 9->(3,8). We exclude any prime with a digit 0, because 2*p*(0) + 1 is never prime.
The form 2*p*(digit) + 1 ensures a chance of primality, as p*(odd) + 1 is always composite.
Under 2*p*(digit) + 1, every term with a digit 1 is also a Sophie-Germain prime (see A005384).

Examples

			a(2) = 131, because 131 has exactly 2 distinct digits (1,3), and 2*131*1 + 1 and 2*131*3 + 1 are both prime.
		

Crossrefs

Subsequence of A382199.

Programs

  • PARI
    isok(k, n) = my(d=Set(digits(k))); if (#d != n, return(0)); for (i=1, #d, if (!isprime(2*k*d[i]+1), return(0)); ); return(1);
    a(n) = my(p=2); while (!isok(p, n), p=nextprime(p+1)); p; \\ Michel Marcus, Mar 18 2025
  • Python
    from sympy import isprime
    from itertools import count
    def a(n):
        return next(p for p in count(2) if isprime(p) and len(set(str(p)))==n and '0' not in str(p) and all(isprime(2*p*int(d)+1) for d in set(str(p))))
    

Extensions

a(5) from Michel Marcus, Mar 18 2025

A381815 Smallest k>1 such that 10*k^(3*2^n)+1 is prime.

Original entry on oeis.org

3, 2, 2, 2, 138, 24, 695, 107, 250, 404, 4657, 2185, 27931
Offset: 0

Author

Jakub Buczak, Mar 07 2025

Keywords

Examples

			a(0) = 3, because 10*3^(3*2^0)+1 equals 271 which is prime.
a(1) = 2, because 10*2^(3*2^1)+1 equals 641 which is prime.
		

Crossrefs

Programs

  • Python
    from sympy import isprime
    from itertools import count
    def a(n): return next(k for k in count(2) if isprime(k**(3*(2**n)) * 10 + 1))

Extensions

a(10)-a(11) from Michael S. Branicky, Mar 07 2025
a(12) from Georg Grasegger, Apr 15 2025