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.

Showing 1-7 of 7 results.

A014824 a(0) = 0; for n>0, a(n) = 10*a(n-1) + n.

Original entry on oeis.org

0, 1, 12, 123, 1234, 12345, 123456, 1234567, 12345678, 123456789, 1234567900, 12345679011, 123456790122, 1234567901233, 12345679012344, 123456790123455, 1234567901234566, 12345679012345677, 123456790123456788, 1234567901234567899, 12345679012345679010, 123456790123456790121
Offset: 0

Views

Author

Keywords

Comments

The square roots of these numbers have some remarkable properties - see the link to Schizophrenic numbers.
Partial sums of A002275. - Jonathan Vos Post, Apr 25 2010
This sequence is the particular case of a(0) = 0, a(n) = r*a(n-1) + n, when r = 10. If now the first N terms are computed for (r > N) then the resulting set of numbers is readable as the smallest k-digits permutations (1 <= k <= N): Those built from the concatenation of the first k digits in base-r (see links). - R. J. Cano, Jan 09 2013
There is also an interesting structure to the decimal expansion of 1/sqrt(a(2*n+1)), which has long strings of 0's (that gradually shorten in length until they disappear) interspersed with strings of what, at first sight, appear to be random digits. However, if we factorize these blocks of 'random' digits we find they are related to each other. An example illustrating this is given below. - Peter Bala, Sep 13 2015
From Peter Bala, Sep 15 2015: (Start)
Extending the previous empirical observation, it appears that the decimal expansions of the numbers 1/ (a(4*n+1))^(1/2), 1/a((4*n+3))^(1/4), 1/(10*a(4*n))^(1/2), 1/(10*a(4*n+2))^(1/4), and their powers, have the same pattern of beginning with long strings of 0's (that gradually shorten in length until they disappear) interlaced with strings of digits which, when read as integers and factorized, turn out to be related to each other.
The following result, which is a consequence of Bottomley's explicit formula for a(n), should be helpful in explaining these observations: the decimal expansion of 1/a(2*n-1) for n >= 5 begins with long strings of 0's interlaced successively with the digits of the numbers 81*(18*n + 1)^k for k going from 0 up to approximately n/log_10(18*n). For example, for n = 7 we have 1/a(13) = 0.00000000000081000000000102870000000130644900000 165919023..., with 10287 = 81*127, 1306449 = 81*127^2 and 165919023 = 81*127^3. A similar result holds for the decimal expansion of the number 1/a(2*n).
It appears that a(4*n+3)^(1/4), a(4*n+3)^(3/4), (10*a(4*n))^(1/2), (10*a(4*n+2))^(1/4) and (10*a(4*n+2))^(3/4) are further examples of Brown's schizophrenic numbers.
A theorem of Kuzmin in the measure theory of continued fractions says that for a random real number alpha, the probability that some given partial quotient of alpha is equal to a positive integer k is given by 1/log(2)*( log(1 + 1/k) - log(1 + 1/(k+1)) ). Thus large partial quotients are the exception in continued fraction expansions. Empirically, we observe the presence of unexpectedly large partial quotients early in the continued fraction expansions of the numbers (a(4*n+1))^(1/2), (a(4*n+3))^(1/4), (10*a(4*n))^(1/2), (10*a(4*n+2))^(1/4) and their powers. An example is given below. (End)
From Ya-Ping Lu, Dec 21 2024: (Start)
To get a(n), concatenate the first n digits in the cyclic string '123456790' and subtract the number of occurrences of '9' from the concatenated number. For example, a(8) = 12345679 - 1 = 12345678.
There are 2 prime terms for n <= 20000: a(2497) and a(3301). (End)

Examples

			From _Peter Bala_, Sep 13 2015: (Start)
The decimal expansion of 1/sqrt(a(51)) begins 9.0...0211050...07423683750...02901423065625000... x 10^(-26). The long strings of 0's gradually shorten in length and are interspersed with eleven blocks of digits  [9, 21105, 742368375, 2901423065625, 1190671490555859375, 5025824361636282421875, 216068565680679841787109375, 940978603539360710982861328125, 4137365297437126626102768402099609375, 18326229731370116994398540261077880859375, 816525165681195562685426961332324981689453125]. Read as ordinary integers these numbers factorize as [3^2, (3^2)*5*7*67, (3^3)*(5^3)*(7^2)*(67^2), (3^2)*(5^5)*(7^3)*(67^3), (3^2)*(5^8)*(7^5)*(67^4), (3^4)*(5^8)*(7^6)*(67^5), (3^3)*(5^10)*(7^7)*11*(67^6), (3^3)*(5^11)*(7^7)*11*13*(67^7), (3^4)*(5^16)*(7^8)*11*13*(67^8), (3^2)*(5^17)*(7^9)*11*13*17*(67^9), (3^2)*(5^18)*(7^10)*11*13*17*19*(67^10)]. (End)
From _Peter Bala_, Sep 15 2015: (Start)
The continued fraction expansion of 1/sqrt(a(51)) begins [0; 11111111111111111111111111, 9, 47382136934375740345889, 2, 21, 3, 1, 7, 2, 1, 101028010521057015662, 5, 14, 9, 1, 1, 2, 2, 8, 5, 1, 1, 1, 1, 215411536292232442, 5, 1, 5, 1, 1, 2, 1, 1, 8, 1, 4, 3, 1, 4, 2, 1, 8, 1, 1, 3, 10, 459299650942926, 4, 1, 1, 4, 1, 20, 64, 5, 9, 2, 2, 1, 2, 1, 1, 1, 1, 30, 1, 11, 3, 979316952969, 1, 2, 93, 1, 5, 1, 1, 11, 1, 1, 1, 1, 5, 1, 29, 1, 29, 1, 1, 1, 2, 4, 1, 37, 1, 1, 2, 8, 2, 2088095848, 12, 1, 3, 1, 3, 2, 2, 3, 1, 5, 6, 1, 3, 1, 4, 2, 2, 1, 2, 2, 14, 4, 1, 2, 1, 50, 2, 6, 1, 11, 135, 4452229, 1, ...] and has several unexpectedly large partial quotients early on. (End)
For n=5, a(5) = 1*15 + 9*20 + 9^2*15 + 9^3*6 + 9^4*1 + 9^5*0 = 12345. - _Bruno Berselli_, Nov 13 2015
		

Crossrefs

Cf. A060011.
Cf. A002275. - Jonathan Vos Post, Apr 25 2010
Similar sequences in other bases are: (base-2) A000295, (base-3) A000340, (base-4) A014825, (base-5) A014827, (base-6) A014829. - R. J. Cano, Jan 11 2013
Differs from A007908, A035239, A057137, A060555, A138957 from n=10 on. - M. F. Hasler, Jan 17 2013
Cf. A030512.

Programs

  • Magma
    [(10^n-1)*(10/81)-n/9: n in [0..20]]; // Vincenzo Librandi, Aug 23 2011
    
  • Maple
    a:=n->sum((10^(n-j)-1^(n-j))/9,j=0..n): seq(a(n), n=0..17); # Zerinvary Lajos, Jan 15 2007
    a:=n->sum(10^(n-j)*j,j=0..n): seq(a(n), n=0..16); # Zerinvary Lajos, Jun 05 2008
  • Mathematica
    Table[Sum[10^i - 1, {i, n}]/9, {n, 18}] (* Robert G. Wilson v, Nov 20 2004 *)
    CoefficientList[Series[x/(1 - 12*x + 21*x^2 - 10*x^3), {x, 0, 20}], x] (* Wesley Ivan Hurt, Sep 15 2015 *)
  • PARI
    linrec01(p,u,base)={my(r=!p,A=1);for(j=2,u,A=A*base+r+p*j); A};
    a(n)=(n!=0)*linrec01(1, n, 10); \\ R. J. Cano, Jan 09 2011; With (0, n, 10) it generates repunit numbers.
    
  • PARI
    A014824(n)=(10^(n+1)\9-n)\9  \\ M. F. Hasler, Jan 17 2013
    
  • Python
    def A014824(n): s = ''.join('123456790'[i%9] for i in range(n)); q, r = divmod(n, 9); return int(s) - q - r//8 # Ya-Ping Lu, Dec 21 2024

Formula

a(n) = (10^n-1)*(10/81) - n/9. - Henry Bottomley, Jul 04 2000
a(n)/10^n converges to 10/81 = 0.123456790123456790...
Let b(n) = if(n = 0, 1, if(n = 1, 10, 10*9^(n-2))). Then a(n) = Sum_{k=0..n} C(n, k)*b(k) (Binomial transform). - Paul Barry, Jan 29 2004
G.f.: x/(1-12*x+21*x^2-10*x^3). - Colin Barker, Jan 08 2012
a(n) = 12*a(n-1) - 21*a(n-2) + 10*a(n-3), n>2. - Wesley Ivan Hurt, Sep 15 2015
a(n) = Sum_{i=0..n} 9^i*binomial(n+1,n-1-i). - Bruno Berselli, Nov 13 2015
a(n) = Sum_{i=0..n} 10^(n-i)*i. - Ya-Ping Lu, Dec 21 2024
E.g.f.: exp(x)*(10*exp(9*x) - 9*x - 10)/81. - Elmo R. Oliveira, Mar 29 2025

A056744 a(n) is the smallest number which when written in binary contains as substrings the binary expansions of 1..n.

Original entry on oeis.org

1, 2, 6, 12, 44, 44, 92, 184, 1208, 1256, 4792, 4792, 9912, 9912, 19832, 39664, 563952, 576464, 4496112, 4499184, 17996528, 17997488, 143972080, 143972080, 145057520, 145070832, 294967024, 294967024, 589944560, 589944560, 1179889136, 2359778272, 71079255008
Offset: 1

Views

Author

Fred J. Schalekamp, Aug 15 2000

Keywords

Comments

From Davis Smith, May 09 2021: (Start)
For n > 2, a(n) cannot be a power of 2.
If A007088(n) (the binary expansion of n) contains a string of k zeros, then it contains A007088(2^m), where 0 <= m <= k, as a substring. Similarly, if A007088(n) contains a string of k ones, then it contains A007088(2^m - 1), where 1 <= m <= k. Strings of zeros and ones are the most compact way to have powers of 2 and powers of 2 minus 1 (respectively) as substrings in a binary expansion. This means that A007088(a(n)) will contain a string of A000523(n) ones and a string of A000523(n) zeros. The binary expansion of a(2^k - 1) will contain a string of k ones and a string of k - 1 zeros.
Conjecture: a(n) == 0 (mod A053644(n)), i.e., A007088(a(n)) ends with the longest string of zeros. It follows from this that a(2^k) = 2*a(2^k - 1). A conjecture related to this is that a(2^k - 1) = 2*a(2^k - 2) + 2^(k - 1), i.e., A007088(a(2^k - 1)) ends with the longest string of ones followed by the longest string of zeros. Ending with the longest string of ones followed by the longest string of zeros is not true for all A007088(a(n)), as some have a hiccup before starting their string of zeros, e.g., a(10), a(18), a(22), and a(34).
Conjecture: a(2^k + 1) = 2^(k + floor(log_2(a(2^k)))) + a(2^k), i.e., concatenate the binary expansion of 2^(k - 1) to the front of the binary expansion of a(2^k) in order to get the binary expansion of a(2^k + 1).
(End)
All terms belong to A261467. - Rémy Sigrist, May 11 2021
From Jon E. Schoenfield, Jun 03 2021: (Start)
Conjecture: the binary expansion of a(n) contains exactly ceiling(n/2) 1's iff 2^m - 7 <= n <= 2^m + 6 for some integer m >= 3. (See Links.)
Conjecture: for n > 1, the binary expansion of a(n) begins with that of 2^floor(log_2(n-1)) + 1.(End)
From Davis Smith, Jun 05 2021: (Start)
For a proof that a(n) == 2^floor(log_2(n)) (mod 2^(floor(log_2(n)) + 1)), see my second link (not the b-file). This also proves the conjecture from May 09 2021 which states that it is congruent to 0 (mod A053644(n)). A proof for the related conjecture would likely rely on an explanation of values of n such that a(n) is not congruent to (2^floor(log_2(n)) - 1)*2^floor(log_2(n)) (mod 2^(2*floor(log_2(n)))), i.e. the values of n such that A007088(a(n)) does not end with a string of floor(log_2(n)) ones followed immediately by a string of floor(log_2(n)) zeros. A proof for Jon E. Schoenfield's second conjecture on Jun 03 2021 would satisfy my more restricted second conjecture and it may follow necessarily from my proof, assuming that A007088(a(n)) must begin with either A007088(2^floor(log_2(n - 1)) + 1) or A007088(2^floor(log_2(n))). (End)

Examples

			a(6)=44 because 101100 (44 in base 2) is the smallest number that contains 1, 10, 11, 100, 101 and 110 (1 through 6 in base 2).
Terms begin as follows (see Links for a longer table):
.
                a(n)
      =========================
   n  decimal      binary
  --  -------  ----------------
   1        1                 1
   2        2                10
   3        6               110
   4       12              1100
   5       44            101100
   6       44            101100
   7       92           1011100
   8      184          10111000
   9     1208       10010111000
  10     1256       10011101000
  11     4792     1001010111000
  12     4792     1001010111000
  13     9912    10011010111000
  14     9912    10011010111000
  15    19832   100110101111000
  16    39664  1001101011110000
		

Crossrefs

Programs

  • PARI
    A056744_vec(n)={
        my(
            L=List([1]),x=L[#L],Z=n+#L,B=binary(x),
            A=setbinop((y,z)->fromdigits(B[y..z],2),[1..#B])
        );
        while(#Lfromdigits(B[y..z],2),[1..#B]));listput(L,x));Vec(L)
    } \\ Davis Smith, May 09 2021

Formula

A144016(a(n)) >= n. - Rémy Sigrist, May 11 2021

Extensions

More terms from Naohiro Nomoto, Jul 20 2001
a(25)-a(31) from Ray Chandler, Nov 06 2008
a(32) from Davis Smith, May 10 2021
a(33) from Jon E. Schoenfield, May 11 2021

A054261 Smallest number that contains the first n primes as substrings.

Original entry on oeis.org

2, 23, 235, 2357, 112357, 113257, 1131725, 113171925, 1131719235, 113171923295, 113171923295, 1131719237295, 11317237294195, 1131723294194375, 113172329419437475, 1131723294194347537, 113172329419434753759
Offset: 1

Views

Author

Patrick De Geest, Feb 15 2000

Keywords

Comments

The version that allows substrings to go from left to right or right to left is A240959. - Dmitry Kamenetsky, Oct 07 2015

Crossrefs

Extensions

More terms from Naohiro Nomoto, Jul 26 2001

A054260 Smallest prime that contains all of the first n primes as substrings.

Original entry on oeis.org

2, 23, 523, 2357, 112573, 511327, 1135217, 1113251719, 11171323519, 113171952923, 113171952923, 11131951723729, 11317237419529, 1131723294375419, 113172329541947437, 1131723294195343747, 1113172329419434753759
Offset: 1

Views

Author

Patrick De Geest, Feb 15 2000

Keywords

Comments

The 10th and 11th terms are identical because the smallest prime containing all primes through 29 as substrings also happens to include 31. - Jon E. Schoenfield, Sep 10 2006

Crossrefs

Extensions

More terms from Jon E. Schoenfield, Sep 10 2006, corrected Oct 01 2006

A344183 Lexicographically earliest sequence of positive integers such that for any n > 0, the decimal expansion of a(n) contains the decimal expansion of k for k = 1..n and the decimal expansion of a(n+1) is obtained by replacing a possibly empty substring of the decimal expansion of a(n) by the binary expansion of n+1.

Original entry on oeis.org

1, 12, 123, 1234, 12345, 123456, 1234567, 12345678, 123456789, 1023456789, 11023456789, 110123456789, 1101213456789, 11012131456789, 110121314156789, 1101213141516789, 11012131415161789, 110121314151617189, 1101213141516171819, 11012013141516171819
Offset: 1

Views

Author

Rémy Sigrist, May 11 2021

Keywords

Comments

This sequence is a variant of A035239, easier to compute.
This sequence is not weakly increasing; a(107) < a(106).

Crossrefs

Cf. A035239.

Programs

  • Perl
    See Links section.

A350510 Square array read by descending antidiagonals: A(n,k) is the least number m such that the base-n expansion of m contains the base-n expansions of 1..k as substrings.

Original entry on oeis.org

1, 2, 1, 6, 5, 1, 12, 11, 6, 1, 44, 38, 27, 7, 1, 44, 95, 75, 38, 8, 1, 92, 285, 331, 194, 51, 9, 1, 184, 933, 1115, 694, 310, 66, 10, 1, 1208, 2805, 4455, 3819, 1865, 466, 83, 11, 1, 1256, 7179, 17799, 16444, 8345, 3267, 668, 102, 12, 1
Offset: 2

Views

Author

Davis Smith, Jan 02 2022

Keywords

Examples

			Square array begins:
n/k|| 1 |  2 |   3 |    4 |     5 |      6 |       7 |        8 |
================================================================|
2  || 1 |  2 |   6 |   12 |    44 |     44 |      92 |      184 |
3  || 1 |  5 |  11 |   38 |    95 |    285 |     933 |     2805 |
4  || 1 |  6 |  27 |   75 |   331 |   1115 |    4455 |    17799 |
5  || 1 |  7 |  38 |  194 |   694 |   3819 |   16444 |    82169 |
6  || 1 |  8 |  51 |  310 |  1865 |   8345 |   55001 |   289577 |
7  || 1 |  9 |  66 |  466 |  3267 |  22875 |  123717 |   947260 |
8  || 1 | 10 |  83 |  668 |  5349 |  42798 |  342391 |  2177399 |
9  || 1 | 11 | 102 |  922 |  8303 |  74733 |  672604 |  6053444 |
10 || 1 | 12 | 123 | 1234 | 12345 | 123456 | 1234567 | 12345678 |
11 || 1 | 13 | 146 | 1610 | 17715 | 194871 | 2143588 | 23579476 |
		

Crossrefs

The first n - 1 terms of rows: 2: A047778, 3: A048435, 4: A048436, 5: A048437, 6: A048438, 7: A048439, 8: A048440, 9: A048441, 10: A007908, 11: A048442, 12: A048443, 13: A048444, 14: A048445, 15: A048446, 16: A048447.

Programs

  • Mathematica
    T[n_,k_]:=(m=0;While[!ContainsAll[Subsequences@IntegerDigits[++m,n],IntegerDigits[Range@k,n]]];m);Flatten@Table[T[1+i,j+1-i],{j,9},{i,j}] (* Giorgos Kalogeropoulos, Jan 09 2022 *)
  • PARI
    A350510_rows(n,k,N=0)= my(L=List(concat(apply(z->fromdigits([1..z],n),[1..n-1]),if(n>2,fromdigits(concat([1,0],[2..n-1]),n),[]))),T1(x)=digits(x,n),T2(x)=fromdigits(x,n),A(x)=my(S=T1(x));setbinop((y,z)->T2(S[y..z]),[1..#S]),N=if(N,N,L[#L]),A1=A(N));while(#Lsetsearch(A1,z),[1..#L+1])),A1=A(N++));listput(L,N));Vec(L)

Formula

For k < n, A(n,k) = A(n,k - 1)*n + k = Sum_{i=1..k} i*(n^(k - i)).
A(n,n) = A049363(n).
A(n,2) = A057544(n).
For n > 3, A(n,3) = A102305(n).
A(n,n - 1) = A023811(n).

A173716 Smallest number that contains the first n semiprimes as substrings.

Original entry on oeis.org

4, 46, 469, 10469, 101469, 10141569, 101421569, 1014221569, 101421522569, 1014215225269, 101421522526339, 1014215225263349, 101421522526334359, 10142152252633435389, 101421522526334353839, 1014215225263346353839
Offset: 1

Views

Author

N. J. A. Sloane, Nov 25 2010

Keywords

Comments

Semiprime analog of A054261.

References

  • Jonathan Vos Post, Posting to the Sequence Fans Mailing List, May 24 2010

Crossrefs

Extensions

More terms from Sean A. Irvine, Dec 02 2010
Showing 1-7 of 7 results.