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: Martin Y. Champel

Martin Y. Champel's wiki page.

Martin Y. Champel has authored 19 sequences. Here are the ten most recent ones:

A264117 Largest integer which cannot be partitioned using only parts from the set {perfect powers excluding the n smallest}.

Original entry on oeis.org

23, 55, 87, 94, 119, 178, 271, 312, 335, 403, 501, 551, 598, 717, 861, 861, 903, 1022, 1119, 1248, 1463, 1535, 1688, 2031, 2067, 2416, 2535, 2976, 3064, 3164, 3407, 3552, 3552, 4023, 4143, 4416, 4633, 4663, 5424, 5424, 5688, 6000, 6455
Offset: 1

Author

Martin Y. Champel, Nov 03 2015

Keywords

Comments

It appears, but has not been proved, that for n>28, a(n) < a(n-1) + A001597(n).

Examples

			a(1) = 23 as 23 cannot be obtained by any combination of {4, 8, 9, 16} but the 4 following integers can:
24 (6*4) a combination of {4, 8, 9, 16},
25 (1*25) a combination of {4, 8, 9, 16, 25},
26 (1*8+2*9) a combination of {4, 8, 9, 16, 25},
27 (1*27) a combination of {4, 8, 9, 16, 25, 27} so all following integers can.
a(2) = 55 as 55 cannot be obtained by any combination of {8, 9, 16, 25, 27, 32, 36, 49} but the 8 following integers can.
a(3) = 87 as 87 cannot be obtained by any combination of {9, 16, 25, 27, 32, 36, 49, 64, 81} but the 9 following integers can.
		

Crossrefs

Cf. A001597.

Programs

  • Python
    # Python version 2.7
    from copy import *
    from math import *
    sol ={}
    def a(n):
        global sol
        if n in sol:  return sol[n]
        k = n**2 + 100
        yt = sorted(list(set([b**a for a in range(2, 1+int(log(k)/log(2))) for b in range(1, 1+int(k**(1./a)))])))[n:]
        p0 = yt[0]
        if n-1 in sol and n > 28:  p1 = sol[n-1] + 2 * p0
        else: p1 = 7 * p0 + 400
        yt = sorted(list(set([b**a for a in range(2, 1+int(log(p1)/log(2))) for b in range(1, 1+int(p1**(1./a)))])))[n:]
        st = []
        while st != yt:
            st = deepcopy(yt)
            yt = sorted(list(set(yt + [i+j for i in yt for j in yt if i>=j if i+j < p1])))
        d = 0
        f = yt[0] + 1
        t = f
        for i in range(1,len(yt)):
            if yt[i] == f:
                d += 1
                f += 1
                if d == yt[0] + 1:
                    yt = yt[:yt.index(t+1)]
                    sol[n] = yt.pop() + 1
                    return sol[n]
            else:
                t = f
                f = yt[i]+1
                d = 0

A263717 Number of partitions of n into perfect odd powers (1 being excluded).

Original entry on oeis.org

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

Author

Martin Y. Champel, Oct 24 2015

Keywords

Examples

			a(97) = #{8*9+25, 5*9+25+27, 2*9+25+2*27} = 3.
		

Crossrefs

Programs

  • Mathematica
    Needs["Combinatorica`"]; Length@ Select[Combinatorica`Partitions@ #, AllTrue[#, And[PrimePowerQ@ #, ! PrimeQ@ #, OddQ@ #] &, 1] &] & /@ Range[2, 52] (* Michael De Vlieger, Nov 05 2015, Version 10 *)
  • Python
    # Python version 2.7
    def a(n):
        base = sorted(list(set([a**b for b in range(2,int(log(n)/log(2))) for a in range(3,1+int(n**(1./b)),2)])))
        lb = len(base)
        if lb == 0:
            return 0
        sol = 0
        s = [n // base[0]]
        if lb == 1:
            if n % base[0]  == 0: return 1
            return 0
        while True:
            k = s.pop()
            while k < 0:
                if s ==(lb-1)*[0]:
                    return sol
                k = s.pop() - 1
            s.append(k)
            x = n - sum([s[i]*base[i] for i in range(len(s))])
            ls = len(s)
            if ls == lb:
                continue
            a = x // base[ls]
            b = x % base[ls]
            if b == 0:
                s.append(a)
                sol +=1
                if len(s) == lb:
                    s.pop()
                    s.append(-1)
                r = s.pop() - 2
                s.append(r)
            else:
                s.append(a-1)
                if a!=0:
                    if len(s) == lb: s[lb-1]=-1

A256749 a(n) is the time expressed in seconds starting at 0:00:00 at which the second-hand of a classical three hands clock is passing over any of the two other hands considering the minute-hand turns of 6 degrees in one minute and the hour-hand of 6 degrees in 12 minutes.

Original entry on oeis.org

0, 60, 61, 120, 122, 180, 183, 240, 244, 300, 305, 360, 366, 420, 427, 480, 488, 540, 549, 600, 610, 660, 671, 721, 732, 781
Offset: 0

Author

Martin Y. Champel, Apr 09 2015

Keywords

Comments

The sequence is given for its first 1249 terms which corresponds to 12 hours. At 12:00:00 the clock is back to its initial state but as the time wheel keeps on turning a(1248) = 43200 + a(0) , a(1249) = 43200 + a(1), a(n + p*1248) = a(n) + p*43200 for any nonnegative integer p.

Examples

			a(0) = 0 as the second-hand is over the minute-hand and the hour-hand at 0:00:00,
a(1) = 60 as the second-hand is over the hour-hand at 0:01:00,
a(2) = 61 as the second-hand is over the minute-hand at 0:01:01,...
a(23) = 721 as the second-hand is over the hour-hand at 0:12:01.
		

Programs

  • Python
    m0 = 0
    s = [0]
    for i in range(1, 60*12+1):
        m0 += 1
        m = m0 % 60
        h = (m0 // 12) % 60
        a, b = i * 60 + h, i * 60 + m
        s.append(a)
        s.append(b)
    s = list(sorted(set(s)))
    for i in range(len(s)):
        print ('A256749('+str(i)+') = '+str(s[i]))

A256589 Triangle read by rows: T(n,k) divided by (n-k+1)! is the expected value of number of possible subsets in a partition of a set of n elements with no subsets of cardinality smaller than k.

Original entry on oeis.org

1, 3, 1, 11, 2, 1, 50, 8, 2, 1, 274, 36, 6, 2, 1, 1764, 200, 30, 6, 2, 1, 13068, 1300, 168, 24, 6, 2, 1, 109584, 9720, 1080, 144, 24, 6, 2, 1, 1026576, 82180, 8100, 960, 120, 24, 6, 2, 1
Offset: 1

Author

Martin Y. Champel, Apr 03 2015

Keywords

Comments

This sequence can be seen as a generalization of A233744 which is the particular case where minimum subset cardinality is 2 (k=2).
T(n,k) / A004736(n,k)! = 1 + 1 / ( A002024(n,k) - A002260(n,k) + 1) * (Sum of (T(n,p) / A004736(n,p)!) for p starting at A002260(n,k) up to A002024(n) - A002260(n) if 2 * A002260(n) <= A002024(n)).
The triangle below but including the diagonal is A166350 because there is only one possible partition of subsets of cardinality >= k in any set whose cardinality is between k and 2*k-1.

Examples

			The triangle T(n, k) starts:
n\k  1   2   3  4  5  6  ...
1:   1
2:   3   1
3:  11   2   1
4:  50   8   2  1
5: 274  36   6  2  1
6:1764 200  36  6  2  1
		

Crossrefs

A255400 a(n) is the smallest nonnegative integer such that a(n)! contains a string of exactly n consecutive 0's.

Original entry on oeis.org

0, 5, 10, 15, 20, 264, 25, 30, 35, 40, 45, 101805, 50, 55, 60, 65, 70
Offset: 0

Author

Martin Y. Champel, Feb 22 2015

Keywords

Comments

Most multiples of 5 belong to the sequence (if not all).
All terms whose indices are included in A000966 are far bigger than their neighboring terms whose indices are multiples of 5.
a(11) is a multiple of 5, we can verify a(11) = a(25448).

Examples

			a(0) = 0 as 0! = 1 does not contain '0'.
a(1) = 5 as 5! = 120 contains '0'.
a(2) = 10 as 10! = 3628800 contains '00' and 10 is the smallest integer for which the condition is met.
		

Programs

  • PARI
    \\ uses is() from A000966
    f(k, special, sz, sz1) = my(f=k!); if (special, s=Str(f/10^valuation(f, 10)), s=Str(k!)); #strsplit(s, sz) - #strsplit(s, sz1);
    a(n) = if (n==0, return(0)); my(sz= concat(vector(n, k, "0")), sz1=concat(sz, "0"), k=1,special=is(n)); while (f(k, special, sz, sz1) != 1, k++); k; \\ Michel Marcus, Oct 25 2023
  • Python
    # Python version 2.7
    from math import factorial as fct
    def trailing_zero(n):
        k=0
        while n!=0:
            n/=5
            k+=n
        return k
    def A255400():
        index = 1
        f = 1
        while True:
            if trailing_zero(f) == index:
                print("A255400("+str(index)+") = " +str(f))
                index += 1
            elif trailing_zero(f) > index:
                while True:
                    clnzer = str(fct(f))[:-trailing_zero(f)]
                    if index*'0' in clnzer and (index+1)*'0' not in clnzer:
                        print("A255400("+str(index)+") = " +str(f))
                        index += 1
                        f = 0
                        break
                    f +=1
            f +=1
        return
    
  • Python
    import re
    def A255400(n):
        f, i, s = 1, 0, re.compile('[0-9]*[1-9]0{'+str(n)+'}[1-9][0-9]*')
        while s.match(str(f)+'1') is None:
            i += 1
            f *= i
        return i # Chai Wah Wu, Apr 02 2015
    

A252652 a(n) is the smallest nonnegative integer such that a(n)! contains a string of exactly n consecutive 0's, not including trailing 0's.

Original entry on oeis.org

0, 7, 12, 22, 107, 264, 812, 4919, 12154, 24612, 75705, 101805, 236441, 1946174
Offset: 0

Author

Jon E. Schoenfield, Mar 22 2015, at the suggestion of Martin Y. Champel

Keywords

Examples

			a(0) = 0 since 0! = 1, which does not contain a 0.
a(1) = 7 since 7! = 5040, which contains a 0 other than the trailing 0, and no integer smaller than 7 satisfies this requirement. (a(1) is not 5; 5! = 120, which has no 0 digits other than the trailing 0.)
a(2) = 12 since 12! = 479001600; discarding the trailing 0's leaves 4790016, which contains a string of exactly two consecutive 0's, and no integer smaller than 12 satisfies this requirement.
		

Programs

  • Mathematica
    A252652[n_] := Module[{m = 0, s, t},
       If[n == 0, While[MemberQ[IntegerDigits[m!], 0], m++]; m,
        t = Table[0, n];
        While[s = Split[IntegerDigits[m!]];
         If[MemberQ[Last[s], 0], s = Delete[s, -1]]; ! MemberQ[s, t],
         m++]; m]];
    Table[A252652[n], {n, 0, 13}] (* Robert Price, Mar 21 2019 *)
  • PARI
    f(k, sz, sz1) = my(f=k!, s=Str(f/10^valuation(f, 10))); #strsplit(s, sz) - #strsplit(s, sz1);
    a(n) = if (n==0, return(0)); my(sz=concat(vector(n, k, "0")), sz1=concat(sz, "0"), k=1); while (f(k, sz, sz1) != 1, k++); k; \\ Michel Marcus, Oct 25 2023
  • Python
    import re
    def A252652(n):
        if n == 0:
            return 0
        f, i, s = 1, 0, re.compile('[0-9]*[1-9]0{'+str(n)+'}[1-9][0-9]*')
        while s.match(str(f)) == None:
            i += 1
            f *= i
        return i # Chai Wah Wu, Dec 29 2015
    

Extensions

a(13) from Lars Blomberg, Apr 05 2015

A254717 a(n) is the smallest nonnegative integer such that a(n)! contains a string of exactly n consecutive 9's.

Original entry on oeis.org

0, 12, 11, 36, 99, 207, 629, 3982, 13216, 24090, 65698, 131076, 176801, 2074822, 5203944, 3716991
Offset: 0

Author

Martin Y. Champel, Feb 06 2015

Keywords

Examples

			a(1) = 12 since 12! = 479001600 contains '9' and 12 is the smallest integer for which the condition is met,
a(2) = 11 since 11! = 39916800 contains '99' and 11 is the smallest integer for which the condition is met.
		

Programs

  • Mathematica
    A254717[n_] := Module[{m = 0},
       If[n == 0, While[MemberQ[IntegerDigits[m!], 9], m++]; m,
        t = Table[9, n];
        While[! MemberQ[Split[IntegerDigits[m!]], t], m++]; m]];
    Table[A254717[n], {n, 0, 7}] (* Robert Price, Mar 21 2019 *)
  • PARI
    a(n)=k=0;while(k<10^4,d=digits(2*10^(#(digits(k!))+1)+10*k!);for(j=1,#d-n+1,c=0;for(i=j,j+n-1,if(d[i]==9,c++);if(d[i]!=9,c=0;break));if(c==n&&d[j+n]!=9&&d[j-1]!=9,return(k)));if(c==n,return(k));if(c!=n,k++))
    for(n=1,6,print1(a(n),", ")) \\ Derek Orr, Feb 06 2015

Extensions

a(12) from Jon E. Schoenfield, Feb 21 2015
a(13)-a(15) from Bert Dobbelaere, Oct 29 2018

A254716 a(n) is the smallest nonnegative integer m such that m! contains a string of exactly n consecutive 8's, or -1 if no such m exists.

Original entry on oeis.org

0, 11, 9, 16, 27, 482, 532, 4731, 2061, 22402, 50381, 187611, 757618, 591042, 5157267, 9003765
Offset: 0

Author

Martin Y. Champel, Feb 06 2015

Examples

			a(1) = 11 since 11! = 39916800 contains '8' and 11 is the smallest integer for which the condition is met. (In 9! the '8's occur in a substring of length 2.)
a(2) = 9 since 9! = 362880 contains '88' and 9 is the smallest integer for which this condition is met.
		

Programs

  • Mathematica
    f[n_] := Block[{k = 0, str = ToString[ 8(10^n - 1)/9]}, While[ Length@ StringPosition[ ToString[ k!], str] != 1, k++]; k]; f[0] = 0; Array[f, 14, 0] (* Robert G. Wilson v, Mar 10 2015 *)
  • PARI
    a(n)=k=0; while(k<10^4, d=digits(2*10^(#(digits(k!))+1)+10*k!); for(j=1, #d-n+1, c=0; for(i=j, j+n-1, if(d[i]==8, c++); if(d[i]!=8, c=0; break)); if(c==n&&d[j+n]!=8&&d[j-1]!=8, return(k))); if(c==n, return(k)); if(c!=n, k++))
    for(n=1,6,print1(a(n),", ")) \\ Derek Orr, Feb 06 2015

Extensions

a(0)=0 added by M. F. Hasler, Feb 10 2015
a(11) from Jon E. Schoenfield, Feb 21 2015
a(13) from Jon E. Schoenfield, Feb 28 2015
a(12) from Jon E. Schoenfield, Mar 09 2015
a(14)-a(15) from Bert Dobbelaere, Oct 29 2018

A254502 a(n) is the smallest nonnegative integer such that a(n)! contains a string of exactly n consecutive 7's.

Original entry on oeis.org

0, 6, 31, 48, 22, 599, 1102, 5280, 4667, 1753, 48861, 150336, 223254, 644487, 7016773, 9588848
Offset: 0

Author

Martin Y. Champel, Jan 31 2015

Keywords

Examples

			a(1) = 6 since 6! equals 720, which contains '7'.
		

Programs

  • Mathematica
    A254452[n_] := Module[{m = 0},
       If[n == 0, While[MemberQ[IntegerDigits[m!], 7], m++]; m,
        t = Table[7, n];
        While[! MemberQ[Split[IntegerDigits[m!]], t], m++]; m]];
    Table[A254452[n], {n, 0, 14}] (* Robert Price, Mar 21 2019 *)

Extensions

a(11), a(12) from Jon E. Schoenfield, Feb 21 2015
a(0) prepended by Jon E. Schoenfield, Mar 01 2015
a(13) from Jon E. Schoenfield, Mar 06 2015
a(14)-a(15) from Bert Dobbelaere, Oct 29 2018

A254501 a(n) is the smallest nonnegative integer such that a(n)! contains a string of exactly n consecutive 6's.

Original entry on oeis.org

0, 3, 20, 38, 35, 213, 1122, 3415, 10214, 32430, 145197, 351679, 666779, 813843, 3765934
Offset: 0

Author

Martin Y. Champel, Jan 31 2015

Keywords

Examples

			a(1) = 3 since 3! equals 6 and contains '6'.
a(2) = 20 since 20! contains '66' and 20 is the smallest integer for which the condition is met.
		

Programs

  • Mathematica
    A254451[n_] := Module[{m = 0},
       If[n == 0, While[MemberQ[IntegerDigits[m!], 6], m++]; m,
        t = Table[6, n];
        While[! MemberQ[Split[IntegerDigits[m!]], t], m++]; m]];
    Table[A254451[n], {n, 0, 7}] (* Robert Price, Mar 21 2019 *)

Extensions

a(10), a(11) from Jon E. Schoenfield, Feb 21 2015, Feb 23 2015
a(0) prepended by Jon E. Schoenfield, Mar 01 2015
a(12), a(13) from Jon E. Schoenfield, Mar 07 2015, Mar 10 2015
a(14) from Bert Dobbelaere, Oct 29 2018