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 11-20 of 21 results. Next

A155671 a(n) = 10^n - 9^n + 1^n.

Original entry on oeis.org

1, 2, 20, 272, 3440, 40952, 468560, 5217032, 56953280, 612579512, 6513215600, 68618940392, 717570463520, 7458134171672, 77123207545040, 794108867905352, 8146979811148160, 83322818300333432, 849905364703000880
Offset: 0

Views

Author

Mohammad K. Azarian, Feb 01 2009

Keywords

Comments

a(n) is the number of numbers from 1 to 10^n containing a 1 in their decimal expansion. - Charles R Greathouse IV, Mar 25 2009

Crossrefs

Equals A016189 + 1. See that entry for more information.

Programs

Formula

G.f.: 1/(1-10*x)-1/(1-9*x)+1/(1-x).
E.g.f.: e^(10*x)-e^(9*x)+e^x.
a(n) = 19*a(n-1)-90*a(n-2)+72 with a(0)=1, a(1)=2. - Vincenzo Librandi, Jul 21 2010
a(n) = 20*a(n-1)-109*a(n-2)+90*a(n-3). - Wesley Ivan Hurt, Apr 21 2021

A344636 Numbers k such that half the numbers from 0 to k inclusive contain the digit "1".

Original entry on oeis.org

1, 17, 23, 161, 269, 271, 1457, 3397, 3419, 3421, 13121, 44685, 118097, 674909, 674933, 1062881
Offset: 1

Views

Author

Glen Gilchrist, May 25 2021

Keywords

Comments

Andrew Hilton (see Ref) refers to these as "half-one" numbers.

Examples

			1 is a term since among the numbers 0,1 exactly half contain a digit "1".
17 is a term since among the numbers 0,1,2,...,17 exactly half contain a digit "1".
		

References

  • Andrew Hilton, 101 Puzzles to Solve on your Microcomputer, 1984, HARRAP, page 57.

Crossrefs

Programs

  • Mathematica
    Select[2Range@2000,Length@Select[Range[0,#-1],MemberQ[IntegerDigits@#,1]&]==#/2&]-1 (* Giorgos Kalogeropoulos, Jul 28 2021 *)

A327560 The number of integers m in the range 0 < m < 10^n which are divisible by one or more of their own digits (A038770).

Original entry on oeis.org

9, 68, 708, 7578, 79952, 832506, 8585583, 87944417, 896452992, 9104962748, 92222435013, 932113080563, 9405187219507, 94771322677210, 953907792350911, 9592689086414459, 96392955785210896, 967997194404428275, 9715595409791983073
Offset: 1

Views

Author

Kevin Ryde, Sep 16 2019

Keywords

Comments

The integers m counted are A038770, so A038770(a(n)) = 10^n-1 is the last of n digits, and A038770(a(n)+1) = 10^n is the first of n+1 digits, for n>=1.
The digit divisibility condition is a regular language so a(n) is a linear recurrence. Working through a state machine for A038770 shows the recurrence is order 984, though its characteristic polynomial factorizes over rationals into terms of orders at most 36. The recurrence begins at a(4)..a(987) giving a(988). See the links for coefficients and generating function.
The biggest root (by magnitude) of the recurrence characteristic polynomial is 10 and its g.f. coefficient is 1 which shows a(n) -> 10^n. Or simply the number of m containing at least one digit 1 (a subset of those counted here) approaches 10^n per A016189.

Crossrefs

Cf. A038770 (digit strings), A327561 (opposite counts).

Programs

Formula

a(n) = 10^n-1 - A327561(n).

A343237 Triangle T obtained from the array A(n, k) = (k+1)^(n+1) - k^(n+1), n, k >= 0, by reading antidiagonals upwards.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 7, 5, 1, 1, 15, 19, 7, 1, 1, 31, 65, 37, 9, 1, 1, 63, 211, 175, 61, 11, 1, 1, 127, 665, 781, 369, 91, 13, 1, 1, 255, 2059, 3367, 2101, 671, 127, 15, 1, 1, 511, 6305, 14197, 11529, 4651, 1105, 169, 17, 1
Offset: 0

Views

Author

Wolfdieter Lang, May 10 2021

Keywords

Comments

This is the row reversed version of the triangle A047969(n, m). The corresponding array A047969 is a(n, k) = A(k, n) (transposed of array A).
A(n-1, k-1) = k^n - (k-1)^n gives the number of n-digit numbers with digits from K = {1, 2, 3, ..., k} such that any digit from K, say k, appears at least once. Motivated by a comment in A005061 by Enrique Navarrete, the instance k=4 for n >= 1 (the column 3 in array A), and the d = 3 (sub)-diagonal sequence of T for m >= 0.

Examples

			The array A begins:
n\k  0  1   2    3     4     5     6      7      8      9 ...
-------------------------------------------------------------
0:   1  1   1    1     1     1     1      1      1      1 ...
1:   1  3   5    7     9    11    13     15     17     19 ...
2:   1  7  19   37    61    91   127    169    217    271 ...
3:   1 15  65  175   369   671  1105   1695   2465   3439 ...
4:   1 31 211  781  2101  4651  9031  15961  26281  40951 ...
5:   1 63 665 3367 11529 31031 70993 144495 269297 468559 ...
...
The triangle T begins:
n\m   0    1     2     3     4     5    6    7   8  9 10 ...
-------------------------------------------------------------
0:    1
1:    1    1
2:    1    3     1
3:    1    7     5     1
4:    1   15    19     7     1
5:    1   31    65    37     9     1
6:    1   63   211   175    61    11    1
7:    1  127   665   781   369    91   13    1
8:    1  255  2059  3367  2101   671  127   15   1
9:    1  511  6305 14197 11529  4651 1105  169  17  1
10:   1 1023 19171 58975 61741 31031 9031 1695 217 19  1
...
Combinatorial interpretation (cf. A005061 by _Enrique Navarrete_)
The three digits numbers with digits from K ={1, 2, 3, 4} having at least one 4 are:
j=1 (one 4): 114, 141, 411; 224, 242, 422; 334, 343, 433; 124, 214, 142, 241, 412, 421; 134, 314, 143, 341, 413, 431; 234, 243, 423. That is,  3*3 + 3!*3 = 27 = binomial(3, 1)*(4-1)^(3-1) = 3*3^2;
j=2 (twice 4):  144, 414, 441;  244, 424, 442;  344, 434, 443; 3*3 = 9 = binomial(3, 2)*(4-1)^(3-2) = 3*3;
j=3 (thrice 4) 444; 1 = binomial(3, 3)*(4-1)^(3-3).
Together: 27 + 9 + 1 = 37 = A(2, 3) = T(5, 3).
		

Crossrefs

Cf. A005061, A008292, A047969 (reversed), A045531 (central diagonal), A047970 (row sums of triangle).
Row sequences of array A (nexus numbers): A000012, A005408, A003215, A005917(k+1), A022521, A022522, A022523, A022524, A022525, A022526, A022527, A022528.
Column sequences of array A: A000012, A000225(n+1), A001047(n+1), A005061(n+1), A005060(n+1), A005062(n+1), A016169(n+1), A016177(n+1), A016185(n+1), A016189(n+1), A016195(n+1), A016197(n+1).

Programs

  • Maple
    egf := exp(exp(x)*y + x)*(exp(x)*y - y + 1): ser := series(egf, x, 12):
    cx := n -> series(n!*coeff(ser, x, n), y, 12):
    Arow := n -> seq(k!*coeff(cx(n), y, k), k=0..9):
    for n from 0 to 5 do Arow(n) od; # Peter Luschny, May 10 2021
  • Mathematica
    A[n_, k_] := (k + 1)^(n + 1) - k^(n + 1); Table[A[n - k, k], {n, 0, 9}, {k, 0, n}] // Flatten (* Amiram Eldar, May 10 2021 *)

Formula

Array A(n, k) = (k+1)^(n+1) - k^(n+1), n, k >= 0.
A(n-1, k-1) = Sum_{j=1} binomial(n, j)*(k-1)^(n-j) = Sum_{j=0} binomial(n, j)*(k-1)^(n-j) - (k-1)^n = (1+(k-1))^n - (k-1)^n = k^n - (k-1)^n (from the combinatorial comment on A(n-1, k-1) above).
O.g.f. row n of array A: RA(n, x) = P(n, x)/(1 - x)^n, with P(n, x) = Sum_{m=0..n} A008292(n+1, m+1)*x^m, (the Eulerian number triangle A008292 has offset 1) for n >= 0. (See the Oct 26 2008 comment in A047969 by Peter Bala). RA(n, x) = polylog(-(n+1), x)*(1-x)/x. (For P(n, x) see the formula by Vladeta Jovovic, Sep 02 2002.)
E.g.f. of e.g.f.s of the rows of array A: EE(x, y) = exp(x)*(1 + y*(exp(x) - 1))*exp(y*exp(x)), that is A(n, k) = [y^k/k!][x^n/n!] EE(x, y).
Triangle T(n, m) = A(n-m, m) = (m+1)^(n-m+1) - m^(n-m+1), n >= 0, m = 0, 1, ..., n.
E.g.f.: -(exp(x)-1)/(x*exp(x)*y-x). - Vladimir Kruchinin, Nov 02 2022

A199819 Primes of the form 10^k-9^k.

Original entry on oeis.org

19, 271, 5217031, 68618940391, 8649148282327007911, 95289871302753755165078396311
Offset: 1

Views

Author

Vincenzo Librandi, Nov 21 2011

Keywords

Crossrefs

Programs

  • Magma
    [ a: n in [0..400] | IsPrime(a) where a is 10^n-9^n ];
  • Mathematica
    Select[10^Range[3000]-9^Range[3000],PrimeQ]

Formula

a(n) = A016189(A062576(n)). - Michel Marcus, Apr 21 2025

A248226 a(n) = 10^n - 3^n.

Original entry on oeis.org

0, 7, 91, 973, 9919, 99757, 999271, 9997813, 99993439, 999980317, 9999940951, 99999822853, 999999468559, 9999998405677, 99999995217031, 999999985651093, 9999999956953279, 99999999870859837, 999999999612579511, 9999999998837738533, 99999999996513215599
Offset: 0

Views

Author

Vincenzo Librandi, Oct 05 2014

Keywords

Crossrefs

Cf. similar sequences listed in A248225.

Programs

  • Magma
    [10^n-3^n: n in [0..30]];
    
  • Mathematica
    Table[10^n - 3^n, {n, 0, 25}] (* or *) CoefficientList[Series[(7 x)/((1 - 3 x) (1 - 10 x)), {x, 0, 30}], x]
    LinearRecurrence[{13,-30},{0,7},30] (* Harvey P. Dale, Jul 10 2021 *)
  • PARI
    a(n) = 10^n - 3^n \\ Michel Marcus, Oct 05 2014

Formula

G.f.: 7*x/((1 - 3*x)*(1 - 10*x)).
a(n) = 13*a(n-1) - 30*a(n-2).
a(n) = A011557(n) - A000244(n).
a(2*n) mod 10^n = A016189(n). - Michel Marcus, Oct 05 2014
a(n+1) = 7*A016145(n). - Bruno Berselli, Oct 05 2014
E.g.f.: exp(3*x)*(exp(7*x) - 1). - Stefano Spezia, Mar 09 2025

A344474 Least number k such that half of the numbers from 0 to k inclusive contain the digit n.

Original entry on oeis.org

1, 1, 2915, 39365, 472391, 590489, 6377291, 7440173, 8503055, 9565937
Offset: 0

Views

Author

Glen Gilchrist, May 20 2021

Keywords

Comments

"Half-numbers" are those for which half of the numbers including and preceding it contain a specific digit.
For each digit there are a finite number of nonnegative integers k such that exactly half of the numbers from 0 to k contain the digit. This sequence gives the first of these.

Examples

			a(0)=1 since among the numbers 0,1 exactly half contain a digit "0" and 1 is the smallest number where this occurs.
a(1)=1 since among the numbers 0,1 exactly half contain a digit "1" and 1 is the smallest number where this occurs.
a(2)=2915 since among the numbers 0,1,2,...,2915 exactly half contain a digit "2" and 2915 is the smallest number where this occurs.
a(3)=39365 since among the numbers 0,1,2,...,39365 exactly half contain a digit "3" and 39365 is the smallest number where this occurs.
		

References

  • Andrew Hilton, 101 Puzzles to Solve on your Microcomputer, 1984, HARRAP, page 57.

Crossrefs

Cf. A016189, A344634 (half-zero sequence), A344636 (half-one sequence).

Programs

  • PARI
    a(n)={if(n>=1&&n<10, my(k=0); while(n*(2*9^k-10^k)>10^k, k++); 2*9^k*n - 1, n==0)} \\ Andrew Howroyd, May 25 2021
  • Python
    for z in range (0, 10):
        z_s = str(z)
        counts=0
        for x in range (0,1000000000):
            x_s = str(x)
            if z_s in x_s:
                counts += 1
            if counts / (x+1) == 0.5:
                print(x)
                break
    

Formula

a(n) == 1457 (mod 1458) for n >= 2. - Hugo Pfoertner, May 25 2021

A344634 Numbers k such that half the numbers from 0 to k inclusive contain the digit "0".

Original entry on oeis.org

1, 10761677, 14958585, 14960717, 14961735, 15013205, 15588833, 15590573, 15591959, 15591961, 15592031, 15592229, 15592231, 15603695, 15633495, 15633503, 15633517, 16076087, 16263743, 20327615
Offset: 1

Views

Author

Glen Gilchrist, May 25 2021

Keywords

Comments

Andrew Hilton (see Ref.) refers to these as "half-zero" numbers.

Examples

			1 is a term since among the numbers 0,1 exactly half contain a digit "0".
10761677 is a term since among the numbers 0,1,2,...,10761677 exactly half contain a digit "0".
		

References

  • Andrew Hilton, 101 Puzzles to Solve on your Microcomputer, 1984, HARRAP, page 57.

Crossrefs

Programs

  • Python
    def afind(limit):
      count0 = [0, 1]
      for k in range(1, limit+1):
        count0['0' in str(k)] += 1
        if count0[0] == count0[1]: print(k, end=", ")
    afind(3*10**7) # Michael S. Branicky, May 25 2021

A095807 Number of integers from 0 to 10^n - 1 whose decimal digits include at least one 0.

Original entry on oeis.org

1, 10, 181, 2620, 33571, 402130, 4619161, 51572440, 564151951, 6077367550, 64696307941, 682266771460, 7140400943131, 74263608488170, 768372476393521, 7915352287541680, 81238170587875111
Offset: 1

Views

Author

Michael Taktikos, Aug 25 2004

Keywords

Examples

			a(3)=181 because among the integers from 0 to 999 there are 181 numbers which contain at least 1 zero.
		

Crossrefs

Cf. A016189.

Programs

  • Magma
    [10^n + 9/8 - 9^(1+n)/8: n in [1..20]]; // Vincenzo Librandi, Aug 14 2013
  • Mathematica
    LinearRecurrence[{20,-109,90},{1,10,181},20] (* or *) Rest[ CoefficientList[ Series[(1-19x+99x^2)/((1-x)(1-10x)(1-9x)),{x,0,20}], x]] (* Harvey P. Dale, Jun 20 2015 *)
  • PARI
    a(n) = 10^n + 9/8 - 9^(1+n)/8; \\ Michel Marcus, Aug 13 2013
    

Formula

a(n) = 10^n + 9/8 - 9^(1+n)/8.
G.f.: (1-19*x+99*x^2)/((1-x)*(1-10*x)*(1-9*x)). - Vincenzo Librandi, Aug 14 2013
a(n) = 20*a(n-1) - 109*a(n-2) + 90*a(n-3); a(0)=1, a(1)=10, a(2)=181. - Harvey P. Dale, Jun 20 2015
Limit_{n->oo} a(n+1)/a(n) = 10. - Bernard Schott, Feb 28 2023

A245805 a(n) = 12^n mod 11^n.

Original entry on oeis.org

0, 1, 23, 397, 6095, 87781, 1214423, 16344637, 1263934, 443884970, 10042515022, 172385029466, 2639243694814, 3425068947279, 144668963799141, 2875277066339415, 1085339440747772, 196822992743261908, 4383664026916317980, 13684547128550195393, 470010017784675076171
Offset: 0

Views

Author

Vincenzo Librandi, Aug 04 2014

Keywords

Crossrefs

Cf. k^n mod (k-1)^n: A002380 (k=3), A064629 (k=4), A138589 (k=5), A138649 (k=6), A139786 (k=7), A138973 (k=8), A139733 (k=9), A016189 (k=10), A016195 (k=11), this sequence (k=12),

Programs

  • Magma
    [12^n mod 11^n: n in [0..25]];
    
  • Mathematica
    Table[PowerMod[12, n, 11^n], {n, 0, 30}]
  • PARI
    vector(50, n, 12^(n-1)%11^(n-1)) \\ Derek Orr, Aug 04 2014
Previous Showing 11-20 of 21 results. Next