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: Hans Havermann

Hans Havermann's wiki page.

Hans Havermann has authored 291 sequences. Here are the ten most recent ones:

A383675 Number of n-digit terms in A157711.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 2, 2, 1, 4, 9, 5, 8, 3, 9, 9, 12, 6, 14, 4, 5, 9, 8, 10, 13, 10, 8, 19, 17, 15, 20, 16, 27, 16, 26, 14, 23, 18, 26, 22, 40, 23, 21, 18, 32, 24, 29, 15, 33, 21, 25, 33, 34, 25, 25, 22, 47, 30, 40, 25, 37, 29, 38, 33, 47, 30, 41, 37, 45, 41, 46, 33, 42, 36, 52, 39, 48, 28, 49, 37
Offset: 1

Author

Hans Havermann, May 29 2025

Keywords

Comments

The b-file terms are based on probable prime counts that have been verified correct (by counting proven primes) to index 200. Subsequent terms (as they get larger) seemingly face an increasing probability of counting a probable prime that is actually a composite but it is unknown if such probability is ever large enough to impact the intended proven prime count.

Examples

			There are two A157711 terms (1011001, 1100101) containing 7 digits, so a(7) = 2.
		

Crossrefs

Cf. A157711.

A374834 Start the sequence with a(1) = 3. From now on iterate: if |a(n)| is prime, subtract from a(n) the |a(n)|-th prime of the list of primes A000040 and if |a(n)| is nonprime, add to a(n) the |a(n)|-th nonprime of the list of nonprimes A018252.

Original entry on oeis.org

3, -2, -5, -16, 9, 24, 59, -218, 58, 138, 316, 709, -4672, 708, 1563, 3408, 7364, 15779, 33601, -363046, 33600, 71181, 150103, 315315, 660199, -9268542, 660198, 1378289, 2870170, 5963401, 12365326, 25593793, 52887805, 109127470, 224867446, 462788654, 951362304, 1953684017, -43964452250, 1953684016
Offset: 1

Author

Eric Angelini and Hans Havermann, Jul 21 2024

Keywords

Examples

			As a(1) = 3 has an absolute prime value, we subtract the 3rd prime from 3 to form the next term: 3 - 5 = -2;
as a(2) = -2 has an absolute prime value, we subtract the 2nd prime from -2 to form the next term: -2 - 3 = -5;
as a(3) = -5 has an absolute prime value, we subtract the 5th prime from -5 to form the next term: -5 - 11 = -16;
as a(4) = -16 has an absolute nonprime value, we add the 16th nonprime to -16 to form the next term: -16 + 25 = 9; etc.
		

Crossrefs

Programs

  • Mathematica
    np[n_]:=FixedPoint[n+PrimePi[#]&,n+PrimePi[n]]; (* A018252 *) seq[n_]:=If[PrimeQ[Abs[n]],n-Prime[Abs[n]],n+np[Abs[n]]]; NestList[seq,3,52] (* Hans Havermann, Jul 23 2024 *)
  • Python
    from itertools import islice
    from sympy import prime, composite, isprime
    def agen(): # generator of terms
        an = 3
        while True:
            yield an
            if isprime(abs(an)):
                an = an - prime(abs(an))
            else:
                an += composite(abs(an)-1) if abs(an) > 1 else 1
    print(list(islice(agen(), 38))) # Michael S. Branicky, Jul 22 2024

A373391 Integers whose American English names (minus punctuation) can be split into two parts wherein the product of the letter-ranks of one part is equal to that of the other.

Original entry on oeis.org

3960, 13986, 15368, 80547, 85740, 111789, 111987, 386048, 408649, 408946, 410699, 410969, 410996, 486014, 519487, 519784, 609408, 609804, 615430, 619814, 629428, 629824, 639438, 639834, 649448, 649844, 659458, 659854, 669468, 669864, 679478, 679874
Offset: 1

Author

Hans Havermann, Jun 03 2024

Keywords

Comments

By letter-rank we mean a=1, b=2, ..., z=26. If the qualifying split happens beside a letter "a" (as for 408649) there will be two solutions, as moving that "a" to the other side of the split will not affect either product.
There can be no terms involving "million" less than 10^60 ("novemdecillion") since "m" = 13 would otherwise have no counterpart to make the product of all valuations square. - Michael S. Branicky, Jun 03 2024
Similarly, there can be no terms involving "quadrillion" less than 10^18 because "q" = 17. a(84)=1000107588, a(10887)=1000000611455. - Hans Havermann, Jun 15 2024

Examples

			3960 = threethousandni|nehundredsixty has the product of the letter-ranks of each side of the vertical pipe equal (to 486491443200000).
		

Crossrefs

Cf. A372222.

Programs

  • Python
    from math import prod, isqrt
    from num2words import num2words
    def n2w(n): return "".join(c for c in num2words(n).replace(" and", "") if c.isalpha())
    def ok(n):
        d = [ord(c) - ord('A') + 1 for c in n2w(n).upper()]
        if isqrt(s:=prod(d))**2 != s: return False
        return any(prod(d[:i]) == prod(d[i:]) for i in range(1, len(d)))
    print([k for k in range(10**5) if ok(k)]) # Michael S. Branicky, Jun 03 2024
    
  • Python
    from math import prod, isqrt
    from num2words import num2words
    def n2w(n):
        return "".join(c for c in num2words(n).replace(" and", "") if c.isalpha())
    def ok(n):
        d = [ord(c) - ord("A") + 1 for c in n2w(n).upper()]
        pr = prod(d)
        s = isqrt(pr)
        if s**2 != pr:
            return False
        p = 1
        for i in range(len(d)):
            p *= d[i]
            if p > s:
                return False
            if p == s:
                return True
    for n in range(1, 100000):
        if ok(n):
            print(n, end=", ")
    # David A. Corneth, Jun 03 2024, adapted from Michael S. Branicky, Jun 03 2024

A372106 A370972 terms composed of nine distinct digits which may repeat.

Original entry on oeis.org

1476395008, 116508327936, 505627938816, 640532803911, 1207460451879, 1429150367744, 1458956660623, 3292564845031, 3820372951296, 5056734498816, 6784304541696, 8090702381056, 9095331446784, 10757095489536, 10973607685048, 13505488366293, 14913065975808, 38203732951296
Offset: 1

Author

Hans Havermann, Apr 18 2024

Keywords

Comments

Each factorization is necessarily composed of multipliers that use only the single missing digit.
The single missing digit cannot be 0, 1, 5, or 6. Terms missing 2, 3, 4, 7, and 8 appear within a(1)-a(6). 52612606387341 = 9^6 * 99 * 999999 is an example of a term missing 9. - Michael S. Branicky, Apr 18 2024
Some terms are equal to the sum of two distinct smaller terms:
a(741) = a(635) + a(673)
a(1202) = a(1081) + a(1144)
a(1273) = a(1110) + a(1169)
a(1493) = a(1335) + a(1374)
a(2753) = a(2478) + a(2528)
a(2793) = a(2512) + a(2583)
a(3581) = a(3234) + a(3317)
a(4199) = a(3808) + a(3921)
a(4803) = a(4510) + a(4607) = a(4557) + a(4568)
a(5756) = a(5256) + a(5362)
a(6083) = a(5718) + a(5847)
a(7262) = a(6761) + a(6779)
a(7331) = a(6786) + a(6904)
a(9204) = a(8723) + a(8886)
a(9364) = a(8858) + a(8982)
a(9453) = a(8972) + a(8983) - Hans Havermann, Apr 21 2024

Examples

			10973607685048 = 22222*22222*22222 is in the sequence because it has nine distinct digits and may be factored using only its missing digit.
		

Crossrefs

Programs

  • Python
    import heapq
    from itertools import islice
    def agen(): # generator of terms
        allowed = [2, 3, 4, 7, 8, 9]
        v, oldt, h, repunits, bigr = 1, 0, list((d, d) for d in allowed), [1], 1
        while True:
            v, d = heapq.heappop(h)
            if (v, d) != oldt:
                s = set(str(v))
                if len(s) == 9 and str(d) not in s:
                    yield v
                oldt = (v, d)
                while v > bigr:
                    bigr = 10*bigr + 1
                    repunits.append(bigr)
                    for c in allowed:
                        heapq.heappush(h, (bigr*c, c))
                for r in repunits:
                    heapq.heappush(h, (v*d*r, d))
    print(list(islice(agen(), 100))) # Michael S. Branicky, Apr 19 2024

A370972 Composite numbers with properties that its digits (which may appear with multiplicity) may not appear in any of its factors (wherein the digits may also appear with multiplicity) and the combined digits of the product and the factors must have at least one of each of the ten digits.

Original entry on oeis.org

8596, 8790, 9360, 9380, 9870, 10752, 10764, 10854, 10968, 11760, 12780, 13608, 13860, 14760, 14780, 14820, 15628, 15678, 16038, 16704, 16920, 17082, 17280, 17340, 17640, 17820, 17920, 18090, 18096, 18690, 18720, 18960, 19068, 19084, 19240, 19440, 19460, 19608, 19740, 19780, 19800, 19980, 20457, 20574, 20748, 20754
Offset: 1

Author

N. J. A. Sloane, Apr 15 2024. Terms were computed by Hans Havermann

Keywords

Comments

See A370970 for another version.
Ed Pegg Jr noted that 1476395008 is the smallest term composed of nine distinct digits. See A372106 for subsequent terms. - Hans Havermann, Apr 19 2024

Examples

			996880 = 2*2*4*5*17*733: 8 and 9 appear twice each in the product. 2, 3, and 7 appear twice each in the factors. The digits in the product are distinct from the digits in the factors and, ignoring the duplicates, we have a combined 9680245173, one of each of the ten digits. -  _Hans Havermann_, Apr 15 2024
		

References

  • Ed Pegg Jr, Posting to Math-Fun Mailing List, April 2024.

Crossrefs

A370970 Numbers k which have a factorization k = f1*f2*...*fr where the digits of {k, f1, f2, ..., fr} together give 0,1,...,9 exactly once.

Original entry on oeis.org

8596, 8790, 9360, 9380, 9870, 10752, 12780, 14760, 14820, 15628, 15678, 16038, 16704, 17082, 17820, 17920, 18720, 19084, 19240, 20457, 20574, 20754, 21658, 24056, 24507, 25803, 26180, 26910, 27504, 28156, 28651, 30296, 30576, 30752, 31920, 32760, 32890, 34902, 36508, 47320, 58401, 65128, 65821
Offset: 1

Author

N. J. A. Sloane, Apr 13 2024, following emails from Ed Pegg Jr and Hans Havermann. The terms were computed by Hans Havermann

Keywords

Comments

The total number of digits in k, f1, ..., fr is ten, and they are all distinct.

Examples

			The complete list of terms:
 8596 = 2*14*307
 8790 = 2*3*1465
 9360 = 2*4*15*78
 9380 = 2*5*14*67
 9870 = 2*3*1645
10752 = 3*4*896
12780 = 4*5*639
14760 = 5*9*328
14820 = 5*39*76
15628 = 4*3907
15678 = 39*402
16038 = 27*594 = 54*297
16704 = 9*32*58
17082 = 3*5694
17820 = 36*495 = 45*396
17920 = 8*35*64
18720 = 4*5*936
19084 = 52*367
19240 = 8*37*65
20457 = 3*6819
20574 = 6*9*381
20754 = 3*6918
21658 = 7*3094
24056 = 8*31*97
24507 = 3*8169
25803 = 9*47*61
26180 = 4*7*935
26910 = 78*345
27504 = 3*9168
28156 = 4*7039
28651 = 7*4093
30296 = 7*8*541
30576 = 8*42*91
30752 = 4*8*961
31920 = 5*76*84
32760 = 8*45*91
32890 = 46*715
34902 = 6*5817
36508 = 4*9127
47320 = 8*65*91
58401 = 63*927
65128 = 7*9304
65821 = 7*9403
		

Crossrefs

A359482 Lexicographically earliest sequence of distinct terms > 0 such that the sum a(n) + a(n+1) is a substring of the concatenation (a(n), a(n+1)).

Original entry on oeis.org

1, 10, 99, 889, 8009, 1101, 9089, 80718, 100284, 183899, 206021, 396118, 215703, 354632, 108578, 469891, 229021, 61195, 34146, 7321, 13817, 3536, 1825, 749, 167, 508, 324, 2096, 4337, 2958, 2870, 4171, 12941, 16470, 30560, 25465, 21056, 35296, 17665, 35927, 23345, 10106, 548, 279, 516, 1094, 3228, 5302
Offset: 1

Author

Eric Angelini and Hans Havermann, Jul 03 2023

Keywords

Comments

Is this sequence a permutation of the integers > 0?
I conjecture that it isn't, and more specifically, that a(1) = 1 is the only single-digit term, and a(2) = 10 the only multiple of 10 below 100. See Examples for other terms of the form x*10^k, 1 <= x <= 9. - M. F. Hasler, Jul 03 2023

Examples

			1 + 10 = 11 and 11 is a substring of concat(1, 10) = 110.
10 + 99 = 109 and 109 is a substring of concat(10, 99) = 1099.
99 + 889 = 988 and 988 is a substring of concat(99, 889) = 99889.
889 + 8009 = 8898 and 8898 is a substring of 8898009.
8009 + 1101 = 9110 and 9110 is a substring of 80091101, etc.
Some examples of terms of the form x*10^k, x < 10: a(2136) = 800, a(4204) = 1000, a(6246) = 900, a(6618) = 100, a(11268) = 400, a(17446) = 10000, a(39292) = 600, a(44989) = 700, a(91359) = 300, ... - _M. F. Hasler_, Jul 03 2023
		

Crossrefs

Cf. A300000.

Programs

  • PARI
    A359482_first(n)={my(ok(a,k)=my(c=a*10^logint(k*10,10)+k); k=10^logint(10*a+=k,10); until(a>c\=10, c%k==a&& return(1)), U=[], a=0); vector(n,n, my(k=1); while(setsearch(U,k)|| !ok(a,k), k++); U=setunion(U,[k]); a=k)} \\ Becomes slow for n > 10. - M. F. Hasler, Jul 03 2023

A362335 Lexicographically earliest sequence of distinct nonnegative terms wherein every digit of a(n) is the absolute difference of two adjacent digits in a(n+1).

Original entry on oeis.org

0, 11, 10, 100, 110, 112, 102, 1002, 1022, 1102, 1120, 1124, 1026, 10028, 10086, 10082, 10866, 10822, 10886, 10882, 11086, 11082, 11208, 11976, 10928, 100913, 10096, 10093, 10966, 10933, 10996, 10993, 11096, 11093, 22309, 11309, 23009, 13009, 23099, 13099, 23309
Offset: 1

Author

Eric Angelini and Hans Havermann, May 27 2023

Keywords

Comments

All terms > a(24) contain at least one 9 with an adjacent 0. All terms > a(25) contain at least one instance of identical adjacent digits.

Examples

			a(125) = 9902. The next term is 10097, not 20009, because, in spite of its providing more digit differences than are needed, it is lexicographically earlier.
		

Programs

  • PARI
    {upto(N) = my(U=[], a=0); vector(N,n, if(n>1, my(da=Set(if(a,digits(a)))); a=10^#da; while( setsearch(U,a) || #setminus(da, Set(abs((n=digits(a))[^1]-n[^-1]))), a++)); U=setunion(U,[a]); a)} \\ M. F. Hasler, May 27 2023
  • Python
    from itertools import count, islice
    def c(k, d):
        dk = list(map(int, str(k)))
        return set(abs(dk[i+1]-dk[i]) for i in range(len(dk)-1)) >= d
    def agen(): # generator of terms
        an, aset = 0, {0}
        while True:
            yield an
            d = set(map(int, set(str(an))))
            an = next(k for k in count(10**len(d)) if k not in aset and c(k, d))
            aset.add(an)
    print(list(islice(agen(), 41))) # Michael S. Branicky, May 27 2023
    def A362335(n, A=[0]):
        while len(A) <= n:
            z = lambda a: zip(d := tuple(int(d) for d in str(a)), d[1:])
            D = set(str(A[-1])) ; a = 10**len(D)
            while a in A or D - set(str(abs(x-y)) for x,y in z(a)): a += 1
            A . append(a)
        return A[n] # M. F. Hasler, May 27 2023
    

Extensions

a(27) and beyond from Michael S. Branicky, May 27 2023

A360656 Least k such that the decimal representation of 2^k contains all possible n-digit strings.

Original entry on oeis.org

68, 975, 16963, 239697, 2994863
Offset: 1

Author

Hans Havermann, Feb 15 2023

Keywords

Examples

			2^68 = 295147905179352825856 is the least power of 2 containing all ten decimal digits, so a(1) = 68 = A171744(1).
2^975 is the least power of 2 containing all 100 two-digit strings, so a(2) = 975.
		

Crossrefs

Programs

  • Python
    def a(n, starte=0):
        e, p2, t = starte, 2**starte, 10**n
        while True:
            s2, ss = str(p2), set()
            for i in range(len(s2)-n+1):
                ss.add(s2[i:i+n])
                if len(ss) == t:
                    return e
            e += 1
            p2 *= 2
    print([a(n) for n in range(1, 4)]) # Michael S. Branicky, Feb 22 2023

A360623 Largest k such that the decimal representation of 2^k is missing any n-digit string.

Original entry on oeis.org

168, 3499, 53992, 653060
Offset: 1

Author

Hans Havermann, Feb 14 2023

Keywords

Comments

All terms are conjectural, checked up to 10^6.

Examples

			168 is the largest base-ten power of 2 that is missing any of the 10 length-1 digit-strings (missing '2').
3499 is the largest base-ten power of 2 that is missing any of the 100 length-2 digit-strings (missing '95').
53992 is the largest base-ten power of 2 that is missing any of the 1000 length-3 digit-strings (missing '661').
653060 is the largest base-ten power of 2 that is missing any of the 10000 length-4 digit-strings (missing '6164').
		

Crossrefs