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.

Previous Showing 21-26 of 26 results.

A322919 Numbers k such that k and k-1 both first appear in the same power of 2 (in base 10).

Original entry on oeis.org

59, 74, 111, 785, 793, 914, 957, 985, 1070, 1467, 2019, 2099, 2332, 2610, 2934, 3028, 3083, 3311, 3334, 3973, 4198, 4208, 4334, 4590, 4689, 4785, 5247, 5350, 5535, 6166, 6335, 6669, 6761, 7167, 7340, 7707, 7980, 8668, 8990, 9180, 9840, 11110, 13096, 16285, 17418, 18091, 18361, 19219, 20522, 21494, 21827
Offset: 1

Views

Author

Keith F. Lynch, Dec 30 2018

Keywords

Examples

			For instance 2019 is in the sequence since 2018 and 2019 both appear in 2^212 and neither appear in any smaller power of two.
		

Crossrefs

Indices of consecutive repeats in A030000.

Programs

  • C
    #include 
    int main() {
      int n = 1000001;  /* Highest term */
      int p = 2;        /* Powers of two.  Test throughly if you change it. */
      int r = 10;       /* Base ten.  Test throughly if you change it. */
      char a[n];
      int b,c,i,j,k,k2,l,lk,m,ok,ok2,u,d[7],f[n],g[n],v[n];
      u = n;
      for (j=0;jM. F. Hasler, Jul 05 2021*/
        f[j] = g[j] = -1;
      }
      a[0] = 1;
      for (m=0;(m-1;l--) {
              ok = 1;
              for (j=lk-1;j>-1;j--) if (a[l+j] != d[j]) ok = 0;
              if (ok) ok2 = 1;
            }
            if (ok2) {
              f[k] = m;
              u--;
            }
          }
          if ((g[k]==-1) && (lk<=b+1)) {
            ok = 1;
            for (j=lk-1;j>-1;j--) if (a[b-lk+j+1] != d[j]) ok = 0;
            if (ok) g[k] = m;
          }
        }
        c = 0;
        for (j=0;j r-1) {
            c = a[j] / r;
            a[j] %= r;
          }
        }
      }
      for (i=1;i
    				
  • PARI
    uptoQdigits(n) = {v = vector(10^n); p = 1/2; todo = 10^n; my(res = List());
    for(i = 1, oo, p<<=1; process(p, n); if(todo <= 0, break)); for(i = 1, #v - 1,
    if(v[i] == v[i+1], listput(res, i))); res}
    process(p, n) = {my(dp = digits(p), vd, lp = logint(p, 2)); qdp = #dp; my(t = min(n, qdp)); for(qd = 1, t, for(j = 1, qdp - qd + 1, vd = fromdigits(vector(qd, i, dp[j+i-1])); if(v[vd + 1] == 0, v[vd + 1] = lp; todo--)))} \\ David A. Corneth, Dec 31 2018

A328375 Numbers k such that the decimal expansion of 2^k contains the substring 777.

Original entry on oeis.org

24, 40, 75, 152, 166, 179, 181, 191, 194, 199, 214, 230, 235, 260, 282, 296, 304, 311, 317, 323, 326, 332, 342, 345, 363, 370, 374, 390, 417, 424, 426, 443, 455, 468, 471, 474, 475, 483, 489, 490, 505, 512, 523, 524, 536, 540, 559, 567, 581, 584, 585, 588, 593
Offset: 1

Views

Author

Eder Vanzei, Oct 14 2019

Keywords

Comments

The decimal expansion of 2^k ends in 7776 iff k == 40 (mod 500), so the sequence is infinite. - Jon E. Schoenfield, Oct 14 2019
Conjecture: if n > 30536, then a(n) = n + 3623. - Chai Wah Wu, Oct 26 2019

Examples

			16777216 = 2^24.
		

Crossrefs

Cf. A007356 (contains 666), A030000 (contains n).

Programs

  • Maple
    q:= n-> searchtext("777", cat(2^n))>0:
    select(q, [$1..600])[];  # Alois P. Heinz, Oct 26 2019
  • Mathematica
    aQ[n_] := SequenceCount[IntegerDigits[2^n], {7, 7, 7}] > 0; Select[Range[660], aQ] (* Amiram Eldar, Oct 26 2019 *)
  • Python
    A328375_list = [k for k in range(1000) if '777' in str(2**k)] # Chai Wah Wu, Oct 26 2019

A346203 a(n) is the smallest nonnegative number k such that the decimal expansion of the product of the first k primes contains the string n.

Original entry on oeis.org

3, 0, 1, 3, 10, 7, 2, 9, 9, 8, 4, 18, 17, 11, 15, 16, 14, 18, 24, 16, 11, 4, 9, 5, 21, 13, 13, 13, 9, 21, 3, 5, 10, 14, 12, 13, 26, 24, 12, 17, 18, 15, 12, 26, 16, 22, 10, 16, 12, 11, 13, 7, 13, 20, 17, 19, 11, 20, 15, 18, 11, 14, 21, 13, 10, 24, 20, 14, 21, 8, 9
Offset: 0

Views

Author

Ilya Gutkovskiy, Jul 10 2021

Keywords

Examples

			a(5) = 7 since 5 occurs in prime(7)# = 2 * 3 * 5 * 7 * 11 * 13 * 17 = 510510, but not in prime(0)#, prime(1)#, prime(2)#, ..., prime(6)#.
		

Crossrefs

Programs

  • Mathematica
    primorial[n_] := Product[Prime[j], {j, 1, n}]; a[n_] := (k = 0; While[! MatchQ[IntegerDigits[primorial[k]], {_, Sequence @@ IntegerDigits[n], _}], k++]; k); Table[a[n], {n, 0, 70}]
  • PARI
    a(n) = my(k=0, p=1, q=1, sn=Str(n)); while (#strsplit(Str(q), sn)==1, k++; p=nextprime(p+1); q*=p); k; \\ Michel Marcus, Jul 13 2021; corrected Jun 15 2022
  • Python
    from sympy import nextprime
    def A346203(n):
        m, k, p, s = 1, 0, 1, str(n)
        while s not in str(m):
            k += 1
            p = nextprime(p)
            m *= p
        return k # Chai Wah Wu, Jul 12 2021
    

A102387 a(n) is the smallest number m such that 2^m contains the first n decimal digits of Pi.

Original entry on oeis.org

5, 17, 74, 144, 144, 2003, 2003, 37929, 82810, 161449, 712201, 2401519, 7339199, 33662541
Offset: 1

Views

Author

Sergei Bernstein (sergeibernstein(AT)gmail.com), Feb 22 2005

Keywords

Examples

			The first number is 5 because 2^5 is 32, which contains 3, the first digit of Pi.
		

Crossrefs

Formula

a(n) = A030000(A011545(n)).

Extensions

a(11)-a(14) from Giovanni Resta, Nov 14 2013

A176761 Partial sums of A030001, starting at n=1.

Original entry on oeis.org

1, 3, 35, 39, 295, 311, 33079, 33087, 37183, 38207, 1099511665983, 1099511666111, 1099511797183, 1099512059327, 1099514156479, 1099514156495, 1099648374223, 1100722116047, 1100722124239, 1100722126287, 1100722388431, 9896815410639
Offset: 1

Views

Author

Jonathan Vos Post, Apr 25 2010

Keywords

Comments

Partial sums of smallest power of 2 whose decimal expansion contains n. One may see this sequence expressed in binary, rather than decimal, for clarity, though "carries" obscure the characteristic function aspects of structure. The subsequence of primes in this partial sum begins: 3, 311, 1100722116047, 1100722388431.

Examples

			a(6) = 1 + 2 + 32 + 4 + 256 + 16 = 311 is prime.
		

Crossrefs

Formula

a(n) = SUM[i=1..n] A030001(i).

A248018 Least number k > 0 such that n^k contains n*R_n in its decimal representation, or 0 if no such k exists.

Original entry on oeis.org

1, 43, 119, 96, 186, 1740, 6177, 8421, 104191, 0, 946417
Offset: 1

Views

Author

Talha Ali, Sep 29 2014

Keywords

Comments

R_n is the repunit of length n, i.e., R_n = (10^n-1)/9, A002275.
a(10^n) = 0 for all n > 0. - Derek Orr, Sep 29 2014
a(9) > 86000. - Derek Orr, Sep 29 2014
Note that a(2) = A030000(22), and a(3) = A063566(333), and that sequence is also related in a similar way to sequences from A063567 up to A063572. - Michel Marcus, Sep 30 2014

Examples

			a(2) = 43 because 2^43 = 8796093022208 has the string '22' in it and 43 is the smallest power of 2 that produces such a result.
a(3) = 119 because 3^119 = 599003433304810403471059943169868346577158542512617035467 contains the string '333', and 119 is the smallest power of 3 that gives us such a result.
		

Crossrefs

Cf. A002275.

Programs

  • Python
    def a(n):
      s = str(n)
      p = len(s)
      if s.count('1') == 1 and s.count('0') == p - 1:
        return 0
      k = 1
      while not str(n**k).count(n*s):
        k += 1
      return k
    n = 1
    while n < 10:
      print(a(n),end=', ')
      n += 1
    # Derek Orr, Sep 29 2014

Extensions

a(3) and a(5) corrected, a(6)-a(8) added by Derek Orr, Sep 29 2014
a(4) corrected and a(9)-a(11) added by Hiroaki Yamanouchi, Oct 01 2014
Previous Showing 21-26 of 26 results.