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-3 of 3 results.

A045926 All digits even and nonzero.

Original entry on oeis.org

2, 4, 6, 8, 22, 24, 26, 28, 42, 44, 46, 48, 62, 64, 66, 68, 82, 84, 86, 88, 222, 224, 226, 228, 242, 244, 246, 248, 262, 264, 266, 268, 282, 284, 286, 288, 422, 424, 426, 428, 442, 444, 446, 448, 462, 464, 466, 468, 482, 484, 486, 488, 622, 624, 626, 628, 642
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a045926 n = a045926_list !! (n-1)
    a045926_list = filter (all (`elem` "2468") . show) [2, 4..]
    -- Reinhard Zumkeller, Jan 01 2013
    
  • Python
    def A045926(n):
        m = (3*n+1).bit_length()-1>>1
        return int(''.join((str(((3*n+1-(1<<(m<<1)))//(3<<((m-1-j)<<1))&3)+1) for j in range(m))))<<1 # Chai Wah Wu, Feb 08 2023

Formula

a(n) = 2 * A084544(n). - Reinhard Zumkeller, Jan 01 2013

Extensions

More terms from Patrick De Geest, Jun 15 1999

A192107 Sum of all the n-digit numbers whose digits are all odd.

Original entry on oeis.org

25, 1375, 69375, 3471875, 173609375, 8680546875, 434027734375, 21701388671875, 1085069443359375, 54253472216796875, 2712673611083984375, 135633680555419921875, 6781684027777099609375, 339084201388885498046875, 16954210069444427490234375
Offset: 1

Views

Author

Bernard Schott, Dec 30 2012

Keywords

Comments

The idea for this sequence comes from question 4 of the Final Round of the Finnish High School Mathematics Contest in 1997 (see link IMO Compendium and Crux reference) where the question was asked regarding only 4-digit numbers.
A192370 is the similar sequence when all the digits are even: 2, 4, 6, 8.
A220094 is the similar sequence with the digits belonging to {1, 2, 3, 4, 5, 6, 7, 8, 9}.

Examples

			a(1) = 1 + 3 + 5 + 7 + 9 = 25.
a(2) = 11 + 13 + ... + 19 + 31 + ... + 79 + 91 + ... + 99 = 1375.
		

References

  • Finnish High School Mathematics Contest, Final Round, 1997, problem 4. [Crux Mathematicorum, v22 n3, Apr. 2002, p. 143]

Crossrefs

Programs

  • Maple
    A:=seq((10^n-1)*5^(n+1)/9,n=1..20);
  • Mathematica
    Table[((10^n - 1)*5^(n + 1))/9, {n, 20}] (* T. D. Noe, Dec 31 2012 *)
    LinearRecurrence[{55,-250},{25,1375},20] (* Harvey P. Dale, Oct 11 2018 *)
  • PARI
    a(n) = (10^n-1) * 5^(n+1)/9 \\ Charles R Greathouse IV, Jul 06 2017

Formula

a(n) = ((10^n-1) * 5^(n+1))/9 = 5^(n+1) * R_n with R_n is the repunit with n times the digit 1.
From Colin Barker, Jan 04 2013: (Start)
a(n) = 55*a(n-1) - 250*a(n-2).
G.f.: 25*x/((5*x-1)*(50*x-1)). (End)

A220094 Sum of the n-digit base-ten numbers whose digits are nonzero.

Original entry on oeis.org

45, 4455, 404595, 36446355, 3280467195, 295244704755, 26572047342795, 2391484476085155, 215233604784766395, 19371024448062897555, 1743392200482566077995, 156905298044843094701955, 14121476824048587852317595, 1270932914164487290670858355
Offset: 1

Views

Author

Bernard Schott, Dec 04 2012

Keywords

Comments

For n >= 1, a(n) is the sum of the numbers with n digits in base ten whose digits belong to the set {1,2,3,4,5,6,7,8,9}.
If E_n is the set of the numbers with n digits in base ten whose digits belong to {1,2,3,4,5,6,7,8,9}, then card(E_n) = 9^n (see A001019).

Examples

			For n=2, in base ten, a(2) = 11+12+...+19+21+...+89+91+...+98+99 = 4455.
		

References

  • A. Ducos, ElĂ©ments fondamentaux de Math Sup, Ellipses, 1994, exercice 9, p. 126.

Crossrefs

Programs

  • Maple
    := n->5*9^(n-1)*(10^n-1);
  • Mathematica
    Table[5*9^(n - 1)*(10^n - 1), {n, 20}] (* T. D. Noe, Dec 31 2012 *)
  • PARI
    a(n)=5*9^(n-1)*(10^n-1) \\ Charles R Greathouse IV, Jul 06 2017

Formula

a(n) = 5*9^(n-1)*(10^n-1).
Generalization to base b with n-digit numbers whose digits belong to {1,2,...,b-1}: a_b(n) = (b/2)*(b-1)^(n-1)*(b^n-1).
From Colin Barker, Jan 04 2013: (Start)
a(n) = 99*a(n-1) - 810*a(n-2).
G.f.: 45*x/((9*x-1)*(90*x-1)). (End)
Showing 1-3 of 3 results.