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: Michael S. Branicky

Michael S. Branicky's wiki page.

Michael S. Branicky has authored 67 sequences. Here are the ten most recent ones:

A386964 a(1) = prime(1) = 2, a(n) = 10*a(n-1) + (prime(n) mod 10).

Original entry on oeis.org

2, 23, 235, 2357, 23571, 235713, 2357137, 23571379, 235713793, 2357137939, 23571379391, 235713793917, 2357137939171, 23571379391713, 235713793917137, 2357137939171373, 23571379391713739, 235713793917137391, 2357137939171373917, 23571379391713739171, 235713793917137391713
Offset: 1

Author

Michael S. Branicky, Aug 11 2025

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<1, 0, a(n-1)*10+irem(ithprime(n), 10)) end:
    seq(a(n), n=1..21);  # Alois P. Heinz, Aug 12 2025
  • Mathematica
    a[1]=2;a[n_]:=10a[n-1]+Mod[Prime[n],10];Array[a,21] (* James C. McMahon, Aug 12 2025 *)
  • Python
    from sympy import nextprime
    from itertools import islice
    def A386964(): # generator of terms
        an = pn = 2
        while True:
            yield an
            an = 10*an + (pn:=nextprime(pn))%10
    print(list(islice(A386964(), 21)))

Formula

a(n) = concatenation of A007652(1)..A007652(n).

A383927 Binary echo numbers: positive integers k such that the gpf(k-1) is a suffix of k when gpf(k-1) and k are written in binary.

Original entry on oeis.org

7, 15, 19, 21, 55, 61, 63, 71, 101, 115, 127, 155, 157, 163, 181, 255, 273, 295, 301, 331, 349, 351, 365, 487, 501, 541, 573, 585, 599, 631, 687, 711, 723, 741, 781, 817, 827, 901, 1055, 1135, 1211, 1277, 1331, 1361, 1387, 1405, 1459, 1471, 1475, 1501, 1621, 1641, 1751
Offset: 1

Author

Michael S. Branicky, May 15 2025

Keywords

Comments

No term may be even, since if k were even, then k-1 would be odd and have only odd prime factors, none of which could be a suffix of k.

Examples

			7 is a term since 7 = 111_2, the gpf(6) = 3 = 11_2, and 11 is a suffix of 111.
21 is a term since 21 = 10101_2, the gpf(20) = 5 = 101_2, and 101 is a suffix of 10101.
		

Crossrefs

Binary analog of A383896 (and of A383296).
Cf. A006530.

Programs

  • Mathematica
    Select[Range@2000,(f=IntegerDigits[FactorInteger[#-1][[-1,1]],2])==IntegerDigits[#,2][[-Length@f;;]]&] (* Giorgos Kalogeropoulos, May 15 2025 *)
  • Python
    from sympy import factorint
    def ok(n): return n > 2 and bin(n)[2:].endswith(bin(max(factorint(n-1)))[2:])
    print([k for k in range(1800) if ok(k)]) # Michael S. Branicky, May 15 2025

A383272 Positions of records in A383271.

Original entry on oeis.org

0, 2, 6, 15, 21, 45, 111, 261, 1605, 1995, 4935, 8295, 69825, 268155, 550725, 4574955, 12024855, 39867135, 398467245, 1698754365, 16351800465
Offset: 1

Author

Michael S. Branicky, Apr 21 2025

Keywords

Comments

Using A322743, a(22) <= 72026408685 and, if it is equal, a(23) <= 120554434875.

Crossrefs

Base-2 analog of A276694.

A383271 Number of primes (excluding n) that may be generated by replacing any binary digit of n with a digit from 0 to 1.

Original entry on oeis.org

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

Author

Michael S. Branicky, Apr 21 2025

Keywords

Comments

Also, the number of prime neighbors of n in H(A070939(n), 2), where H(k, b) is the Hamming graph whose vertices are the sequences of length k over the alphabet {0,1,...,b-1} with adjacency being defined by having Hamming distance 1 (see A145667).
Prepending 1 is not allowed.

Examples

			a(3) = 1 since 3 = 11_2 can be changed to 10_2 = 2, which is prime.
a(5) = 1 since 5 = 101_2 can be changed to 001_2 = 1, 111_2 = 7 (prime), or 100_2 = 4.
a(6) = 2 since 6 = 110_2 can be changed to 010_2 = 2 (prime), 100_2 = 4, or 111_2 = 7 (prime).
a(7) = 2 since 7 = 111_2 can be changed to 011_2 = 3 (prime), 101_2 = 5 (prime), or 110_2 = 6.
		

Crossrefs

Base-2 analog of A209252.

Programs

  • Maple
    a:= n-> nops(select(isprime, [seq(Bits[Xor](2^i, n), i=0..ilog2(n))])):
    seq(a(n), n=0..100);  # Alois P. Heinz, Apr 23 2025
  • Mathematica
    A383271[n_] := Count[BitXor[n, 2^Range[0, BitLength[n] - 1]], _?PrimeQ];
    Array[A383271, 100, 0] (* Paolo Xausa, Apr 23 2025 *)
  • Python
    from gmpy2 import is_prime
    def a(n):
        if n == 0:
            return 0
        if n&1 == 0:
            return int(is_prime(n + 1)) + int(1<<(n.bit_length()-1)^n == 2)
        mask, c = 1, 0
        for i in range(n.bit_length()):
            if is_prime(mask^n):
                c += 1
            mask <<= 1
        return c
    print([a(n) for n in range(90)])

A381040 Numbers k such that the concatenation of 1, k! and 1 is prime.

Original entry on oeis.org

7, 9, 10, 15, 21225
Offset: 1

Author

Michael S. Branicky, Apr 14 2025

Keywords

Comments

Also, numbers k such that 10^(A034886(k)+1) + 10k! + 1 is prime.
For k >= 5, the foregoing requires that 10^(A034886(k)+1) + 1 has no prime factors <= k.
a(6) > 10^5. - Michael S. Branicky, Apr 24 2025

Examples

			The concatenation of 1, 7! and 1 is 150401, which is prime, so 7 is a term.
		

Crossrefs

Corresponding primes are in A262195.

A380788 Numbers with a prime number of binary digits.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106
Offset: 1

Author

Michael S. Branicky, Feb 03 2025

Keywords

Examples

			4 is a term since its binary representation has 3 bits, a prime.
64 is a term since its binary representation has 7 bits, a prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[200], PrimeQ[BitLength[#]] &] (* Paolo Xausa, Feb 03 2025 *)
  • Python
    from sympy import isprime
    def ok(n): return isprime(n.bit_length())
    print([k for k in range(150) if ok(k)])
    
  • Python
    # faster for initial segment of sequence
    from itertools import islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        d = 2
        while True:
            yield from (i for i in range(2**(d-1), 2**d))
            d = nextprime(d)
    print(list(islice(agen(), 65)))
    
  • Python
    from sympy import primerange
    def A380788(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum(min(x,(1<Chai Wah Wu, Feb 03 2025

A376774 Indices of records in A376772.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 21, 25, 28, 30, 37, 40, 41, 50, 55, 57, 66, 67, 76, 85, 93, 94, 139, 148, 157, 165, 174, 175, 179, 188, 197, 269, 278, 279, 288, 297, 369, 378
Offset: 1

Author

N. J. A. Sloane, Nov 05 2024 (with thanks to Michael S. Branicky)

Keywords

Crossrefs

Summary: the 16 sequences derived from A302656 are A376769-A376776, A377903-A377904, A377906-A377911.

Extensions

a(37)-a(46) from Dominic McCarty, Nov 08 2024

A376773 Records in A376772.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 21, 25, 44, 48, 52, 53, 58, 75, 77, 84, 96, 135, 146, 300, 317, 401, 452, 478, 1608, 1677, 1679, 1681, 1683, 1703, 1753, 1773, 13649, 13704, 124912, 124925, 125336, 128212, 128221, 128347, 128376, 128529
Offset: 1

Author

N. J. A. Sloane, Nov 05 2024 (with thanks to Michael S. Branicky)

Keywords

Comments

Numbers that are the slowest to appear in A302656.

Crossrefs

Summary: the 16 sequences derived from A302656 are A376769-A376776, A377903-A377904, A377906-A377911.

Extensions

a(37)-a(46) from Dominic McCarty, Nov 08 2024

A376874 a(n) = A376877(n) / p where p is the largest prime factor of A376877(n).

Original entry on oeis.org

6, 20, 28, 88, 104, 272, 304, 550, 650, 368, 464, 496, 1184, 1312, 1376, 1504, 1696, 1888, 1952, 11132, 4288, 4544, 4672, 5056, 5312, 5696, 6208, 6464, 6592, 6848, 6976, 7232, 8128, 16768, 17536, 17792, 19072, 19328, 20096, 20864, 21376, 22144, 22912, 23168, 24448
Offset: 1

Author

Keywords

Comments

Apparently a subset of A006039 and of A180332.
It seems that the terms are abundant numbers unless p is a Mersenne prime; in that case they are perfect numbers (unproved).
Terms a(1)-a(59) are each divisible by the corresponding p, and many of those quotients are powers of 2.

Crossrefs

Programs

  • Maple
    a := proc(n) A376877(n); % / max(NumberTheory:-PrimeFactors(%)) end:
    seq(a(n), n = 1..45);

A376850 Numbers k such that 85^k - 2 is prime.

Original entry on oeis.org

1, 4, 10, 29, 44, 381, 565, 5478, 6423, 15484, 32773
Offset: 1

Author

Michael S. Branicky, Oct 10 2024

Keywords

Comments

Dedicated to N. J. A. Sloane for his 85th birthday!

Crossrefs

Programs

  • Python
    from sympy import isprime
    def ok(n): return isprime(85**n - 2)
    print([k for k in range(600) if ok(k)])