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: Marc Morgenegg

Marc Morgenegg's wiki page.

Marc Morgenegg has authored 29 sequences. Here are the ten most recent ones:

A386873 Smallest prime p such that (p-k-1)/k is also prime for all k=1..n.

Original entry on oeis.org

5, 7, 13, 13, 2129401, 62198641, 62198641, 62198641, 28641897012961, 5193520377811921, 64090546658938801
Offset: 1

Author

Marc Morgenegg, Aug 06 2025

Keywords

Comments

All terms are the larger member of a twin prime pair, since for k=1 (p-1-1)/1=p-2 must be prime.

Examples

			a(4) = 13 is the smallest prime p such that (p-k-1)/k is prime for all k=1..4. (13-2)/1=11, (13-3)/2=5, (13-4)/3=3, (13-5)/4=2.
		

Crossrefs

Subsequence of A006512.
Cf. A089531.

Programs

  • Python
    from itertools import islice
    from gmpy2 import is_prime, next_prime
    def agen(): # generator of terms
        n = p = 1
        while True:
            k, p = 1, next_prime(p); q, r = p - 2, 0
            while r == 0 and is_prime(q): k += 1; q, r = divmod(p - k - 1, k)
            while n < k: n += 1; yield int(p)
    print(list(islice(agen(), 8))) # Michael S. Branicky, Aug 14 2025
    
  • Python
    from itertools import count
    from math import lcm
    from sympy import isprime
    def A386873(n):
        m = lcm(*range(1,n+1))
        for i in count(m+1,m):
            if isprime(i) and all(isprime((i-1)//j-1) for j in range(1,n+1)):
                return i # Chai Wah Wu, Aug 20 2025

Formula

a(n) == 1 mod lcm(1,2,...,n). - Chai Wah Wu, Aug 20 2025

Extensions

a(9)-a(11) from Jinyuan Wang, Aug 15 2025

A386724 Twin primes p such that 6p+1, 6p-1 is a twin prime pair.

Original entry on oeis.org

3, 5, 7, 17, 103, 107, 137, 283, 313, 347, 1033, 2027, 3257, 3673, 4217, 4547, 5023, 9433, 9767, 11833, 14593, 15137, 15733, 18253, 19423, 20717, 20983, 23537, 25847, 26113, 28753, 32057, 32323, 33073, 35053, 37307, 38327, 39163, 43607, 44623, 46183, 46273, 47743, 48407
Offset: 1

Author

Marc Morgenegg, Jul 31 2025

Keywords

Comments

{3,5} and {5,7} are the only twin prime pairs occurring in this since (6p-1)*(6p+1)*(6p+11)*(6p+13) is always divisible by 5. Therefore the smallest possible gaps for p>7 is 4 (cousin primes).

Crossrefs

Cf. A002822, A001359, A014574, A176131 (subsequence), A182481, A294731. Subset of A060212.

Programs

  • Maple
    q:= p-> isprime(p) and ormap(isprime, [p-2, p+2]) and andmap(isprime, [6*p-1, 6*p+1]):
    select(q, [2*i+1$i=1..25000])[];  # Alois P. Heinz, Jul 31 2025
  • Mathematica
    Select[Prime[Range[5000]], Or @@ PrimeQ[# + {-2, 2}] && And @@ PrimeQ[6*# + {-1, 1}] &] (* Amiram Eldar, Jul 31 2025 *)

Extensions

More terms from Pontus von Brömssen, Jul 31 2025

A386524 a(n+1) is the smallest product of two or more primes which sum to a(n), starting from a(1) = 5.

Original entry on oeis.org

5, 6, 8, 15, 26, 69, 134, 393, 1556, 4659, 9314, 27933, 921327, 85680249, 171360494, 2227686253, 17821489976, 124750429783, 17589810592353, 70359242369396, 11046401051970523, 22092802103941042, 1634867355691634222, 238690633930978585462, 45589911080816909786761, 2963344220253099136138295, 2474392423911337778675332705
Offset: 1

Author

Marc Morgenegg, Jul 24 2025

Keywords

Comments

a(1) = 5 is a prime and is not taken as a sum of just itself, but thereafter terms are never prime.

Examples

			For n=2, a(2) = 8 and the possible sums of primes are 2+2+2+2 = 8 or 3+5 = 8 and the smallest product of those terms is 3*5=15 (versus 2*2*2*2=16) so that a(3) = 15.
		

Crossrefs

Cf. A056240.

Programs

  • PARI
    \\ See Corneth link

Extensions

More terms from David A. Corneth, Jul 28 2025

A380786 Numbers with a prime number of bits, prime number of ones, and prime number of zeros in their binary representation.

Original entry on oeis.org

17, 18, 19, 20, 21, 22, 24, 25, 26, 28, 65, 66, 68, 72, 79, 80, 87, 91, 93, 94, 96, 103, 107, 109, 110, 115, 117, 118, 121, 122, 124, 4097, 4098, 4100, 4104, 4112, 4128, 4160, 4224, 4352, 4608, 5119, 5120, 5631, 5887, 6015, 6079, 6111, 6127, 6135, 6139, 6141, 6142, 6144, 6655, 6911
Offset: 1

Author

Marc Morgenegg, Feb 03 2025

Keywords

Comments

Each term has either two zeros or two ones in its binary representation. And so the total number of bits of each term is the larger prime of a twin prime pair.

Examples

			a(1) = 17 = 10001_2. Number of bits is 5, number of ones is 2, number of zeros is 3. {2,3,5} are all primes.
		

Crossrefs

Intersection of A052294, A144754, and A380788.
Subsequence of primes gives A272478.
Subsequence of A343258.
Cf. A006512 (bitlengths of terms).

Programs

  • Mathematica
    Select[Range[2^13], AllTrue[{#1, #2, #1 - #2} & @@ {IntegerLength[#,2], DigitCount[#, 2, 1]}, PrimeQ] & ] (* Michael De Vlieger, Feb 03 2025 *)
  • PARI
    isok(k) = my(h=hammingweight(k), b=#binary(k)); isprime(h) && isprime(b) && isprime(b-h); \\ Michel Marcus, Feb 07 2025
  • Python
    from sympy import isprime
    def ok(n): return isprime(L:=n.bit_length()) and isprime(O:=n.bit_count()) and isprime(L-O)
    print([k for k in range(7160) if ok(k)]) # Michael S. Branicky, Feb 03 2025
    
  • Python
    from sympy import isprime, nextprime, sieve
    from itertools import combinations, count, islice
    def agen(): # generator of terms
        p = 5
        while True:
            passed = set()
            if isprime(p-2):
                for q in [2, p-2]:
                    for locs in combinations(range(1, p), q-1):
                        w = ["1"] + ["0"]*(p-1)
                        for i in locs: w[i] = "1"
                        passed.add(int("".join(w), 2))
            yield from sorted(passed)
            p = nextprime(p)
            print(len(passed), p)
    print(list(islice(agen(), 61))) # Michael S. Branicky, Feb 03 2025
    

A376861 Numbers with a composite number of prime factors and a composite number of distinct prime factors.

Original entry on oeis.org

210, 330, 390, 462, 510, 546, 570, 690, 714, 770, 798, 840, 858, 870, 910, 930, 966, 1110, 1122, 1155, 1190, 1218, 1230, 1254, 1260, 1290, 1302, 1320, 1326, 1330, 1365, 1410, 1430, 1482, 1518, 1554, 1560, 1590, 1610, 1722, 1770, 1785, 1794, 1806, 1830, 1848, 1870, 1890, 1914, 1938, 1974, 1980, 1995
Offset: 1

Author

Marc Morgenegg, Feb 05 2025

Keywords

Examples

			840 is a term since 840 = 2 * 2 * 2 * 3 * 5 * 7 has 6 prime factors and 4 distinct prime factors, and both 6 and 4 are composite.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[2000],CompositeQ[PrimeOmega[#]]&&CompositeQ[PrimeNu[#]]&] (* James C. McMahon, Feb 13 2025 *)
  • Python
    from sympy import factorint, isprime
    def ok(n):
        f = factorint(n)
        w, W = len(f), sum(e for e in f.values())
        return w > 3 and W > 3 and not isprime(w) and not isprime(W)
    print([k for k in range(1, 2000) if ok(k)]) # Michael S. Branicky, Feb 07 2025

Formula

{k | A001221(k) in A002808 and A001222(k) in A002808}. - Michael S. Branicky, Feb 07 2025

A358538 Autobiographical numbers: the first digit of the term counts how many 0's the term in total has, the second how many 1's etc. up to the last digit but no more than b-1, where b is the base of the sequence. This sequence is in base b=10.

Original entry on oeis.org

1210, 2020, 21200, 3211000, 42101000, 521001000, 6210001000, 52200100019, 52200100108, 52200101007, 52200110006, 52201100004, 52210100003, 53010100019, 53010100108, 53010101007, 53010110006, 53011100004, 53110100002, 61200020006, 62200010001, 63010010001, 70200002007, 72100001000, 431110000299
Offset: 1

Author

Marc Morgenegg, Nov 21 2022

Keywords

Comments

Other terms include: 640010100011, 722000010001, 722000010010, 730100010001, 730100010010, 802000002008, 802000002080, 821000001000, 6500011000111, 7400100100011, 7400100100101, 8301000010001, 9020000002009, 9020000002090, 9020000002900, 9210000001000.
This sequence is finite. The last term starts with 99999999898... and has 89 digits.
This sequence is for base b=10. For each base b > 2, the last term of the corresponding sequence has b^2 - b - 1 digits.
For b > 2, the final term of the sequence equals b^((b-1)^2 - 2) - (b-1)*b^((b-1)*b - 1) + ((b^(b-1) - 1)/(b-1)) * b^(b-1) * ((b-1)*b^(b*(b-1)) - b^((b-1)^2 + 1) + 1)/(b^(b-1) - 1)^2. The base-b expansion of this number is the concatenation of b-2 digits b-1, 1 digit b-2, 1 digit b-1, b-3 digits b-2, and b-1 digits k for each k in b-3..0. This is equivalent to taking a string of digits consisting of b-1 copies of every valid base-b digit (0..b-1), sorting its digits in descending order, removing one of the digits b-2, and then swapping the positions of the last digit b-1 and the first digit b-2. (Thus, for b=10, the base-10 expansion of the final term is the concatenation of eight 9's, one 8, one 9, seven 8's, nine 7's, nine 6's, ..., nine 1's, and nine 0's.) - Jon E. Schoenfield, Nov 21 2022

Examples

			63010010001 is a term: we have six 0's, three 1's, one 3 and one 6 as digits in the term, visualized as follows:
  Digits: 0123456789
   term:  63010010001.
Note that this example also shows, starting from the 11th digit, there is no more representation of the frequency of that digit, because only the first b digits of its base-b expansion count the occurrences of the corresponding digit. In this case, the last digit, 1, is the 11th.
		

Crossrefs

Programs

  • Python
    # see linked program

Extensions

a(14)-a(19) inserted and a(25) from Michael S. Branicky, Nov 21 2022

A358711 Autobiographical numbers: let the k-th digit count the k-th nonnegative integer (A001477(k)) (possibly overlapping) occurrences in the term.

Original entry on oeis.org

1210, 2020, 21200, 3211000, 42101000, 521001000, 6210001000, 53110100002, 62200010001, 541011000021, 6401101000310, 74011001003100, 840110001031000, 9321000001201000, 94201000012110000
Offset: 1

Author

Marc Morgenegg, Nov 28 2022

Keywords

Comments

The k-th digit must count the k-th nonnegative integer (A001477(k)) appearances in the term.
This sequence is in base b=10. The number of appearances of any integer is always less than b in a term. E.g., the integer '0' can appear at most 9 times in a term.
There are no further terms. This was verified with a computer search of all (permutations of) partitions of d = 1..90 using up to 9 of any digit 0..9 and all (permutations of) "completions" of the remaining d-10 digits consistent with these digit counts. It was verified in each of the two cases for counting appearances: without overlaps (1111 has 2 11's) and with overlaps allowed (1111 has 3 11's). - Michael S. Branicky, Dec 02 2022

Examples

			6401101000310 is a term: we have six 0's, four 1's, zero 2's, one 3, one 4, one 6, three 10's and one 11 as integers in the term, visualized as follows:
  Digits(k): 0 1 2 3 4 5 6 7 8 9 10 11 12 (also the Integers(k))
  term:      6 4 0 1 1 0 1 0 0 0  3  1  0
Note that overlapping integers are counted as well: e.g., 110 is one 11, one 10. 111 is two 11's.
		

Crossrefs

Extensions

a(8) inserted and a(10)-a(15) by Michael S. Branicky, Nov 28 2022

A359049 Autobiographical numbers k whose decimal digits are a concatenation count(0), count(1), ..., count(m) for some m, where count(j) is the number of (possibly overlapping) occurrences of j within the digits of k itself.

Original entry on oeis.org

1210, 2020, 21200, 3211000, 42101000, 521001000, 6210001000, 53110100002, 62200010001, 541011000021, 6401101000310, 74011001003100, 840110001031000, 1040110000031000, 9321000001201000, 94201000012110000, 1160010100041000010, 11611001000320000100, 13313000000001200000, 13313000000100200000
Offset: 1

Author

Marc Morgenegg, Dec 14 2022

Keywords

Comments

In other words: Counting the zeros (j=0) in the term gives the first concatenation of decimal digits (number of zeros) in the term, counting all ones, gives the second, and so on.
A term can have any number of digits.
This sequence is in base 10.

Examples

			1040110000031000 is a term: we have ten 0's, four 1's, zero 2's, one 3, one 4, three 10's and one 11 as integers in the term, visualized as follows:
  Integers(j): 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
  term:       10 4 0 1 1 0 0 0 0 0  3  1  0  0  0
Notice that overlapping integers are counted so 110 is one 11, one 10 (or 111 would be two 11's).
		

Crossrefs

Extensions

a(17)-a(20) from Michael S. Branicky, Dec 14 2022

A357826 Base-10 weaker Skolem-Langford numbers.

Original entry on oeis.org

231213, 312132, 12132003, 23121300, 23421314, 30023121, 31213200, 41312432, 1214230043, 1312432004, 2342131400, 2412134003, 3004312142, 3400324121, 4002342131, 4131243200, 4562342536, 4635243265, 5364235246, 5623425364, 6352432654, 6425324635, 14156742352637, 14167345236275
Offset: 1

Author

Marc Morgenegg, Oct 14 2022

Comments

Self-describing numbers: between two digits "d" there are d digits.
a(n) has either 0 or 2 instances of any digit, hence even number of digits, and in fact the number of digits of a(n) == 0 or 2 or 6 (mod 8).
"weaker" means that when the smallest digit is x, all digits from x to the largest digit must be present.
The smallest digit x could be any value, but it turns out the biggest is x = 3 with 28 terms in total.
This sequence has 3390 terms. The largest term is 867315136875420024.
See A108116 for the "weak" variant with another constraint, and A132291 for the "strong" variant with more constraints.

Examples

			41312432 is a term since both 4's are separated by four digits, the 1's by one, the 3's by three, the 2's by two. Every digit from 1 to 4 is present.
		

Crossrefs

Cf. base-10 Skolem-Langford numbers: A108116 (weak), A132291 (strong), A339803 (super weak).

Programs

  • Python
    def afull(): # SL() is in A108116
        alst = []
        for d in range(1, 11):
            for b in range(11-d):
                dset = ("0123456789")[b:b+d]
                s = [0 for _ in range(2*d)]
                for an in sorted(SL(dset, s)):
                    alst.append(an)
        return sorted(alst)
    print(afull()[:22]) # Michael S. Branicky, Oct 14 2022

Extensions

More terms from David A. Corneth, Oct 14 2022

A356369 Numbers such that each digit "d" occurs d times, for every digit from 1 to the largest digit.

Original entry on oeis.org

1, 122, 212, 221, 122333, 123233, 123323, 123332, 132233, 132323, 132332, 133223, 133232, 133322, 212333, 213233, 213323, 213332, 221333, 223133, 223313, 223331, 231233, 231323, 231332, 232133, 232313, 232331, 233123, 233132, 233213, 233231, 233312, 233321, 312233, 312323
Offset: 1

Author

Marc Morgenegg, Oct 17 2022

Keywords

Comments

A version of self-describing integers (cf. A105776).
The sequence is finite.
The last term is 999999999888888887777777666666555554444333221.
This sequence contains Sum_{m = 1..9} Product_{k = 1..m} binomial( k*(k+1)/2, k) = 65191584768311709900058498136517664 terms. - Thomas Scheuerle and David A. Corneth, Oct 17 2022

Examples

			213323 is a term because the digit 1 occurs once, the digit 2 twice and 3 three times. Every digit from 1 to 3 is present.
		

Crossrefs

Programs

  • Python
    from itertools import islice
    from sympy.utilities.iterables import multiset_permutations
    def agen():
        for m in range(1, 10):
            s = "".join(str(k)*k for k in range(1, m+1))
            yield from (int("".join(p)) for p in multiset_permutations(s))
    print(list(islice(agen(), 65))) # Michael S. Branicky, Oct 17 2022

Extensions

Corrected by and more terms from David A. Corneth, Oct 17 2022